Find all prime number $p$ such that the number of positive integer pair $(x,y)$ satisfy the following is not $29$. $1\le x,y\le 29$ $29\mid y^2-x^p-26$
Problem
Source: 2017 Korea Winter Program Practice Test 2 #5
Tags: number theory
BlazingMuddy
15.08.2019 13:33
$2$ and $7$.
Since $29$ is prime, if $p \nmid 29 - 1 = 28$, then for each $a\in \mathbb{Z}_{29}$, the equation $x^p \equiv a\pmod{29}$ has a unique solution in $\mathbb{Z}_{29}$. This means that for each $1\leq y\leq 29$, there is exactly one $x\in \{1, 2, \ldots, 29\}$ such that $29 | y^2 - x^p - 26$. Hence, $p | 28$; i.e. $p\in \{2, 7\}$. We show that indeed $p = 2$ and $p = 7$ satisfies.
For $p = 7$, the set of all elements of $\mathbb{Z}_{29}$ expressible as $x^7 \pmod{29}$ for some $x\in \mathbb{Z}_{29}$ is $\{0, 1, 12, 17, 28\}$, which can be checked as $2^7 \equiv 12\pmod{29}$ and the set, without the $0$, contains $\frac{29-1}{7} = 4$ elements. Either way, since $26$ is not on the list, for each of $z\in \{0, 1, 12, 17, 28\}$, the number of solutions to $y^2 \equiv z + 26 \pmod{p}$ in terms of $y$ (in $\mathbb{Z}_{29}$) is even, which means for each $x\in \mathbb{Z}_{29}$, the number of solutions of $y^2 - x^p - 26$ is even. This implies that the number of pairs $(x, y)$ of solutions in this case is even.
For $p = 2$, similar argument holds, except that we simply need to check that $-26$ is not a quadratic residue modulo $29$, but using Legendre symbol:
$$ \left(\frac{-26}{29}\right) = \left(\frac{3}{29}\right) = \left(\frac{29}{3}\right) = -1 $$
The problem might be generalizable to the following:
Given an odd prime number $q$ and a non-negative integer $a < q$, find all prime number $p$ such that the number of positive integer pair $(x,y)$ satisfy the following is not $q$.
$1\le x,y\le q$
$q\mid y^2-x^p-a$
We can also make use of the fact that the number of solutions of $y^2 \equiv b\pmod{q}$ in $\mathbb{Z}_q$ is equal to $\left(\frac{a}{q}\right) + 1$ for each odd prime number $q$ and $b\in \mathbb{Z}_q$ (where we define $\left(\frac{0}{q}\right) = 0$). Then, the problem simply asks to find all prime number $p$ such that:
$$ \sum_{x = 1}^q \left(\frac{x^p + a}{q}\right) \neq 0 $$
But if $x^p \not\equiv -a \pmod{q}$ for all $x\in \mathbb{Z}_q$, then using modulo $2$ the above inequality would be satisfied as $\left(\frac{x^p + a}{q}\right) \equiv 1\pmod{2}$ always holds. On the other hand, if $p \nmid q - 1$, then the possible values of $x^p + a$ modulo $q$ ranges over all the elements of $\mathbb{Z}_q$, so the left hand side would be equal to $\sum_{i = 1}^q \left(\frac{i}{q}\right) = 0$.