Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
15
Task/Factorions/Racket/factorions.rkt
Normal file
15
Task/Factorions/Racket/factorions.rkt
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#lang racket
|
||||
|
||||
(define fact
|
||||
(curry list-ref (for/fold ([result (list 1)] #:result (reverse result))
|
||||
([x (in-range 1 20)])
|
||||
(cons (* x (first result)) result))))
|
||||
|
||||
(for ([b (in-range 9 13)])
|
||||
(printf "The factorions for base ~a are:\n" b)
|
||||
(for ([i (in-range 1 1500000)])
|
||||
(let loop ([sum 0] [n i])
|
||||
(cond
|
||||
[(positive? n) (loop (+ sum (fact (modulo n b))) (quotient n b))]
|
||||
[(= sum i) (printf "~a " i)])))
|
||||
(newline))
|
||||
Loading…
Add table
Add a link
Reference in a new issue