changed file and folder names to a sane scheme
This commit is contained in:
parent
c19129e6dd
commit
b725343392
34 changed files with 44 additions and 0 deletions
11
e0014/euler0014.rkt
Normal file
11
e0014/euler0014.rkt
Normal file
|
@ -0,0 +1,11 @@
|
|||
#lang typed/racket
|
||||
|
||||
(: collatz (-> Nonnegative-Integer (Listof Nonnegative-Integer)))
|
||||
(define (collatz x)
|
||||
(cond
|
||||
((equal? x 1) (list 1))
|
||||
((even? x) (cons x (collatz (quotient x 2))))
|
||||
((odd? x) (cons x (collatz (+ 1 (* 3 x)))))
|
||||
(else (list))))
|
||||
|
||||
(argmax (λ ((x : Nonnegative-Integer)) (length (collatz x))) (range 1 1000000))
|
Reference in a new issue