There is infinite sequence of composite numbers $a_1,a_2,...,$ where $a_{n+1}=a_n-p_n+\frac{a_n}{p_n}$ ; $p_n$ is smallest prime divisor of $a_n$. It is known, that $37|a_n$ for every $n$. Find possible values of $a_1$
Source: St Petersburg Olympiad 2011, Grade 9, P6
Tags: number theory
There is infinite sequence of composite numbers $a_1,a_2,...,$ where $a_{n+1}=a_n-p_n+\frac{a_n}{p_n}$ ; $p_n$ is smallest prime divisor of $a_n$. It is known, that $37|a_n$ for every $n$. Find possible values of $a_1$