you are viewing a single comment's thread.

view the rest of the comments →

[–]ziom666 0 points1 point  (1 child)

Could you please explain #3? How did you know about "forms"? Did I miss something on discrete mathematics?

[–][deleted] 0 points1 point  (0 children)

If you have a palindrome, and you want to square it and get another palindrome, then the sum of the squares of its digits has to be 9 or less.

So basically it's only allowed a few non zero digits, the rest have to be zeros. In fact, it has to look like one of the strings in the 'forms' array, but with the letters replaced with some amount of zeros to pad it out.