# How to check if a number can be represented as difference of a cube and sqaure?

How to check if a number can be represented as difference of a cube and square ?

For eg. $$18 = 27 - 9$$. Hence $$18$$ can be represented as difference of a cube and square.

• Why do you think there is a simple characterization ? – TheSilverDoe Aug 16 at 13:50
• You might be interested in the reference at oeis.org/A002938 – Empy2 Aug 16 at 13:56
• but how to check condition – sqrt Aug 16 at 14:00

This can be computed by the so-called Mordell curve, the elliptic curve $$y^2=x^3+k.$$ For a reference see the notes by K. Conrad, or the references here at MSE:

Are all Mordell equations $y^2=x^3+k$, for any integer $k$, solvable

Solutions to $y^2 = x^3 + k$?

• This is the first time the relationship has occurred to me, two squares minus a cube give everything: zakuski.utsa.edu/~jagy/Elkies_Kap.pdf – Will Jagy Aug 16 at 17:47
• @WillJagy Ah, very interesting. I wasn't aware of it, too. Perhaps we'll see this soon here as a new question. – Dietrich Burde Aug 16 at 18:12
• Interesting material. More in zakuski.utsa.edu/~jagy/papers/Experimental_1995.pdf where we informed Vaughan early enough for him to put our main example in the second edition of his book on the Hardy Littlewood method. We had not known about this, Kevin Ford told us that we had disproved an existing conjecture which was recorded in Vaughan's first edition. – Will Jagy Aug 16 at 20:15