The Collatz Conjecture Is a Simple Problem That Mathematicians Can't Solve
Ron Czapala
Posts: 2,418
http://www.popularmechanics.com/technology/news/a22246/simple-problem-that-still-stumps-mathematicians/
Part of the beauty of mathematics is that seemingly simple patterns lead to much more complicated questions and theories. The Collatz conjecture, which is the subject of a new video from YouTube channel Numberphile, is the perfect example of a simple problem that even the greatest mathematical minds in the world haven't been able to solve.
The essence of the question is simple. We have an interesting pattern: If you take a positive integer, and then divide by 2 if it is even, or multiply by 3 and add 1 if it is odd, then repeat this process with the resulting number, eventually you will end up with the number 1. Professor David Eisenbud of the University of California, Berkeley, demonstrates this process, also known as the hailstone sequence, using the number 7 in the video.
Comments
Pick a number. Now subtract your number. You have....................... ZERO!
It's been around since 1937 with no solution yet...
https://en.wikipedia.org/wiki/Collatz_conjecture
http://io9.gizmodo.com/5813673/the-easiest-math-conjecture-it-took-74-years-to-prove (NOT)
Save it as a .vbs file and double-click it to run.
I may have been able to come up with something like this but, it might have taken awhile. I don't have any problem setting up pst, I want to make it kid friendly, and they can check their progress.
MikeY
Try this program.
Here's the output when 7 is used as the input.
Edit: I didn't set "stepCount" to zero with each new number being tested. The embedded code is fixed but I need to attach the fixed code to a different post. I can't change which files are attached in an edit. See post below for fixed program.
Divide by 2 is only a shift down by one of all the bits in the array.
Mull by 3 and is only a shift up by one of all the bits then add the original number. Long by long, rippling the carry up.
Add 1 is easy.
Testing that you have hit 1 is easy.
This enables us to work with numbers of hundreds or thousands of bits. Depends how long you want to wait for it to run.
The intermediate steps could be easily displayed in hexadecimal.
Converting those big numbers to decimal display is a bit more tricky.
I doubt that this limit will work because the intermediate calculation results can go way higher (and lower) than the starting value before coming back down to 1.
e.g.
63728124
31864062
15932031
47796094
23898047
71694142
35847071
107541214
53770607
161311822
80655911
241967734
120983867
362951602
181475801
544427404
272213702
136106851
408320554
204160277
612480832
306240416
153120208
76560104
38280052
19140026
9570013
28710040
14355020
7177510
3588755
10766266
5383133
16149400
8074700
4037350
2018675
6056026
3028013
9084040
4542020
2271010
1135505
3406516
1703258
851629
2554888
1277444
638722
319361
958084
479042
239521
718564
359282
179641
538924
269462
134731
404194
202097
606292
303146
151573
454720
227360
113680
56840
28420
14210
7105
21316
10658
5329
15988
7994
3997
11992
5996
2998
1499
4498
2249
6748
3374
1687
5062
2531
7594
3797
11392
5696
2848
1424
712
356
178
89
268
134
67
202
101
304
152
76
38
19
58
29
88
44
22
11
34
17
52
26
13
40
20
10
5
16
8
4
2
1
I've attached the fixed code which is embedded in an earlier post. I forgot to clear the "stepCount" variable.
(Only for those under 40 years of age)
I haven't got past checking for odd or even numbers, It will take a bit to catch up with the thread. I take it back, I can read VB and understand what's going on in your script. Don't think I could write one though.
EDIT: That cool Duane, I wish I could put something together that quick. I need examples most of the time.
We are going to be watching four of the grandkids for four days in a couple of weeks, three of them can do this math, should keep them busy for an hour or two.
Thanks guys.
I think one should check for overflow on every "n*3" and then "+ 1" operation.
After all the user could input $10000000 which would go to 1 very fast but is much bigger than your UPPERLIMIT.
-Phil
You are so right, they might put the prop though it for an hour maybe.
Except one can optimize that by checking that by checking "n*3" by UPPERLIMIT - 1 such that the "+1" will never fail.
EDIT: 603 took 69 steps, 604 took 17 again, it seems odd numbers take three times the steps.
Like I said, if one could answer such questions one would probably have proved or disproved the conjecture. Thus becoming a Fields medal winner.
Count your blessings, MikeDYur. Sixteen GrandKidDays is a gift from the Gods.
Heater, I missed your comment above,
Mr. Lothar Collatz is a brain to come up with it, and it's just simple math.