Practical numbers: Difference between revisions
Content added Content deleted
m (→{{Header|Python}}: Huge mem saver.) |
(→{{Header|Python}}: found is set) |
||
Line 63: | Line 63: | ||
f = factors5(x) |
f = factors5(x) |
||
ps = powerset(f) |
ps = powerset(f) |
||
found = |
found = {y for y in {sum(i) for i in ps} |
||
if 1 <= y < x |
if 1 <= y < x} |
||
return len(found) == x - 1 |
return len(found) == x - 1 |
||