Link to home
Start Free TrialLog in
Avatar of Marv1n
Marv1nFlag for Afghanistan

asked on

Integer Question

Experts,

Can you tell me the only integer N, where N-1 and N+1 are a square and a cube?


Thanks!
ASKER CERTIFIED SOLUTION
Avatar of d-glitch
d-glitch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No guarantee that is the only case though....
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hope this wasn't a classroom homework assignment, else I'm telling your teacher. :)
Avatar of phoffric
phoffric

>> else I'm telling your teacher
Heh, maybe it was. Not sure what grade though given the questions that Marv1n has been asking over the years. (You can see what questions he asks by clicking on his name and go to the Activity tab, and then the Questions tab.)
Avatar of Marv1n

ASKER

Nah, someone asked me this in passing and you guys are way smarter than I ;)

I'm well out of school.
I'm curious how you would go about proving that 26 is the only one.
Essentially, you are saying that if sqrt(x^3 - 2) is an integer, then x = 3.
Hmm....
Read this thread through. The scripts above answered your question before you asked it.
The script would only prove it if it went from 1 to infinity, which it can't, you'd have issues with your double precision long before that.
Well DUH. Define the field type to allow larger values, and go far enough to satisfy that you are very unlikely to find a number in high exponential ranges where a distance of 2 will render a perfect square and cube. The script was for the thinking man. :)
If you pick an integer purely at random, the odds that it will be small enough to fit in the RAM of any computer in existence today is statistically 0.

So the script demonstrates that it holds true for roughly 0% of the integers. That may be enough for some people, but not for me.
Enjoy your personal world. All the best.
To deal with the OP question "the only integer", you need a mathematical proof that deals with all numbers, not just the first zillion numbers.

>> you are very unlikely to find a number in high exponential ranges where a distance of 2 will render a perfect square and cube.
    It may be that your intuition is correct. Then again, you may be wrong. And even if correct, you are only claiming "unlikely" as opposed to "impossible". It may be hard or even impossible to prove or disprove mathematically the OP conjecture.

If I had time, I would at least start considering some known number rules such as:
   the cube of integer can be written as the difference of two square or similarly,
for i=1..N sum(i^3) = (N+1)^2.

If the OP had included a comment "for the first quadrillion positive integers", then your extended computer solution would be adequate.