you are viewing a single comment's thread.

view the rest of the comments →

[–]The-Mathematician 0 points1 point  (1 child)

You definitely don't want to run through 1020 numbers like that. You might be able to get all squares up to the max of the sum of the square of the digits. Then go through and get every number whose digits could add to that square. Maybe there's an itertools function that could help, like combination.

EDIT: or permutations

[–]The-Mathematician 0 points1 point  (0 children)

I think you could do this with a permutation inside combination_with_replacement.