Let $A$ be a subset of $\{2,3, \ldots, 28 \}$ such that if $a \in A$, then the residue obtained when we divide $a^2$ by $29$ also belongs to $A$. Find the minimum possible value of $|A|$.
Problem
Source: JBMO Shortlist 2023, N3
Tags: JBMO, JBMO Shortlist, number theory, AZE JBMO TST
01.07.2024 06:36
The answer is $|A|=3$. Construction: $A=\{16,24,25\}$ or $\{7,20,23\}$. We'll prove that $|A|\geq 3$ as follows. Construct a graph by the following steps: $G=(V,E)$ , where $V=\{1,2,3,\cdots,28\}$, $E=\{(a,a^2)|a\in V\}$. Here the $a^2$ is under the modulus of $29$. Then we get a graph like that in the attachment. Let $M=\{2,4,5,10,11,13,16,18,19,24,25,27\}$, $N=\{3,6,7,8,9,14,15,20,21,22,23,26\}$, $K=\{1,12,17,28\}$. From the graph, we know that: 1) if $\exists m\in M,m\in A$, then $\{16,24,25\}\subseteq A$; 2) if $\exists n\in N,n\in A$, then $\{7,20,23\}\subseteq A$; 3) if $\exists k\in K,k\in A$, then $1\in A$, which leads to contradiction. Hence we know that $|A|\geq 3$. $\square$
Attachments:

