RosettaCodeData/Task/Smith-numbers/Quackery/smith-numbers.quackery
2023-09-01 09:35:06 -07:00

23 lines
455 B
Text

[ 0
[ over while
swap 10 /mod
rot + again ]
nip ] is digitsum ( n --> n )
[]
10000 times
[ i^ primefactors
dup size 2 <
iff drop done
0 swap witheach
[ digitsum + ]
i^ digitsum =
if [ i^ join ] ]
say "There are "
dup size echo say " Smith numbers less than 10000." cr cr
10 split swap
say "They start: " echo cr
-10 split
say "...and end: " echo cr
drop