0

SUNDAY CHALLENGE

Find the numbers < N that can be expressed as a sum of two cubes in TWO ways. Optimize your program so that N can be as big as possible. ex: 1729=12^3+1^3=9^3+10^3 Congrats to Sayan for winning this ! I encourage you to read the story that led to this challenge : http://mathworld.wolfram.com/Hardy-RamanujanNumber.html

20th Aug 2017, 8:58 AM
VcC
VcC - avatar
21 Réponses
+ 1
max limit it can go up to 400000 (400 K) VERSION--iii in cpp or java it can cross 800000 or even more i think.. https://code.sololearn.com/cQ0HxhBX6xuL/?ref=app
20th Aug 2017, 2:11 PM
sayan chandra
sayan chandra - avatar
+ 5
Nice one. Working on..
20th Aug 2017, 9:03 AM
MizoPro
MizoPro - avatar
20th Aug 2017, 12:10 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
0
heres mine enter maximun limit its beta version.. will get more efficient i hope... can work upto max limit--90000 just input the max limit https://code.sololearn.com/cCO912F1Ak7P/?ref=app
20th Aug 2017, 9:32 AM
sayan chandra
sayan chandra - avatar
0
Can it be n = 2*i^3 ?
20th Aug 2017, 11:49 AM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
- 1
two ways means give an eg
20th Aug 2017, 9:02 AM
sayan chandra
sayan chandra - avatar
- 1
@ sayantan your program dont checks if its a dobule cube pair.. like... i^3 + j^3 = n = k^3 + l^3 it must be dobule and same pairs cant be there like... i^3 + j^3 = n = j^3 + i^3
20th Aug 2017, 10:03 AM
sayan chandra
sayan chandra - avatar
- 1
@sayan example: 1729=12^3+1^3=9^3+10^3
20th Aug 2017, 10:06 AM
VcC
VcC - avatar
- 1
Ok who will find the highest number ?
20th Aug 2017, 10:09 AM
VcC
VcC - avatar
- 1
There are MANY more... Python is not great for memiry management. But with a few tricks you can go much higher
20th Aug 2017, 10:53 AM
VcC
VcC - avatar
- 1
No. But the higher from this thread yes :-)
20th Aug 2017, 11:03 AM
VcC
VcC - avatar
- 1
No - needs to be different ways
20th Aug 2017, 11:56 AM
VcC
VcC - avatar
- 1
@Baptiste Best so far but can you do even better ?
20th Aug 2017, 12:39 PM
VcC
VcC - avatar
- 1
Ok @sayan wins this one, congratulations... But have a look at this version, especially the method to reduce memory use and go to higher Ns, here n=130000000 (not totally doable with python because its memory management is greedier) https://code.sololearn.com/cDiR0xoxjm7y/?ref=app
20th Aug 2017, 7:59 PM
VcC
VcC - avatar
- 1
21st Aug 2017, 9:26 PM
VcC
VcC - avatar
28th Aug 2017, 8:31 AM
sayan chandra
sayan chandra - avatar
- 1
TRY THIS BRAND NEW CHALLENGE AND GET FRESH.. https://www.sololearn.com/discuss/666260/?ref=app
28th Aug 2017, 6:06 PM
sayan chandra
sayan chandra - avatar
- 1
HERE_IS_MY_NEW_CHALLENGE... GET##FRESH##CHECK-IT-OUT https://www.sololearn.com/discuss/668821/?ref=app
29th Aug 2017, 5:27 PM
sayan chandra
sayan chandra - avatar