require 'count' a = [1] f = 0 j = 0 while f < 500 i = 1 f = 1 x = 0 a.each do |y| x += y end puts x while i <= x/2 do if x%i == 0 then f+=1 end i+=1 end a.push(a[j]+1) j+=1 end puts '' puts f puts x