Integer solutions of a cubic equation

With $\mathrm {gcd}(x,y)=1$ I have the following equation: $$x^3-xy^2+1=N$$
I want to find the integer solutions, given an N, of the variables $x$ and $y$. I have tried factoring the equation into $x(x^2-y^2)=N-1$ and then tried to link it to Pell's Equation but so far I've got nothing, I don't even understand how Pell's Equation is solved (even though I know the method, I cannot grasp the intuition or reasoning behind it), I would appreciate any help.

• there is no link to Pell or much of anything else. The reasonable procedure is to find all the divisors of $N-1,$ also the negatives of these. Then all three of $x,x-y,x+y$ must be in the list. Where did you get this problem??????? Commented Jul 20, 2015 at 0:43
• @WillJagy, is there a method that does not require brute force? I was trying to find the link to Pell because the Pell Equation does not require much brute force after finding the approximation via continued fractions. I was hoping this expression had similar solutions. Is the origin of the problem important? If so I can edit the post to bring in more detail regarding its genesis. But generally I thought such details were superfluous :)
– GuPe
Commented Jul 20, 2015 at 1:11
• I think you had better tell the whole story of this, and give some information on your own background as relates to mathematics. The one you gave has a wonderful algorithmic answer, just not closed form. Oh, the whole point of Pell is indefinite quadratic forms that cannot be factored and the solution set is infinite, you have $x(x+y)(x-y)$ and finitely many solutions. Commented Jul 20, 2015 at 1:34
• @willjagy alright, but does it really have no closed form solution?
– GuPe
Commented Jul 21, 2015 at 13:04
• Compare $xy+1=N$, which you would take to $xy=N-1$ and factor $N-1$. Is that a closed form? In this case you have three factors and need an arithmetic progression between them. Commented Jul 24, 2015 at 15:06

You could always solve for $y$:$$y=\pm\sqrt{\frac{N-1-x^3}{-x}}$$ From here, you could use brute force to find some integer $x$ value that returns integer $y$ value.

You could always do it backwards as well, solving for $x$.

This is more difficult, as you are trying to solve a cubic equation. However, there is a cubic formula with much rigorous derivation behind it.

It can be found here.

Sadly, you would still have to use brute force methods. But the cube roots and such will make finding a $y$ value that will work much narrower.