01.07.2024 10:14
Solved with by Lazyblob Note that set $\{16,24,25\}$ satisfies the criteria . Thus min $(|A|) \leq 3$. It just suffices to prove that min $(|A|) \notin \{1,2\}$. Case $1:- |A|=1.$ In this case we must have $a^2 \equiv a \pmod {29} \implies a \equiv 0,1 \pmod {29} \implies a \in \{0,1\}$. But $0,1 \notin \{2,3,...,28\}$.Hence such set is impossible. Case $2:- |A|=2.$ In this case we must have $a^4 \equiv a \pmod {29} \implies a^3 \equiv 1 \pmod {29}$ since $a \neq 0$. By Fermat Little theorem $1 \equiv a^{28} \equiv a \cdot (a^3)^9 \equiv a \pmod {29}$ which is not possible since $a \neq 1.$ Hence min $(|A|)=3 .$
01.07.2024 14:31
Let me also comment on how to find the example for $|A|=3$. Let $x\in A$. Clearly $x^2\in A$ (where all arithmetic is modulo 29), and notice $x^2\equiv x\pmod{29}\Leftrightarrow x\in\{0,1\}\pmod{29}$, not possible. So, $x^2$ and $x$ are distinct. Now using $x^4\in A$, if $x^4\equiv x\pmod{29}$, then $x^3\equiv 1\pmod{29}$ (as $x\ne 0$). But using Fermat $x^{28}\equiv 1\pmod{29}$, so $x\equiv 1$, not possible. Thus, $x^4\in A$, too. With this, we are looking for a set $\{x,x^2,x^4\}$. Using $(x^4)^2\in A$, we must either have $x^8\equiv x$ or $x^8\equiv x^2$. The former case gives $x^7\equiv 1$, so $x\equiv g^4$, where $g$ is a primitive root modulo 29. Using now the fact $2$ is a primitive root (see, e.g., here), we recover $\{16,24,25\}$—and other examples.
01.07.2024 22:49
Actually, brute forcing this problem is extremely easy. Note that $1^2 \equiv 28^2 \equiv 1$, $2^2 \equiv 27^2 \equiv 4$, $3^2 \equiv 26^2 \equiv 9$, $4^2 \equiv 25^2 \equiv 16$, $5^2 \equiv 24^2 \equiv 25$, $6^2 \equiv 23^2 \equiv 7$, $7^2 \equiv 22^2 \equiv 20$, $8^2 \equiv 21^2 \equiv 6$, $9^2 \equiv 20^2 \equiv 23$, $10^2 \equiv 19^2 \equiv 13$, $11^2 \equiv 18^2 \equiv 24$, $12^2 \equiv 17^2 \equiv 28$, $13^2 \equiv 16^2 \equiv 24$, $14^2 \equiv 15^2 \equiv 22$, all mod $29$. Now for each number from $2$ to $28$ check that if we square it and then look at the square of the result, we do not get the initial number; and that no number squared is itself. Hence the size of $A$ must be at least $3$ and the above computations show that we have the chain $16 \to 24 \to 25 \to 16$.
By the way, if you want to check out graphs/chains formed from $x \to x^2 \pmod n$, have a look at https://arxiv.org/abs/2207.10512. There have also been attempts to do that for $x \to kx^n$.
05.07.2024 20:50
Assassino9931 wrote: Actually, brute forcing this problem is extremely easy. Note that $1^2 \equiv 28^2 \equiv 1$, $2^2 \equiv 27^2 \equiv 4$, $3^2 \equiv 26^2 \equiv 9$, $4^2 \equiv 25^2 \equiv 16$, $5^2 \equiv 24^2 \equiv 25$, $6^2 \equiv 23^2 \equiv 7$, $7^2 \equiv 22^2 \equiv 20$, $8^2 \equiv 21^2 \equiv 6$, $9^2 \equiv 20^2 \equiv 23$, $10^2 \equiv 19^2 \equiv 13$, $11^2 \equiv 18^2 \equiv 24$, $12^2 \equiv 17^2 \equiv 28$, $13^2 \equiv 16^2 \equiv 24$, $14^2 \equiv 15^2 \equiv 22$, all mod $29$. Now for each number from $2$ to $28$ check that if we square it and then look at the square of the result, we do not get the initial number; and that no number squared is itself. Hence the size of $A$ must be at least $3$ and the above computations show that we have the chain $16 \to 24 \to 25 \to 16$.
By the way, if you want to check out graphs/chains formed from $x \to x^2 \pmod n$, have a look at https://arxiv.org/abs/2207.10512. There have also been attempts to do that for $x \to kx^n$. My solution
09.08.2024 17:16
Even someone who doesn't know about anything can solve this problem just by trying. Answer is $3$. We will show that answer can't be $1$ or $2$. Assume that the answer is $1$. Then if i take a subset of $A$ with just one element say $c$, then $c^2\equiv{c}\pmod{29}$. Write this as $ c(c-1) \equiv{0}\pmod{29}$. Then, $ c\equiv{0,1}\pmod{29}$. But our set is $ A= $ {$2,3,...,28$}. Contradiction. Assume that the answer is $2$. Then if a take a subset of $A$ with two elements say $ k,t $, then $ k^2\equiv{t}\pmod{29} $ and $ t^2\equiv{k}\pmod{29} $. $ k^2-t^2\equiv{t-k}\pmod{29} \rightarrow k+t\equiv{-1}\pmod{29} $. If you write $ k \equiv{-t-1}\pmod{29}$, then $ (-t-1)^2=t^2+2t+1\equiv{t}\pmod{29}$ $\rightarrow t^2+t+1\equiv{0}\pmod{29}$. If you multiply with 4 this equation, $4t^2+4t+4\equiv{0}\pmod{29}$, $\rightarrow (2t+1)^2\equiv{-3}\pmod{29}$. It's impossible because if $-3$ is a quadratic residue$\pmod{p}$ when p is a prime, then $p\equiv{1}\pmod{3}$ but $29\equiv{2}\pmod{3}$. In conclusion, the answer is not $1,2$. Example for $3$: {$16,24,25$}. $\square$
05.01.2025 17:24
$\boxed{ANSWER:A=3}$ Case 1)$A=1$ Let's say there is number $a$ if $A=1\implies a\equiv a^2\pmod{29}$ which is contradiction because we know that $29\nmid a,a-1$ Case 2)$A=2$ $A=(a,a^2)\implies a\equiv a^4\pmod{29}\implies 29|a^3-1$ since $29\nmid a$ After case work we get get that $29|a^3-1$ is contradiction Case 3)$A=3$ $A=(a,a^2,a^4)\implies a\equiv a^8\pmod{29}\implies a^7-1\equiv 0\pmod{29}\implies a\equiv 7,16,20,23,24,25\pmod{29}\implies a=7,16,20,23,24,25$ but only case $a=7,16$ works because for other $a$ $a^4\equiv a^2\pmod{29}$ so subsets are $(7,20,23),(16,24,25)$
17.01.2025 06:01
$A=3$ works with (16,24,25). For the sake of contradiction, assume $A \leq 2$. If $A=1$, $a^2 \equiv a \pmod {29}$ which implies $a \equiv 0$ or $a \equiv 1$, a contradiction. If $A=2$, we have two integers $a,b$ such that $a^2 \equiv b \pmod {29}, b^2 \equiv a \pmod {29}$ which implies $a^4-a \equiv a(a^3-1) \equiv 0 \pmod {29}$. Since $a$ is not divisible by 29, $a^3 \equiv 1 \pmod {29}$. However, by Fermat's theorem, we have $a^{28} \equiv 1 \pmod {29}$, implying $a \equiv 1 \pmod {29}$,a contradiction.