Problem

Source: JBMO Shortlist 2023, N6

Tags: JBMO, JBMO Shortlist, number theory



Version 1. Find all primes $p$ satisfying the following conditions: (i) $\frac{p+1}{2}$ is a prime number. (ii) There are at least three distinct positive integers $n$ for which $\frac{p^2+n}{p+n^2}$ is an integer. Version 2. Let $p \neq 5$ be a prime number such that $\frac{p+1}{2}$ is also a prime. Suppose there exist positive integers $a <b$ such that $\frac{p^2+a}{p+a^2}$ and $\frac{p^2+b}{p+b^2}$ are integers. Show that $b=(a-1)^2+1$.