Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,16 @@
USING: formatting io kernel math math.parser math.ranges memoize
prettyprint sequences ;
IN: rosetta-code.factorions
! Memoize factorial function
MEMO: factorial ( n -- n! ) [ 1 ] [ [1,b] product ] if-zero ;
: factorion? ( n base -- ? )
dupd >base string>digits [ factorial ] map-sum = ;
: show-factorions ( limit base -- )
dup "The factorions for base %d are:\n" printf
[ [1,b) ] dip [ dupd factorion? [ pprint bl ] [ drop ] if ]
curry each nl ;
1,500,000 9 12 [a,b] [ show-factorions nl ] with each