Problem

Source: 2019 Polish MO Finals

Tags: number theory, prime numbers, Divisibility



Let $p$ a prime number and $r$ an integer such that $p|r^7-1$. Prove that if there exist integers $a, b$ such that $p|r+1-a^2$ and $p|r^2+1-b^2$, then there exist an integer $c$ such that $p|r^3+1-c^2$.