fork download
  1. xx=[]
  2. yy=[]
  3. num=1000
  4. for n in 0..num
  5. xx[n]=(n*Math.sqrt(n))
  6. end
  7. for n in 0..num
  8. for m in 0..n
  9. yy.push(xx[n]+xx[m])
  10. end
  11. end
  12. yy = yy.sort
  13. zz = yy.map {|x| x.floor}
  14. zz = zz.uniq
  15. a = (num*Math.sqrt(num)).floor
  16. puts a
  17. mm = (1..a).to_a - zz
  18. print mm
  19.  
  20.  
Success #stdin #stdout 0.31s 27788KB
stdin
Standard input is empty
stdout
31622
[4, 7, 20, 24, 40, 43, 48, 62, 74, 102, 138, 142, 163, 188, 249, 269, 276, 278, 331, 360, 403, 679, 682, 744, 983, 1047, 1108, 1469, 1704]