Talk:Hailstone sequence: Difference between revisions
Content added Content deleted
(→Does the program need to do all this on its own?: new section) |
(different solutions for n = 10000000 C-cache | Pascal) |
||
Line 81: | Line 81: | ||
Does the program need to show the sequence for 27 and find the number <100,000 with the longest sequence, or do we just need to use the program to find these? |
Does the program need to show the sequence for 27 and find the number <100,000 with the longest sequence, or do we just need to use the program to find these? |
||
== cache version of C == |
|||
Running the c cache version [[Hailstone_sequence#With_caching|C]] shows: |
|||
<pre>max below 10000000 : 7532665, length 616</pre> |
|||
Pascal version shows: |
|||
<pre>Longest sequence under 10000000 : 8400511 with 686 elements</pre> |
|||
I think the problem of C-Cache is the fact that beginning with i=159487-> 5097000814 > 2^32 > unsigned long the calculation gets wrong. |
|||
I use 32 Bit. |