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!
A number is called lucky if the sum of its digits, as well as the sum of the squares of its digits is a prime number. How many numbers between A and B are lucky? Run It Now!