Anonymous user
Weird numbers: Difference between revisions
m
→optimized version: elided a test that is only good for smallish weird numbers.
m (→vanilla version: fixed a truncated statement.) |
m (→optimized version: elided a test that is only good for smallish weird numbers.) |
||
Line 2,119:
if cols>0 then say ' index │'center(' weird numbers', 1 + cols*(w+1) )
if cols>0 then say '───────┼'center("" , 1 + cols*(w+1), '─')
weirds= 0; !!.= 0 /*the count of weird numbers (so far).*/
idx= 1; $= /*index for the output list; $: 1 line*/
Line 2,172 ⟶ 2,171:
end /*j*/; return
/*──────────────────────────────────────────────────────────────────────────────────────*/
weird: procedure expose !!
if x<70 | x//3==0 then return 0 /*test if X is too low or multiple of 3*/
if !!.x then return 1 /*Is this a prime*previous #? Found one*/
parse value DaS(x) with sigma divs /*obtain sigma and the proper divisors.*/
|