A double-square number is an integer X which can be expressed as the sum of two perfect squares. For example, 10 is a double-square because 10 = 32 + 12. Run It Now!
find out all the perfect numbers between 1 and n.
ex.
factors of 28 are={1,2,4,7,14}
1+2+4+7+14=28
hence 28 is a perfect number.
test case: n=50
output: 1
6
28 Run It Now!