Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Hailstone-sequence/PicoLisp/hailstone-sequence.l
Normal file
13
Task/Hailstone-sequence/PicoLisp/hailstone-sequence.l
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
(de hailstone (N)
|
||||
(make
|
||||
(until (= 1 (link N))
|
||||
(setq N
|
||||
(if (bit? 1 N)
|
||||
(inc (* N 3))
|
||||
(/ N 2) ) ) ) ) )
|
||||
|
||||
(let L (hailstone 27)
|
||||
(println 27 (length L) (head 4 L) '- (tail 4 L)) )
|
||||
|
||||
(let N (maxi '((N) (length (hailstone N))) (range 1 100000))
|
||||
(println N (length (hailstone N))) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue