flat assembler
Message board for the users of flat assembler.

 Index > Heap > is there a simple mathematical problem but hard to solve? Goto page Previous  1, 2
Author
sleepsleep

Joined: 05 Oct 2006
Posts: 9002
Location: ˛　　　　　　　　　　　　　　　　　　　　　　　　　　　　　⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
thanks YONG,
my little brain would love to confirm that Collatz conjecture too!!
29 Jun 2015, 10:39
typedef

Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
Code:
```public class main {
public static void main(String[] args) {
doIt(4294967295L);
}

static long doIt(long n){
System.out.println("n: " + n);
if(n == 1) return 1;
return doIt(n % 2 == 0 ? n >> 1 : 3 * n + 1);
}
}
```

Code:
```run:
n: 4294967295
n: 12884901886
n: 6442450943
n: 19327352830
n: 9663676415
n: 28991029246
n: 14495514623
n: 43486543870
n: 21743271935
n: 65229815806
n: 32614907903
n: 97844723710
n: 48922361855
n: 146767085566
n: 73383542783
n: 220150628350
n: 110075314175
n: 330225942526
n: 165112971263
n: 495338913790
n: 247669456895
n: 743008370686
n: 371504185343
n: 1114512556030
n: 557256278015
n: 1671768834046
n: 835884417023
n: 2507653251070
n: 1253826625535
n: 3761479876606
n: 1880739938303
n: 5642219814910
n: 2821109907455
n: 8463329722366
n: 4231664861183
n: 12694994583550
n: 6347497291775
n: 19042491875326
n: 9521245937663
n: 28563737812990
n: 14281868906495
n: 42845606719486
n: 21422803359743
n: 64268410079230
n: 32134205039615
n: 96402615118846
n: 48201307559423
n: 144603922678270
n: 72301961339135
n: 216905884017406
n: 108452942008703
n: 325358826026110
n: 162679413013055
n: 488038239039166
n: 244019119519583
n: 732057358558750
n: 366028679279375
n: 1098086037838126
n: 549043018919063
n: 1647129056757190
n: 823564528378595
n: 2470693585135786
n: 1235346792567893
n: 3706040377703680
n: 1853020188851840
n: 926510094425920
n: 463255047212960
n: 231627523606480
n: 115813761803240
n: 57906880901620
n: 28953440450810
n: 14476720225405
n: 43430160676216
n: 21715080338108
n: 10857540169054
n: 5428770084527
n: 16286310253582
n: 8143155126791
n: 24429465380374
n: 12214732690187
n: 36644198070562
n: 18322099035281
n: 54966297105844
n: 27483148552922
n: 13741574276461
n: 41224722829384
n: 20612361414692
n: 10306180707346
n: 5153090353673
n: 15459271061020
n: 7729635530510
n: 3864817765255
n: 11594453295766
n: 5797226647883
n: 17391679943650
n: 8695839971825
n: 26087519915476
n: 13043759957738
n: 6521879978869
n: 19565639936608
n: 9782819968304
n: 4891409984152
n: 2445704992076
n: 1222852496038
n: 611426248019
n: 1834278744058
n: 917139372029
n: 2751418116088
n: 1375709058044
n: 687854529022
n: 343927264511
n: 1031781793534
n: 515890896767
n: 1547672690302
n: 773836345151
n: 2321509035454
n: 1160754517727
n: 3482263553182
n: 1741131776591
n: 5223395329774
n: 2611697664887
n: 7835092994662
n: 3917546497331
n: 11752639491994
n: 5876319745997
n: 17628959237992
n: 8814479618996
n: 4407239809498
n: 2203619904749
n: 6610859714248
n: 3305429857124
n: 1652714928562
n: 826357464281
n: 2479072392844
n: 1239536196422
n: 619768098211
n: 1859304294634
n: 929652147317
n: 2788956441952
n: 1394478220976
n: 697239110488
n: 348619555244
n: 174309777622
n: 87154888811
n: 261464666434
n: 130732333217
n: 392196999652
n: 196098499826
n: 98049249913
n: 294147749740
n: 147073874870
n: 73536937435
n: 220610812306
n: 110305406153
n: 330916218460
n: 165458109230
n: 82729054615
n: 248187163846
n: 124093581923
n: 372280745770
n: 186140372885
n: 558421118656
n: 279210559328
n: 139605279664
n: 69802639832
n: 34901319916
n: 17450659958
n: 8725329979
n: 26175989938
n: 13087994969
n: 39263984908
n: 19631992454
n: 9815996227
n: 29447988682
n: 14723994341
n: 44171983024
n: 22085991512
n: 11042995756
n: 5521497878
n: 2760748939
n: 8282246818
n: 4141123409
n: 12423370228
n: 6211685114
n: 3105842557
n: 9317527672
n: 4658763836
n: 2329381918
n: 1164690959
n: 3494072878
n: 1747036439
n: 5241109318
n: 2620554659
n: 7861663978
n: 3930831989
n: 11792495968
n: 5896247984
n: 2948123992
n: 1474061996
n: 737030998
n: 368515499
n: 1105546498
n: 552773249
n: 1658319748
n: 829159874
n: 414579937
n: 1243739812
n: 621869906
n: 310934953
n: 932804860
n: 466402430
n: 233201215
n: 699603646
n: 349801823
n: 1049405470
n: 524702735
n: 1574108206
n: 787054103
n: 2361162310
n: 1180581155
n: 3541743466
n: 1770871733
n: 5312615200
n: 2656307600
n: 1328153800
n: 664076900
n: 332038450
n: 166019225
n: 498057676
n: 249028838
n: 124514419
n: 373543258
n: 186771629
n: 560314888
n: 280157444
n: 140078722
n: 70039361
n: 210118084
n: 105059042
n: 52529521
n: 157588564
n: 78794282
n: 39397141
n: 118191424
n: 59095712
n: 29547856
n: 14773928
n: 7386964
n: 3693482
n: 1846741
n: 5540224
n: 2770112
n: 1385056
n: 692528
n: 346264
n: 173132
n: 86566
n: 43283
n: 129850
n: 64925
n: 194776
n: 97388
n: 48694
n: 24347
n: 73042
n: 36521
n: 109564
n: 54782
n: 27391
n: 82174
n: 41087
n: 123262
n: 61631
n: 184894
n: 92447
n: 277342
n: 138671
n: 416014
n: 208007
n: 624022
n: 312011
n: 936034
n: 468017
n: 1404052
n: 702026
n: 351013
n: 1053040
n: 526520
n: 263260
n: 131630
n: 65815
n: 197446
n: 98723
n: 296170
n: 148085
n: 444256
n: 222128
n: 111064
n: 55532
n: 27766
n: 13883
n: 41650
n: 20825
n: 62476
n: 31238
n: 15619
n: 46858
n: 23429
n: 70288
n: 35144
n: 17572
n: 8786
n: 4393
n: 13180
n: 6590
n: 3295
n: 9886
n: 4943
n: 14830
n: 7415
n: 22246
n: 11123
n: 33370
n: 16685
n: 50056
n: 25028
n: 12514
n: 6257
n: 18772
n: 9386
n: 4693
n: 14080
n: 7040
n: 3520
n: 1760
n: 880
n: 440
n: 220
n: 110
n: 55
n: 166
n: 83
n: 250
n: 125
n: 376
n: 188
n: 94
n: 47
n: 142
n: 71
n: 214
n: 107
n: 322
n: 161
n: 484
n: 242
n: 121
n: 364
n: 182
n: 91
n: 274
n: 137
n: 412
n: 206
n: 103
n: 310
n: 155
n: 466
n: 233
n: 700
n: 350
n: 175
n: 526
n: 263
n: 790
n: 395
n: 1186
n: 593
n: 1780
n: 890
n: 445
n: 1336
n: 668
n: 334
n: 167
n: 502
n: 251
n: 754
n: 377
n: 1132
n: 566
n: 283
n: 850
n: 425
n: 1276
n: 638
n: 319
n: 958
n: 479
n: 1438
n: 719
n: 2158
n: 1079
n: 3238
n: 1619
n: 4858
n: 2429
n: 7288
n: 3644
n: 1822
n: 911
n: 2734
n: 1367
n: 4102
n: 2051
n: 6154
n: 3077
n: 9232
n: 4616
n: 2308
n: 1154
n: 577
n: 1732
n: 866
n: 433
n: 1300
n: 650
n: 325
n: 976
n: 488
n: 244
n: 122
n: 61
n: 184
n: 92
n: 46
n: 23
n: 70
n: 35
n: 106
n: 53
n: 160
n: 80
n: 40
n: 20
n: 10
n: 5
n: 16
n: 8
n: 4
n: 2
n: 1

```
29 Jun 2015, 21:16
sleepsleep

Joined: 05 Oct 2006
Posts: 9002
Location: ˛　　　　　　　　　　　　　　　　　　　　　　　　　　　　　⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
i think base 9 number system but use base 10 number really power.

the addition of each integer inside a number will show us the row it would be,

eg.
119 = 1 + 1 + 9
11 = 1 + 1
row 2. if you check above table, 119 in O2

and some sort of relationship there,
the numbers will just reverse, and appear on same row.
eg. 3 - 12 - 21 -30 - 39 - 93 - 48 - 84 - 57 - 75 - 66
102 - 201

is that possible to get the X that multiply 9 to reach a value?
eg.

6444, in row 9
so based with information 6444 and 9 ONLY, how to get 716?
without doing division.
30 Jun 2015, 17:39
sleepsleep

Joined: 05 Oct 2006
Posts: 9002
Location: ˛　　　　　　　　　　　　　　　　　　　　　　　　　　　　　⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
i found a method that could tell me the result of multiply will exists in which row.

i build a table, the unique part is numbers in row 7.
only 4 x 4 and 5 x 5 will cause numbers in row 7 to show up.

eg. we use small number to test, but i think the big number will conform to this property too.
32 X 3 = 96

96 in row 6, but one could know the result is in row 6 based on 32 x 3 without doing the calculation.

