Hey I recognize %, that's the modulo operator. We'll loop as long as i is odd (that is, when divided by two the remainder is one), so this will stop w

Is this true?

submited by
Style Pass
2024-05-05 19:00:02

Hey I recognize %, that's the modulo operator. We'll loop as long as i is odd (that is, when divided by two the remainder is one), so this will stop when i is even. This must be true.

On second thought, we start it at 1 and add 2 to it each time. 1, 3, 5, 7, etc. All odds. The return value will never become true, so this is not true.

Got it. So we count up to bigNumber and do a bunch of pointless math on each iteration. We return true at the end so this must be true.

Well I ran it for bigNumber set to 100000 and it took a bit, but it got there. I'm not entirely su– wait why is it called a "conjecture"?

I guess I need to be able to solve the Collatz conjecture to decide. I suppose it’s only a matter of time until we figure out if the conjecture is true or not.

Oh goodness what do we have here. It looks like we're summing up factors (numbers less than n that divide into n)… but only for the odd numbers? And we want to check if the sum of those factors is the original number.

Leave a Comment
Related Posts