# Finding counterexample

Let $$a_1=1$$ and $$a_{n+1}=\dfrac{1+a_1^2+a_2^2+\cdots+a_n^2}{n}$$.

Find the smallest integer $$n$$ such that $$a_n$$ is not an integer.

×