Search for a tool
Collatz Conjecture

Tool to test the Collatz conjecture (or Hailstone or 3n+1) and variants that divide a number by 2 if it is even and else multiply it by 3 and add 1.

Results

Collatz Conjecture -

Tag(s) : Mathematics, Fun/Miscellaneous

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!


Feedback and suggestions are welcome so that dCode offers the best 'Collatz Conjecture' tool for free! Thank you!

Collatz Conjecture

Collatz 3n+1 Conjecture Test




Custom Conjecture







See also: Lychrel Number

Answers to Questions (FAQ)

What is the Collatz conjecture? (Definition)

The Collatz Conjecture (or Syracuse Conjecture), also known as the 3n+1 problem, states that applying the 3n+1 algorithm to any positive integer will always end up with the number 1.

What is the 3n+1 algorithm? (Calculation principle)

Take a number number $ n $ (non-zero positive integer), if $ n $ is even, divide it by $ 2 $, else multiply by $ 3 $ and add $ 1 $. Start again by giving $ n $ the value of the result previously obtained.

Mathematically the algorithm is defined by the function $ f $: $$ f_{3n+1}(n) = \begin{cases}{ \frac{n}{2}} & {\text{if }}n \equiv 0 \mod{2} \\ 3n+1 & {\text{if }} n \equiv 1 \mod{2} \end{cases} $$

Example: $ n=10 $, $ 10 $ is even, divide it by $ 2 $ and get $ 5 $,
$ 5 $ is odd, multiply it by $ 3 $ and add $ 1 $ to get $ 16 $,
Continue the sequence to get $ 8 $, $ 4 $, $ 2 $ and $ 1 $.

When the value $ 1 $ is obtained, continuation is generally considered complete, because the algorithm renders in an infinite loop of 4, 2, 1, 4, 2, 1, 4, 2, 1.

The sequence is generally considered to be finished at 1, because otherwise the following numbers are 4, 2, 1, 4, 2, 1, 4, 2, 1 which are repeated endlessly.

Some numbers have surprising sequences (called trajectories) like 27, 255, 447, 639 or 703.

What is the shortcut version?

If the number $ n $ is odd, then multiplying it by $ 3 $ and adding $ 1 $ necessarily makes it even, the next step is necessarily a division by 2.

The compressed (or shortened) version merges the $ 3x+1 $ and $ x/2 $ calculations into a single step $ (3x+1)/2 $

Is there any number that does not obey the Collatz Conjecture rules?

No, nobody has found a number for which it does not work but nobody has found any mathematical proof that the conjecture is always true.

This is why the conjecture is also called the Syracuse problem or the Collatz problem and it is not a theorem.

Anyone finding a number that does not end at 1 will then have solved the conjecture by proving it to be false.

Was the Collatz conjecture solved?

No, there have been some real advances recently but the Syracuse conjecture remains unsolved despite dozens of pseudo-scientists who have claimed to have a proof.

What are remarkable properties of this conjecture?

A number never appears twice in the sequence.

Any sequence ends with a series of powers of 2.

An odd number is always followed by an even number.

The numbers 5 and 32 give the same result.

How to code Collatz conjecture?

There are several ways to program source code for the 3x+1 algorithm:// Javascript
function step(n) {
if (n%2 == 0) return n/2;
return 3*n+1;
}
function collatz(n) {
var nb = 1;
while (n != 1) {
n = step(n);
nb++;
}
return nb;
}
// Python
def collatz(x):
while x != 1:
if x % 2 > 0:
x =((3 * x) + 1)
list_.append(x)
else:
x = (x / 2)
list_.append(x)
return list_

What are the other names of this conjecture?

The Collatz conjecture/problem is also known as

— 3n+1 conjecture (or 3x+1)

— Hailstone conjecture

— Ulam conjecture

— Kakutani's problem

— Thwaites conjecture

— Hasse's algorithm

Syracuse problem

— HOTPO (Half Or Triple Plus One)

The name Syracuse comes from the Syracuse University, a city in the state of New York in the United States.

What are the numbers with a given stopping time?

This table is for numbers until 1000 (total time/iterations => numbers)

