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$.
Problem
Source: JBMO Shortlist 2023, N6
Tags: JBMO, JBMO Shortlist, number theory
01.07.2024 14:10
Splendid problem. Here's a solution to V2—V1 follows directly. We first observe that $a<b\le p$: we have $p^2+a\ge p+a^2$, rearranging gives $(p-a)(p+a-1)\ge 0\Leftrightarrow p\ge a$, likewise $p\ge b$. As $a<b$, we have $a<b\le p$. We next observe that $p^2+a\mid p^4-a^2$, so $p+a^2\mid p^4-a^2$, yielding $p+a^2\mid p^4+p=p(p+1)(p^2-p+1)$. As $a<p$, we have ${\rm gcd}(p+a^2,p)=1$, so $p+a^2\mid (p+1)(p^2-p+1)$. We next let $q:=(p+1)/2$ and inspect two cases. Case 1: $q\mid p+a^2$. If $q\mid p+a^2$, then using $p\equiv -1\pmod{q}$, we find $q\mid (a-1)(a+1)$, so $a\equiv \pm 1\pmod{q}$. The case $a=1$ is clearly impossible as $(p^2+1)/(p+1)$ is never an integral. Furthermore, using $a<p$, the only possibilities are $a\in\{1+q,q-1\}$ (and $b\in\{1+q,q-1,p\}$). Set $a=(p+3)/2$. It is easy to see that if $k:=(p^2+a)/(p+a^2)\in\mathbb{N}$, then $k\le 3$; checking these cases brings no solutions. Likewise, the case $a=(p-1)/2$ is handled analogously. Case 2. $q\nmid p+a^2$. In this case, we get $p+a^2\mid 2p^2-2p+2$. Using $p+a^2\mid p^2+a\mid 2p^2+2a$, we in fact conclude that $p+a^2\mid 2a+2p-2$. Let $(2a+2p-2)=\ell(p+a^2)$. If $\ell\ge 2$, then $2a+2p-2\ge 2p+2a^2\Rightarrow a\ge a^2+1\ge 2a>a$, a contradiction. So, $\ell=1$, yielding $p=(a-1)^2$. Tracing the same reasoning, we find $b=p$, so $b=(a-1)^2+1$, as claimed.
01.07.2024 21:36
Cleaner version: Let $n$ be a positive integer and $p \neq n$ be a prime such that $\frac{p+1}{2}$ is also a prime and $p+n^2$ divides $p^2+n$. Prove that $p=(n-1)^2 + 1$.
06.01.2025 20:32
version 1 solution $\frac{p^2+n}{p+n^2}\geq 1\implies p\geq n$ case 1:$p=n$ $p=n\implies \frac{p^2+n}{p+n^2}=\frac{p^2+p}{p^2+p}=1.$ let's assume $p\neq n$ $\frac{p^2+n}{p+n^2}=p-n^2+\frac{n(n+1)(n^2-n+1)}{p+n^2}\implies p+n^2|n(n+1)(n^2-n+1)$ $gcd(p+n^2,n)=gcd(p,n)=1\implies p+n^2|(n+1)(n^2-n+1)$(1) $gcd(p+n^2,n+1)=gcd(p+1,n+1)$ since $p+1=2q>n+1\implies gcd(p+1,n+1)=gcd(2q,n+1)<2q$ case 2:$gcd(2q,n+1)=q$ $2q>n+1\geq q$ and $q|n+1\implies q=n+1$ we have $n=q-1$,$p=2q-1$ plug this in (1) we get: $q^2|q(q^2-3q+3)\implies q|3\implies q=3$,$n=2$,$p=5$ case 3:$gcd(2q,n+1)\neq q$ from (1) we get $p+n^2|2(n^2-n+1)\implies p+n^2=2(n^2-n+1)$ because $p+n^2>n^2-n+1\implies p=n^2-2n+2$ $\boxed{ANSWER:p=5,p=n,p=n^2-2n+2}$