Problem

Source: 2010 Saudi Arabia IMO TST IV p3

Tags: recurrence relation, divides, number theory



Consider the sequence $a_1 = 3$ and $a_{n + 1} =\frac{3a_n^2+1}{2}-a_n$ for $n = 1 ,2 ,...$. Prove that if $n$ is a power of $3$ then $n$ divides $a_n$ .