When you’re approaching this problem, don’t start with 1,000,000. Actually, when dealing with large numbers, never start with the large number you want to start with; start with a very small number, like 10, and make sure your code works. Then, increase by a factor of 2 and make sure your code works again. With these small numbers, you should be able to give a very rough guess of what the answer would be, and if it’s wildly off, desk check it.
Oh, and don’t do what I did. I spent 15 minutes trying to figure out what was wrong with my code, only to realize I was outputting the wrong number. Euler wants to know the first number of the Collatz sequence, but I was outputting the length of the Collatz sequence.