RosettaCodeData/Task/Factorions/Quackery/factorions.quackery
2023-07-01 13:44:08 -04:00

38 lines
753 B
Text

[ table ] is results ( n --> s )
4 times
[ ' [ stack [ ] ]
copy
' results put ]
[ results dup take
rot join swap put ] is addresult ( n n --> )
[ table 9 10 11 12 ] is radix ( n --> n )
[ table 1 ] is ! ( n --> n )
1 11 times
[ i^ 1+ * dup
' ! put ]
drop
[ dip dup
0 temp put
[ tuck /mod !
temp tally
swap over 0 =
until ]
2drop
temp take = ] is factorion ( n n --> b )
1500000 times
[ i^ 4 times
[ dup
i^ radix
factorion if
[ dup i^
addresult ] ]
drop ]
4 times
[ say "Factorions for base "
i^ radix echo say ": "
i^ results take echo cr ]