Jump to content

Talk:Hailstone sequence: Difference between revisions

different solutions for n = 10000000 C-cache | Pascal
(different solutions for n = 10000000 C-cache | Pascal)
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?
== 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.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.