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,17 @@
USING: assocs formatting io kernel math math.primes.factors
math.ranges sequences sequences.extras ;
ERROR: nonpositive n ;
: (tau) ( n -- count )
group-factors values [ 1 + ] map-product ; inline
: tau ( n -- count ) dup 0 > [ (tau) ] [ nonpositive ] if ;
"Number of divisors for integers 1-100:" print nl
" n | tau(n)" print
"-----+-----------------------------------------" print
1 100 10 <range> [
[ "%2d |" printf ]
[ dup 10 + [a,b) [ tau "%4d" printf ] each nl ] bi
] each