01
12
24
38
416
55, 32
610, 64
73, 20, 21, 128
86, 40, 42, 256
912, 13, 80, 84, 85, 512
1024, 26, 160, 168, 170
1148, 52, 53, 320, 336, 340, 341
1217, 96, 104, 106, 113, 640, 672, 680, 682
1334, 35, 192, 208, 212, 213, 226, 227
1411, 68, 69, 70, 75, 384, 416, 424, 426, 452, 453, 454
1522, 23, 136, 138, 140, 141, 150, 151, 768, 832, 848, 852, 853, 904, 906, 908, 909
167, 44, 45, 46, 272, 276, 277, 280, 282, 300, 301, 302
1714, 15, 88, 90, 92, 93, 544, 552, 554, 560, 564, 565, 600, 602, 604, 605
1828, 29, 30, 176, 180, 181, 184, 186, 201
199, 56, 58, 60, 61, 352, 360, 362, 368, 369, 372, 373, 401, 402, 403
2018, 19, 112, 116, 117, 120, 122, 704, 720, 724, 725, 736, 738, 739, 744, 746, 753, 802, 803, 804, 805, 806
2136, 37, 38, 224, 232, 234, 240, 241, 244, 245, 267
2272, 74, 76, 77, 81, 448, 464, 468, 469, 480, 482, 483, 488, 490, 497, 534, 535, 537
2325, 144, 148, 149, 152, 154, 162, 163, 896, 928, 936, 938, 960, 964, 965, 966, 976, 980, 981, 985, 994, 995
2449, 50, 51, 288, 296, 298, 304, 308, 309, 321, 324, 325, 326, 331
2598, 99, 100, 101, 102, 576, 592, 596, 597, 608, 616, 618, 625, 642, 643, 648, 650, 652, 653, 662, 663, 713, 715
2633, 196, 197, 198, 200, 202, 204, 205, 217
2765, 66, 67, 392, 394, 396, 397, 400, 404, 405, 408, 410, 433, 434, 435, 441, 475
28130, 131, 132, 133, 134, 784, 788, 789, 792, 794, 800, 808, 810, 816, 820, 821, 833, 857, 866, 867, 868, 869, 870, 875, 882, 883, 950, 951, 953, 955
2943, 260, 261, 262, 264, 266, 268, 269, 273, 289
3086, 87, 89, 520, 522, 524, 525, 528, 529, 532, 533, 536, 538, 546, 547, 555, 571, 577, 578, 579, 583, 633, 635
31172, 173, 174, 177, 178, 179
3257, 59, 344, 346, 348, 349, 354, 355, 356, 357, 358, 385, 423
33114, 115, 118, 119, 688, 692, 693, 696, 698, 705, 708, 709, 710, 712, 714, 716, 717, 729, 761, 769, 770, 771, 777, 846, 847
3439, 228, 229, 230, 236, 237, 238
3578, 79, 456, 458, 460, 461, 465, 472, 473, 474, 476, 477, 507, 513
36153, 156, 157, 158, 912, 916, 917, 920, 922, 930, 931, 943, 944, 945, 946, 947, 948, 949, 952, 954, 971, 987
37305, 306, 307, 312, 314, 315, 316, 317
38105, 610, 611, 612, 613, 614, 624, 628, 629, 630, 631, 632, 634, 647, 683, 687
39203, 209, 210, 211
40406, 407, 409, 418, 419, 420, 421, 422, 431, 455
41135, 139, 812, 813, 814, 817, 818, 819, 827, 836, 837, 838, 840, 841, 842, 843, 844, 845, 862, 863, 910, 911
42270, 271, 278, 279, 281, 287, 303
43540, 541, 542, 545, 551, 556, 557, 558, 561, 562, 563, 574, 575, 606, 607
44185, 187, 191
45361, 363, 367, 370, 371, 374, 375, 382, 383
46123, 127, 721, 722, 723, 726, 727, 734, 735, 740, 741, 742, 747, 748, 749, 750, 764, 765, 766, 809, 891
47246, 247, 249, 254, 255
48481, 489, 492, 493, 494, 498, 499, 508, 509, 510, 539
49169, 961, 962, 963, 969, 978, 979, 984, 986, 988, 989, 996, 997, 998, 999
50329, 338, 339, 359
51641, 657, 658, 659, 665, 676, 677, 678, 718, 719
52219, 225, 239
53427, 438, 439, 443, 450, 451, 478, 479
54159, 854, 855, 876, 877, 878, 886, 887, 900, 901, 902, 907, 956, 957, 958
55295, 318, 319
56569, 585, 590, 591, 601, 636, 637, 638
58379, 393, 425
59758, 759, 767, 779, 786, 787, 801, 849, 850, 851
60283
61505, 511, 519, 566, 567
63377
64673, 679, 681, 699, 711, 754, 755
65251
66502, 503
67167, 897, 905, 923
68334, 335
69111, 603, 615, 668, 669, 670
70222, 223
71444, 445, 446
72799, 807, 888, 890, 892, 893
73297
74593, 594, 595
76395
77790, 791, 793
78263
79526, 527
80175
81350, 351
82700, 701, 702
83233
84466, 467
85155, 839, 932, 933, 934, 939
86310, 311
87103, 559, 620, 621, 622
88206, 207
89412, 413, 414
90137, 745, 824, 826, 828, 829
91274, 275
9291, 548, 549, 550
93182, 183, 993
94364, 365, 366
95121, 671, 728, 730, 732, 733, 743
96242, 243
97447, 484, 485, 486, 495
98161, 894, 895, 968, 970, 972, 973, 977, 990, 991
99322, 323
100107, 644, 645, 646, 651
101214, 215
10271, 428, 429, 430
103142, 143, 795, 856, 858, 860, 861
10447, 284, 285, 286
10594, 95, 568, 570, 572, 573
10631, 188, 189, 190
10762, 63, 376, 378, 380, 381
108124, 125, 126, 752, 756, 757, 760, 762
10941, 248, 250, 252, 253
11082, 83, 496, 500, 501, 504, 506
11127, 164, 165, 166, 992, 1000
11254, 55, 328, 330, 332, 333, 337
113108, 109, 110, 656, 660, 661, 664, 666, 674, 675
114216, 218, 220, 221
11573, 432, 436, 437, 440, 442, 449
116145, 146, 147, 864, 872, 874, 880, 881, 884, 885, 898, 899, 903, 927
117290, 291, 292, 293, 294, 299
11897, 580, 581, 582, 584, 586, 587, 588, 589, 598, 599
119193, 194, 195, 199
120386, 387, 388, 389, 390, 391, 398, 399
121129, 772, 773, 774, 776, 778, 780, 781, 782, 783, 785, 796, 797, 798
122257, 258, 259, 265
123514, 515, 516, 517, 518, 521, 523, 530, 531
124171
125342, 343, 345, 347, 353
126684, 685, 686, 689, 690, 691, 694, 695, 697, 706, 707
127231, 235
128457, 459, 462, 463, 470, 471
129913, 914, 915, 918, 919, 921, 924, 925, 926, 929, 935, 940, 941, 942, 959
130313
131609, 617, 619, 623, 626, 627, 639
133411, 415, 417
134811, 815, 822, 823, 825, 830, 831, 834, 835
136543, 553
139731, 737, 751
141487, 491
142967, 974, 975, 982, 983
143327
144649, 654, 655, 667
147859, 865, 873, 879, 889
152763, 775
170703
173937
178871

