## Prime p; p^2 is the arithmetic mean of m^2 and n^2

Let   $p$   be a prime number and that there are 2 distinct positive integers   $m$   and   $n$
such that   $p^2$   is the arithmetic mean of   $m^2$   and   $n^2$

Prove that   $2 \, p - m - n$   is either a square or twice a square.

For example, let’s go thru all prime numbers < 100

$1/2 \; (m^2 + n^2) = 5^2$   ………..   $m = \pm 7$,     $n = \pm 1$
$1/2 \; (m^2 + n^2) = 13^2$   ……….   $m = \pm 17$,     $n = \pm 7$
$1/2 \; (m^2 + n^2) = 17^2$   ……….   $m = \pm 23$,     $n = \pm 7$
$1/2 \; (m^2 + n^2) = 29^2$   ……….   $m = \pm 41$,     $n = \pm 1$
$1/2 \; (m^2 + n^2) = 37^2$   ……….   $m = \pm 47$,     $n = \pm 23$
$1/2 \; (m^2 + n^2) = 41^2$   ……….   $m = \pm 49$,     $n = \pm 31$
$1/2 \; (m^2 + n^2) = 53^2$   ……….   $m = \pm 73$,     $n = \pm 17$
$1/2 \; (m^2 + n^2) = 61^2$   ……….   $m = \pm 71$,     $n = \pm 49$
$1/2 \; (m^2 + n^2) = 73^2$   ……….   $m = \pm 103$,     $n = \pm 7$
$1/2 \; (m^2 + n^2) = 89^2$   ……….   $m = \pm 119$,     $n = \pm 41$
$1/2 \; (m^2 + n^2) = 97^2$   ……….   $m = \pm 137$,     $n = \pm 7$

$2\times 5 \; - \; 7 \; - \; 1 \; = \; 2 \; = \; 2 \; \times \; 1^2$
$2\times 13 \; - \; 17 \; - \; 7 \; = \; 2 \; = \; 2 \; \times \; 1^2$
$2\times 17 \; - \; 23 \; - \; 7 \; = \; 4 \; = \; 2^2$
$2\times 29 \; - \; 41 \; - \; 1 \; = \; 16 \; = \; 4^2$
$2\times 37 \; - \; 47 \; - \; 23 \; = \; 4 \; = \; 2^2$
$2\times 41 \; - \; 49 \; - \; 31 \; = \; 2 \; = \; 2 \; \times \; 1^2$
$2\times 53 \; - \; 73 \; - \; 17 \; = \; 16 \; = \; 4^2$
$2\times 61 \; - \; 71 \; - \; 49 \; = \; 2 \; = \; 2 \; \times \; 1^2$
$2\times 73 \; - \; 103 \; - \; 7 \; = \; 36 \; = \; 6^2$
$2\times 89 \; - \; 119 \; - \; 41 \; = \; 18 \; = \; 2 \; \times \; 3^2$
$2\times 97 \; - \; 137 \; - \; 7 \; = \; 50 \; = \; 2 \; \times \; 5^2$