Jump to content

Weird numbers: Difference between revisions

Added Quackery.
(Added Quackery.)
Line 2,230:
 
Approx computation time: 284 ms</pre>
 
=={{header|Quackery}}==
 
<code>properdivisors</code> is defined at [[Proper divisors#Quackery]].
 
<lang Quackery> [ stack ] is target ( --> s )
[ stack ] is success ( --> s )
[ stack ] is makeable ( --> s )
 
[ bit makeable take
2dup & 0 !=
dip [ | makeable put ] ] is made ( n --> b )
 
[ ' [ 0 ] swap
dup target put
properdivisors
0 over witheach +
target share > not iff
[ target release
2drop false ] done
true success put
0 makeable put
witheach
[ over witheach
[ over dip
[ +
dup target share = iff
[ false success replace
drop conclude ] done
dup target share < iff
[ dup made not iff
join else drop ]
else drop ] ]
success share not if conclude
drop ]
target release
success take
makeable release
nip ] is weird ( n --> b )
 
[] 0
[ 1+
dup weird if
[ tuck join swap ]
over size 25 = until ]
drop
echo</lang>
 
{{out}}
 
<pre>[ 70 836 4030 5830 7192 7912 9272 10430 10570 10792 10990 11410 11690 12110 12530 12670 13370 13510 13790 13930 14770 15610 15890 16030 16310 ]
</pre>
 
=={{header|Racket}}==
1,462

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.