Executable library: Difference between revisions

m
Line 680:
nlen, cnt = countstones(1,99999)
 
 
println("The most common hailstone sequence length for hailstone(n) for 1 <= n < 100000")
printlnprint("The most common hailstone sequence length for hailstone(n) for 1 <= n < 100000 is $nlen, which occurs $cnt times.")
</lang>
{{output}}<pre>
Line 689:
This sequence is of length 112. It starts with [27, 82, 41, 124] and ends with [8, 4, 2, 1].
Running the program that uses the Hailstone module:
The most common hailstone sequence length for hailstone(n) for 1 <= n < 100000 is 72, which occurs 1467 times.
is 72, which occurs 1467 times.
</pre>
 
4,102

edits