The first term of value (2k-1) is term number (k^2-2k+2) so a(k^2-2k+2)=2k-1. Let n=k^2-2k+2 --> k=1+sqrt(n-1) --> a(n)=2sqrt(n-1)+1 when (n-1) is a perfect square. In the cases when (n-1) is between two consecutive perfect squares, the formula must be adjusted so that sqrt(n-1) has the value of the square root of the smaller perfect square. This yields
a(n) = 2[sqrt(n-1)] + 1
where [x] denotes the greatest integer less than or equal to x.
If s(w) denotes the sum of the first w terms of the series, then s(k^2)=(k/3)(4k^2-1). This expression covers up to the last term of size (2k-1). Let k^2 be the largest perfect square less than or equal to n. It follows that s(n)=s(k^2)+(n-k^2)(2k+1) where k=[sqrt(n)]. --> s(n)=(k/3)(4k^2-1)+(n-k^2)(2k+1). This yields
s(n) = (1/3)(2[sqrt(n)] + 1)(3n - [sqrt(n)]^2 - [sqrt(n)])
If s(n)=p (a prime), then 3p equals a product of two positive integers, so one or the other of the two factors is 1 or 3 --> only n=1,2, and 3 need to be considered --> s(3) is the only prime partial sum. |