Problem

Source: 2013 Saudi Arabia BMO TST IV p4

Tags: divides, divisible, number theory



Find all positive integers $n < 589$ for which $589$ divides $n^2 + n + 1$.