Is it possible to find all integers $m>0$ and $n>0$ such that $n+1\mid m^2+1$ and $m+1\,|\,n^2+1$ ?

I succeed to prove there is an infinite number of solutions, but I cannot progress anymore.

Thanks !

  • 12
    $\begingroup$ Could you write down your proof for the infinite number of solutions? It may help everyone. $\endgroup$ – user37238 Feb 25 '16 at 8:22
  • 3
    $\begingroup$ If you understand French, there is a long discussion (partly numerical, partly theoretical) here $\endgroup$ – Giovanni Resta Feb 25 '16 at 8:28
  • 2
    $\begingroup$ Yes, I understand French: in fact, I participated in this discussion. One of the participants (serge17) managed to find a method to build "big" solutions $(m,n)$ : Using his method, we can prove that there are infinitely many solutions. $\endgroup$ – uvdose Feb 25 '16 at 8:37
  • 4
    $\begingroup$ @individ : for $N=1,2,3,4$, the solutions $(m,n)$ are : $(33,217)$ , $(22641,961753)$ , $(263568049,55479822393)$ , $(45074835574129,41942086060150713)$. $\endgroup$ – uvdose Feb 29 '16 at 14:25
  • 5
    $\begingroup$ If (n+1) | m^2 + 1 and (m+ 1) | n^2 + 1 then (n + 1) | ( m + 1) ^2 - 2m and ((m+1) ^ 2) | n^4 + 2 (m^2) + 1 therefore ( n + 1) | (n^4 + 2( n^2) + 1)/ h - 2m , for some integer h . So ( n+ 1) | (n^4 + 2( n^2) + 1 - (2m h)) , so (n+1) | (4n^2 - (2 m h)) and ( n+1) | 2( m h +2) . 2| m iff 2| m , so if 2| n then ( n+1) | (m h +2) and similarly ( m+1) | ( n k+ 2) for some k an element of integers. I don't know if this helps.... $\endgroup$ – 201044 Mar 15 '16 at 23:39

Some further results along the lines of thought of @individ:

Suppose $p$ and $s$ are solutions to the Pell's equation: $$-d\cdot p^2+s^2=1$$ Then, \begin{align} m &= a\cdot p^2+b\cdot pq +c\cdot q^2\\ n &= a\cdot p^2-b\cdot pq +c\cdot q^2 \end{align} are solutions if $(a,b,c,d)$ are: (these are the only sets that I found using the computer) \begin{align} (10,4,-2,-15)\\ (39,12,-3,-65)\\ \end{align} Sadly, the solutions are negative.

Here are some examples: \begin{align} (m,n) &= (-6,-38) &(a,b,c,d,p,q)&=(10,4,-2,-15,1,4)\\ (m,n) &= (-290,-2274) &(a,b,c,d,p,q)&=(10,4,-2,-15,8,31)\\ (m,n) &= (-15171,-64707) &(a,b,c,d,p,q)&=(39,12,-3,-65,16,129)\\ (m,n) &= (-1009692291,-4306907523) &(a,b,c,d,p,q)&=(39,12,-3,-65,4128,33281)\\ (m,n) &= (-67207138138563,-286676378361411) &(a,b,c,d,p,q)&=(39,12,-3,-65,1065008,8586369)\\ \end{align} P.S. I am also very curious how @individ thought of this parametrization.


Trying again, now as answer instead of just a comment:

I now have a pdf containing the text that I could not place on the margin of Gauss' masterpiece. Anyone interested?

The pdf contains a full classification of (all) solutions and a procedure on how to generate them all.


  • $\begingroup$ why link pdf? why not just list answer here? $\endgroup$ – qwr Jan 9 at 20:34

You can record a similar system:


Parametrization of solutions we write this.






Consider a special case.


Using the solutions of the equation Pell.


Enough to know first, everything else will find a formula. $(p;s) - (4;1)$



The solution then write.





These solutions are negative.

And a positive decision of the same are determined by the Pell equation.


Use the first solution. $(p;s) - (8;1)$

Next find the formula.



Will make a replacement.



The decision record.





  • $\begingroup$ In your parametrization, with t = 1, we have $1 = 3q^2 - 3xq + 2x^2$, or equivalently $2x^2 - 3xq + (3q^2-1) = 0$. This equation can be solved in numbers only if the discriminant $9q^2 - 8(3q^2- 1) = 8 - 15q^2$ is a square, but this is obviously impossible. So, either your parametrization is OK and there is no solution, or your parametrization is wrong. $\endgroup$ – MikeTeX Jan 14 at 15:50
  • $\begingroup$ @MikeTeX there are several solutions. One of these decisions was mentioned. It's private. Other solutions need to be considered. Look. Several of them. $\endgroup$ – individ Jan 14 at 16:18

To solve this system of equations - it is necessary to solve the system.


It is necessary to find a parameterization to figurirovallo Pell. It is possible for example to record this.






We need a case of when. $t=s^2-153p^2=1$

Knowing the first decision $(s ; p ) - (2177;176)$

The rest can be found by the formula.



Although this equation can be not enough. We need to find when there are multiple solutions.


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.