Consider 2024 distinct prime numbers $p_1, p_2, \dots, p_{2024}$ such that \[p_1+p_2+\dots+p_{1012}=p_{1013}+p_{1014}+\dots+p_{2024}.\]Let $A=p_1p_2\dots p_{1012}$ and $B=p_{1013}p_{1014}\dots p_{2024}$. Prove that $|A-B|\geq 4$.
Problem
Source: Spain MO 2024 P1
Tags: number theory, Spain
16.03.2024 15:45
I claim $A\equiv B\pmod{4}$ from which the conclusion is immediate as $A$ and $B$ are clearly distinct. Note that if $p_i=2$ for an $i$, then we have a clear contradiction (say $p_1=2$ then LHS is odd whereas RHS is even). So, $p_i\in\{\pm 1\}\pmod{4},\forall i$. Now, let $a=\{i\in\{1,\dots,1012\} : p_i\equiv 1\pmod{4}\}$ and $a=\{i\in\{1013,\dots,2024\} : p_i\equiv 1\pmod{4}\}$. Inspecting both sides modulo 4, we get that $a-(1012-a)\equiv b-(1012-b)\pmod{4}$, namely $a\equiv b\pmod{2}$. But then, $a'\equiv b'\pmod{2}$ too, where $a'=1012-a$ and $b'=1012-b$. So, $(-1)^a\equiv A \equiv (-1)^b \equiv B \pmod{4}$, thus $|A-B|\ge 4$.
21.06.2024 05:17
Notice that none of the primes can be $2$ by parity. Let $l$ and $r$ be the number of primes $p_i$ on the LHS and RHS respectively such that $p_i\equiv 1 \pmod 4$. Then we must have $2l\equiv 2r \pmod{4}$ or $r\equiv l\pmod 2$. Finally notice $A\equiv (-1)^l\equiv (-1)^r\equiv B\pmod 4$. Since obviously $A\neq B$ the result follows.
02.01.2025 19:02
I saw solutions with $(mod 4)$ but $(mod 3)$ also works Step 1:$p_i\neq 2$ Step 2:$A\neq B,B+1,B+3$ Step 3:use $(mod 3)$ and finish