# The smallest $n$ for which $19n+1$ and $95n+1$ are perfect squares

Find the smallest possible integer $n$ for which $19n+1$ and $95n+1$ are both perfect squares.

I somehow managed to show that $n$ is odd but couldn't find any solution for which both of them are perfect squares.

• Does the text imply that the integer in question be strictly positive? Mar 19, 2015 at 13:06
• I ran a C program to find said number but the result was an even number... Mar 19, 2015 at 13:26
• It might be my error but you please post your answer. Mar 19, 2015 at 13:42
• Did you try looking at the curve $5x^2-4=y^2$ and lines through the point $(1,1)$ which have rational slope? To get this, let the two squares be $x^2$ and $y^2$ and note that $95=19\cdot 5$. Since $(1,1)$ is a solution with $n=0$, it is on the curve. Mar 19, 2015 at 14:29
• 134232 is the smallest value
– ali
Mar 19, 2015 at 14:41

Assume,

$$95n+1 = x^2$$

$$19n+1= y^2$$

Eliminate $n$ between them and you get the Pell equation,

$$x^2-5y^2 = -4$$

I assume you know how to find all solutions $x,y$. It is then a simple matter to test them such that,

$$n = \frac{x^2-1}{95} = \frac{y^2-1}{19}$$

is an integer. The smallest ones are $n= 134232,\,920040,\,4481374227696,\, 30715795905552,\dots$ ad infinitum. (There doesn't seem to be odd n.)

Equivalently, for $m \ge 0$,

$$n = \frac{F_{18m+17}^2-1}{19} = 134232,\,4481374227696,\dots$$

$$n = \frac{F_{18m+19}^2-1}{19} = 920040,\,30715795905552,\dots$$

where $F_m$ is a Fibonacci number.