def pna(n) a = [] n.times do |i| a << i+1 if pn(i+1) != nil end return a end a = gets.to_i p pna(a).inject