Hailstone sequence: Difference between revisions
→{{header|Picat}}: Added subsection. Added {{out}}
No edit summary |
(→{{header|Picat}}: Added subsection. Added {{out}}) |
||
Line 7,480:
nl.</lang>
{{out}}
<pre>H27:
len = 112
Line 7,486:
Longest sequence < 100_000:
[maxLen = 351,maxN = 77031]</pre>
===Mode-directed tabling===
If we just want to get the length of the longest sequence - and are not forced to use the same Hailstone function as for the H27 task - then this version using model
<lang Picat>go2 =>
time(max_chain(MaxN,MaxLen)),
Line 7,509 ⟶ 7,508:
Len=Len1+1.
</lang>
=={{header|PicoLisp}}==
|