Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Hailstone-sequence/FunL/hailstone-sequence.funl
Normal file
11
Task/Hailstone-sequence/FunL/hailstone-sequence.funl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
def
|
||||
hailstone( 1 ) = [1]
|
||||
hailstone( n ) = n # hailstone( if 2|n then n/2 else n*3 + 1 )
|
||||
|
||||
if _name_ == '-main-'
|
||||
h27 = hailstone( 27 )
|
||||
assert( h27.length() == 112 and h27.startsWith([27, 82, 41, 124]) and h27.endsWith([8, 4, 2, 1]) )
|
||||
|
||||
val (n, len) = maxBy( snd, [(i, hailstone( i ).length()) | i <- 1:100000] )
|
||||
|
||||
println( n, len )
|
||||
Loading…
Add table
Add a link
Reference in a new issue