Find every pair of integers $(p,q)$ such that $ \dfrac {p^3 -q}{pq+1} $ is an integer.
I have tried few pairs, and came with few answers. But I couldn't come with proper solution.
Find every pair of integers $(p,q)$ such that $ \dfrac {p^3 -q}{pq+1} $ is an integer.
I have tried few pairs, and came with few answers. But I couldn't come with proper solution.
Take any integer $n$. Consider a linear recurrent sequence: $$a_0=0$$ $$a_1=n$$ $$a_{i+1}=n^2\cdot a_i-a_{i-1}$$ The first few sequences are: $$\{0,2,8,30,112,418,1560,5822,21728\dots\}$$ $$\{0,3,27,240,2133,18957,168480,1497363\dots\}$$ $$\{0,4,64,1020,16256,259076,4128960\dots\}$$ Then any pair of subsequent terms (in any order) is a solution. Note also that if we take $(a_i,a_{i+1})$ as our $(p,q)$, the integer they produce is $a_{i-1}$, and if we consider $(p,q)=(a_{i+1},a_i)$ instead, we get $a_{i+2}$.
I'm not sure whether this covers all solutions, though. But I strongly suspect it does.
Let $p,q,r\in \mathbb{Z}$
$$\frac{p^3-q}{pq+1}=r \iff \frac{p^3-r}{pr+1}=q$$
Note that $q$ and $r$ are symmetric in roles,
take $q=a_{k+1}$, $r=a_{k-1}$ with $p=a_{k} \,$,
$$a_{k+1}=\frac{a_{k}^3-a_{k-1}}{a_{k} a_{k-1}+1} \iff a_{k-1}=\frac{a_{k}^3-a_{k+1}}{a_{k} a_{k+1}+1}$$
Take $a_{0}=0$ and $a_{1}=n$, that reproduces what Ivan Neretin found.
In particular, for $n=1$, $$a_{k}=\frac{2}{\sqrt{3}} \sin \frac{\pi k}{3}$$
And for $n>1$, $$a_{k}=\frac{n}{\sqrt{n^4-4}} \left[ \left( \frac{n^2+\sqrt{n^4-4}}{2} \right)^k- \left( \frac{n^2-\sqrt{n^4-4}}{2} \right)^k \right]$$