Let $a_1,$ $a_2,$ $\dots$ be a sequence of real numbers such that for all positive integers $n,$
\[\sum_{k = 1}^n a_k \left( \frac{k}{n} \right)^2 = 1.\]Find the smallest $n$ such that $a_n < \frac{1}{2018}.$
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Let $a_1,$ $a_2,$ $\dots$ be a sequence of real numbers such that for all positive integers $n,$
\[\sum_{k = 1}^n a_k \left( \frac{k}{n} \right)^2 = 1.\]Find the smallest $n$ such that $a_n < \frac{1}{2018}.$
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
4036
Let $a_1,$ $a_2,$ $\dots$ be a sequence of real numbers such that for all positive integers $n,$
\[\sum_{k = 1}^n a_k \left( \frac{k}{n} \right)^2 = 1.\]Find the smallest $n$ such that $a_n < \frac{1}{2018}.$
train