require 'polynomial'

def x_minus_1_to_the(p)
  return Polynomial.new(-1,1)**p
end

def prime?(p)
  return false if p < 2
  (x_minus_1_to_the(p) - Polynomial.from_string()).coefs.all?{|n| n%p==0}
end

8.times do |n|
  
  
  puts 
end

puts , 50.times.select {|n| prime? n}.join(',')