Hello all! I just found out about the Collatz Conjecture ( http://en.wikipedia.org/wiki/Collatz_conjecture ), and I noticed that the highest number ever tested for this was around 5.48*10^18. Being a programmer, I decided to see if I could test it farther. This is what I came up with:
Now, to me this code looks like it should work. For some reason, the number i will not increase. I have tried multiple ways of doing it, and I can not get it to increase until I bring it down to 5.48*10^16. I have talked to a very knowledgeable friend and even a programming teacher, and neither can figure out what the problem is. According to this ( http://www.informit.com/articles/article.aspx?p=26933 ), the ceiling of the double is 1.8*10^308, well above the value of i. I am running a computer with an i5 and 6 gb of ram, so that is not the problem. Does anybody know why this is not working?