What are the numbers with a given highest number reached?

This table shows numbers until 1000 (max number reached => numbers)

11
22
44
88
163, 5, 6, 10, 12, 16
2020
2424
3232
4013, 26, 40
4848
527, 9, 11, 14, 17, 18, 22, 28, 34, 36, 44, 52
5656
6421, 42, 64
6868
7272
8080
8484
8819, 25, 29, 38, 50, 58, 76, 88
9696
10033, 66, 100
104104
11237, 74, 112
116116
128128
132132
13645, 90, 136
144144
14849, 98, 148
152152
16015, 23, 30, 35, 46, 53, 60, 70, 92, 106, 120, 140, 160
168168
176176
180180
18461, 122, 184
192192
19643, 57, 65, 86, 114, 130, 172, 196
200200
20869, 138, 208
212212
224224
228228
23251, 77, 102, 154, 204, 232
240240
24481, 162, 244
25685, 170, 256
260260
264264
272272
276276
28093, 186, 280
288288
296296
30439, 59, 67, 78, 89, 101, 118, 134, 156, 178, 202, 236, 268, 304
308308
312312
320320
324324
336336
34075, 113, 150, 226, 300, 340
344344
352117, 234, 352
356356
360360
368368
372372
384384
392392
400133, 266, 400
404404
408408
416416
424141, 282, 424
44899, 149, 198, 298, 396, 448
452452
456456
464464
468468
472157, 314, 472
480480
488488
512512
520115, 153, 173, 230, 306, 346, 460, 520
528528
532177, 354, 532
536536
544181, 362, 544
552552
560560
564564
576576
59287, 131, 174, 197, 262, 348, 394, 524, 592
596596
600600
608608
612612
616205, 410, 616
624624
628123, 139, 185, 209, 246, 278, 370, 418, 492, 556, 628
640213, 426, 640
648648
672672
680680
688229, 458, 688
692692
696696
704704
708708
712237, 474, 712
720720
724241, 482, 724
736163, 217, 245, 326, 434, 490, 652, 736
740740
744744
768768
784261, 522, 784
788788
792792
800800
80879, 105, 119, 158, 179, 210, 238, 269, 316, 358, 420, 476, 538, 632, 716, 808
816816
820273, 546, 820
832277, 554, 832
836836
840840
848848
852852
868289, 578, 868
896896
904301, 602, 904
912912
916135, 203, 270, 305, 406, 540, 610, 812, 916
920920
928309, 618, 928
936936
944944
948948
952187, 211, 249, 281, 317, 374, 422, 498, 562, 634, 748, 844, 952
960960
964321, 642, 964
976325, 650, 976
980980
984984
996996
1024151, 201, 227, 302, 341, 402, 454, 604, 682, 804, 908
1048349, 698
1072357, 714
1108369, 738
1120373, 746
1156385, 770
1192397, 794
1204267, 401, 534, 802
1216405, 810
1264421, 842
1300433, 866
1360453, 906
1384307, 409, 461, 614, 818, 922
1396465, 930
1408469, 938
1432477, 954
1480493, 986
1492331, 441, 497, 662, 882, 994
1540513
1576525
1588529
1600315, 355, 473, 533, 630, 710, 946
1624541
1636363, 545, 726
1672219, 247, 329, 371, 438, 494, 557, 658, 742, 876, 988
1684561
1696565
1732577
1792597
1816403, 537, 605, 806
1840613
1876625
1888279, 419, 558, 629, 838
1960435, 653, 870
1972657
2080693
2116705
2128709
2152717
2164721
2176483, 725, 966
2224741
2248295, 393, 443, 499, 590, 665, 749, 786, 886, 998
2260753
2308769
2368789
2416805
2440813
2452817
2464547, 729, 821
2500555, 833
2512837
2536375, 563, 750, 845
2560853
2608579, 869
2632877
2728909
2752271, 361, 379, 407, 427, 481, 505, 542, 569, 611, 641, 673, 722, 758, 814, 854, 897, 917, 962
2836945
2848949
2884961
2896507, 571, 643, 761, 857, 965
2944981
2968439, 585, 659, 878, 989
2992997
3076303, 455, 606, 683, 910
3220423, 635, 715, 846, 953
3256723
3328739, 985
3472771
3508519, 779
3544699, 787
3616475, 535, 633, 713, 803, 950
3688819
3796843
3904867
3940583, 777, 875
3976883
4192367, 489, 551, 734, 827, 931, 978
4264631, 747, 841, 947
4336963
4372127, 169, 191, 225, 254, 287, 338, 339, 382, 431, 450, 451, 508, 509, 574, 601, 647, 676, 677, 678, 764, 765, 801, 862, 900, 901, 902, 971
4408979
4480663, 995
4804711
4840955
4912727, 969
5128759
5776855
5812603, 679, 905
5992591, 887
6424951
6964687
7504987
8080559, 745, 839, 993
8584847, 891
923227, 31, 41, 47, 54, 55, 62, 63, 71, 73, 82, 83, 91, 94, 95, 97, 103, 107, 108, 109, 110, 111, 121, 124, 125, 126, 129, 137, 142, 143, 145, 146, 147, 155, 159, 161, 164, 165, 166, 167, 171, 175, 182, 183, 188, 189, 190, 193, 194, 195, 199, 206, 207, 214, 215, 216, 218, 220, 221, 222, 223, 231, 233, 235, 239, 242, 243, 248, 250, 251, 252, 253, 257, 258, 259, 263, 265, 274, 275, 283, 284, 285, 286, 290, 291, 292, 293, 294, 297, 299, 310, 311, 313, 318, 319, 322, 323, 327, 328, 330, 332, 333, 334, 335, 337, 342, 343, 345, 347, 350, 351, 353, 359, 364, 365, 366, 376, 377, 378, 380, 381, 386, 387, 388, 389, 390, 391, 395, 398, 399, 411, 412, 413, 414, 415, 417, 425, 428, 429, 430, 432, 436, 437, 440, 442, 444, 445, 446, 449, 457, 459, 462, 463, 466, 467, 470, 471, 478, 479, 484, 485, 486, 487, 491, 496, 500, 501, 502, 503, 504, 506, 514, 515, 516, 517, 518, 521, 523, 526, 527, 530, 531, 539, 543, 548, 549, 550, 553, 566, 567, 568, 570, 572, 573, 580, 581, 582, 584, 586, 587, 588, 589, 593, 594, 595, 598, 599, 607, 609, 617, 619, 620, 621, 622, 623, 626, 627, 636, 637, 638, 644, 645, 646, 649, 651, 654, 655, 656, 660, 661, 664, 666, 668, 669, 670, 674, 675, 684, 685, 686, 689, 690, 691, 694, 695, 697, 700, 701, 702, 706, 707, 718, 719, 728, 730, 731, 732, 733, 737, 752, 754, 755, 756, 757, 760, 762, 763, 772, 773, 774, 775, 776, 778, 780, 781, 782, 783, 785, 790, 791, 793, 796, 797, 798, 809, 811, 815, 822, 823, 824, 825, 826, 828, 829, 830, 834, 835, 849, 850, 851, 856, 858, 859, 860, 861, 864, 865, 872, 873, 874, 880, 881, 884, 885, 888, 890, 892, 893, 898, 899, 903, 911, 913, 914, 915, 918, 919, 921, 924, 925, 926, 929, 932, 933, 934, 935, 939, 940, 941, 942, 956, 957, 958, 967, 968, 970, 972, 973, 974, 977, 982, 983, 992, 1000
9556943
9880975
10024879
10528615, 923
11176735
11392999
12148799
13120255, 383, 510, 575, 766, 863, 907
14308495, 743, 990
15064991
15856927
18952831
21688667, 751, 889
39364447, 511, 671, 681, 767, 795, 807, 894, 895
41524639, 959
190996871
250504703, 937

What numbers go above N?

The table above shows altitudes up to 250504 for numbers up to 1000. But there are infinite numbers that go higher.

For any given number N (very large N), then the odd number closest to N will have an even greater elevation.

When was the conjecture proposed?

Formulated in 1937 by Lothar Collatz (german mathematician), it remains unsolved: nobody has been able to prove this conjecture always ends with 1.

Source code

dCode retains ownership of the "Collatz Conjecture" source code. Except explicit open source licence (indicated Creative Commons / free), the "Collatz Conjecture" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Collatz Conjecture" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Collatz Conjecture" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.

Cite dCode

The copy-paste of the page "Collatz Conjecture" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Collatz Conjecture on dCode.fr [online website], retrieved on 2024-12-18, https://www.dcode.fr/collatz-conjecture

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'Collatz Conjecture' tool for free! Thank you!


https://www.dcode.fr/collatz-conjecture
© 2024 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaching / CTF.
 
Feedback