Jump to content

Magnanimous numbers: Difference between revisions

Added Quackery.
(Added Quackery.)
Line 2,775:
486685 488489 515116 533176 551558 559952 595592 595598 600881 602081
</pre>
 
=={{header|Quackery}}==
 
<syntaxhighlight lang="Quackery"> [ [] swap
[ 10 /mod
rot join swap
dup 0 = until ]
drop ] is ->digits ( n --> [ )
 
[ 0 swap witheach
[ swap 10 * + ] ] is digits-> ( [ --> n )
 
[ ->digits
true
over size 1 - times
[ over i 1+ split
digits->
swap digits->
+ isprime not if
[ not
conclude ] ]
nip ] is magnanimous ( n --> b )
 
[] 0
[ dup magnanimous
if [ tuck join swap ]
1+
over size 250 =
until ]
drop
say "First 45 magnanimous numbers:" cr
45 split swap echo cr cr
say "Magnanimous numbers 241-250:" cr
-10 split echo cr cr
drop</syntaxhighlight>
 
{{out}}
 
<pre>First 45 magnanimous numbers:
[ 0 1 2 3 4 5 6 7 8 9 11 12 14 16 20 21 23 25 29 30 32 34 38 41 43 47 49 50 52 56 58 61 65 67 70 74 76 83 85 89 92 94 98 101 110 ]
 
Magnanimous numbers 241-250:
[ 17992 19972 20209 20261 20861 22061 22201 22801 22885 24407 ]
</pre>
 
 
=={{header|Raku}}==
1,462

edits

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