Practical numbers: Difference between revisions
Content added Content deleted
(→{{Header|Python}}: Alternate.) |
(→{{Header|Python}}: Alternate) |
||
Line 83: | Line 83: | ||
; Alternate version: |
; Alternate version: |
||
This version |
This version has an optimisation that might prove ``much`` faster in some cases but slower than the above in others. |
||
A number with a large number of factors, f has <code>2**len(f)</code> sets in its powerset. 672 for example has 23 factors and so 8_388_608 sets in its powerset.<br> |
|||
Just taking the sets as they are generated and stopping when we first know that 672 is Practical needs just the first 28_826 or 0.34% of |
|||
the sets. 720, another Practical number needs just 0.01% of its half a billion sets to prove it is Practical. |
|||
Note however that if the number is ```not``` |
|||
===Or, as a composition of pure functions=== |
===Or, as a composition of pure functions=== |