Let \(a_1,a_2,...,a_n\) be real numbers such that \(a_1+2a_2+\cdots+na_n=1.\) Find the minimum value of \(a_1^2+2a_2^2+\cdots+na_n^2\) in terms of \(n\).