# $30\mid p_1^4+p_2^4+\cdots+p_{31}^4$. Prove that $p_1=2,p_2=3,p_3=5$

Let $p_1<p_2<\cdots<p_{31}$ be prime numbers such that $30\mid p_1^4+p_2^4+\cdots+p_{31}^4$. Prove that $p_1=2,p_2=3,p_3=5$

I have no clue whatsoever about how to even approach this problem. Any hint is welcome.

• There's a very similar problem from the 2009 PUMaC: find all primes $p$ which can be written as $a^4 + b^4 + c^4 - 3$ for some primes $a,b,c$. – Misha Lavrov Apr 30 '18 at 6:49

Hint. Assume that $p_1\ge 7$ and evaluate your sum modulo 2, 3, and 5. You can't find the exact value of the sum in the case modulo 3, but notice that $p_i^4\equiv \pm 1\pmod3$ and argue that your sum can't be 0.
There are $30$ terms in $p_2^4+...+p_{31}^4$ and each of them is $\equiv 1\pmod 2.$ So $2$ divides $p_1^4+30$ so $2$ divides $p_1^4$ so $p_1=2$.
There are $29$ terms in $p_3^4+...+p_{31}^4$ and each of them is $\equiv 1 \pmod 3 .$ So $3$ divides $2^4+p_2^4 +29$ so $3$ divides $p_2^4$ so $p_2=3.$
There are $28$ terms in $p_4^4+...+p_{31}^4$ and each of them is $\equiv 1 \pmod 5 .$ So $5$ divides $2^4+3^4+p_3^4+28,$ so $5$ divides $p_3^4$ so $p_3=5.$