Integer solutions of $p^2 + xp - 6y = \pm1$ Given a prime $p$, how can we find positive integer solutions $(x,y)$ of the equation:
$$p^2 + xp - 6y = \pm1$$

If $p=2$ or $p=3$, you can't.
Otherwise, the extended Euclid algorithm produces a solution $(x_0,y_0)$ of $x_0 p - 6 y_0 = \pm 1$ (in fact, one for $+1$ and one for $-1$).
Then $x=x_0+6k-p$ and $y=y_0+pk$ is a solution of $p^2+xp-6y=\pm 1$. Since both $x$ and $y$ grow with $k$, we find infinitely many positive solutions, one for eack $k\ge\max\{\lfloor {p-x_0\over6}\rfloor, \lfloor {-y_0\over p}\rfloor\}+1$.