eg. 32 x 3 = 3+2 x 3 = 5 x 3, if you refer the table, 5 x 3 = row 6

eg. 372 x 439 = 163308 (we know this number is in row 3)
372 = 3 { 3 + 7 + 2 } = { 1 + 2 }
439 = 7 { 4 + 3 + 9 } = { 1 + 6 }
from here we also know, subtract 3 from the number, we will get 163305 divide clean by 9
30 Jun 2015, 20:07
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17474
revolution
sleepsleep: Is that supposed to be working towards factoring the RSA numbers? Or is that for another problem?
01 Jul 2015, 12:12
sleepsleep

Joined: 05 Oct 2006
Posts: 9002
Location: ˛　　　　　　　　　　　　　　　　　　　　　　　　　　　　　⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
revolution: i think i start with verifying the relationship of integers, it seems all of them are having more relationship than what are mentioned on books.

doing exploration and discovery. (by using a pen and papers)

/me still think, there got to be a way to have da result of multiplication skipping all the tedious calculation.
01 Jul 2015, 15:26
sleepsleep

Joined: 05 Oct 2006
Posts: 9002
Location: ˛　　　　　　　　　　　　　　　　　　　　　　　　　　　　　⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
YONG wrote:
sleepsleep wrote:
i think i need one of such problem and spend the whole life cracking it, please recommend me one, a simple but unsolved by human.
You should try to crack the Collatz conjecture.

The conjecture is very simple:
- Take any positive integer n.
- If n is even, divide it by 2. Otherwise, multiply it by 3 and add 1 to the result.
- Repeat this process indefinitely.
- You will ALWAYS reach 1, regardless of the initial value of n.

Now, prove or disprove this conjecture.

i tried cracking this, and sure, everything will lead to 1 regardless of how big n is.

Quote:
27, 82, 41, 124, 62, 31, 94, 47, 142, 71, 214, 107, 322, 161, 484, 242, 121, 364, 182, 91, 274, 137, 412, 206, 103, 310, 155, 466, 233, 700, 350, 175, 526, 263, 790, 395, 1186, 593, 1780, 890, 445, 1336, 668, 334, 167, 502, 251, 754, 377, 1132, 566, 283, 850, 425, 1276, 638, 319, 958, 479, 1438, 719, 2158, 1079, 3238, 1619, 4858, 2429, 7288, 3644, 1822, 911, 2734, 1367, 4102, 2051, 6154, 3077, 9232, 4616, 2308, 1154, 577, 1732, 866, 433, 1300, 650, 325, 976, 488, 244, 122, 61, 184, 92, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1

if you reverse the conjecture,

is that possible to reach any number, using ( * 2 ) and ( 3n - 1) with one, if the previous is odd, the next must be even.
and if 1 to 1 million integer all back to 1, what make people choose to believe 1 million to another 2 million, there will be 1 integer or so that will not return to 1?

one thing i am trying to learn,

does the whole long integer really reflect the multiplication or, only the last digit in a long integer should be in focused.
01 Jul 2015, 15:37
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
sleepsleep wrote:
if you reverse the conjecture, is that possible to reach any number, using ( * 2 ) and ( 3n - 1) with one, if the previous is odd, the next must be even.
Yes, you could do so. If you can prove that you can reach ANY positive integer, the conjecture is true.

Good luck!

02 Jul 2015, 09:37
MHajduk

Joined: 30 Mar 2006
Posts: 6038
Location: Poland
MHajduk
Sometimes we don't need an ideal solution, a decent approximation is enough for practical purposes. Take a look at this nice geometrical construction (click on the image to see the enlarged version of it):

02 Jul 2015, 12:00
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsCompiler InternalsIDE DevelopmentOS ConstructionNon-x86 architecturesHigh Level LanguagesProgramming Language DesignProjects and IdeasExamples and Tutorials Other----------------FeedbackHeapTest Area
Goto page Previous  1, 2

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou can attach files in this forumYou can download files in this forum