Factorions: Difference between revisions
Added Quackery.
No edit summary |
(Added Quackery.) |
||
Line 906:
The factorions for base 12 are:
1 2
</pre>
=={{header|Quackery}}==
<lang Quackery> [ 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 ]</lang>
{{out}}
<pre>Factorions for base 9: [ 1 2 41282 ]
Factorions for base 10: [ 1 2 145 40585 ]
Factorions for base 11: [ 1 2 26 48 40472 ]
Factorions for base 12: [ 1 2 ]
</pre>
|