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
21 Antworten
+ 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
+ 5
Nice one.
Working on..
+ 2
https://code.sololearn.com/c0OZbtGoZ2cV/?ref=app
can go up to 750 000
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
0
Can it be n = 2*i^3 ?
- 1
two ways means
give an eg
- 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
- 1
@sayan example: 1729=12^3+1^3=9^3+10^3
- 1
Ok who will find the highest number ?
- 1
There are MANY more... Python is not great for memiry management. But with a few tricks you can go much higher
- 1
No. But the higher from this thread yes :-)
- 1
No - needs to be different ways
- 1
@Baptiste Best so far but can you do even better ?
- 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
- 1
Python version. Works up to x=10000000
https://code.sololearn.com/cB5SFl6S4T7A/?ref=app
- 1
here is new challenge...
https://www.sololearn.com/discuss/664933/?ref=app
- 1
TRY THIS BRAND NEW CHALLENGE AND GET FRESH..
https://www.sololearn.com/discuss/666260/?ref=app
- 1
HERE_IS_MY_NEW_CHALLENGE...
GET##FRESH##CHECK-IT-OUT
https://www.sololearn.com/discuss/668821/?ref=app