OFFSET
1,2
COMMENTS
Square pyramidal numbers when n is odd.
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1).
FORMULA
From Colin Barker, Nov 16 2012: (Start)
a(n) = (6*(5+3*(-1)^n)+(13-9*(-1)^n)*n-3*(-3+(-1)^n)*n^2+2*n^3)/48.
G.f.: -x*(x^6-x^5-2*x^4+2*x^3-x-1)/((x-1)^4*(x+1)^3). (End)
MAPLE
for i from 1 to 100 do a(2*i-1):=sum('k^2', 'k'=1..i);
a(2*i):=a(2*i-1)+1; end do;
MATHEMATICA
LinearRecurrence[{1, 3, -3, -3, 3, 1, -1}, {1, 2, 5, 6, 14, 15, 30}, 50] (* or *)
Riffle[#, #+1] & [Accumulate[Range[25]^2]] (* Paolo Xausa, Feb 22 2024 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Kritsana Sokhuma, Aug 04 2012
EXTENSIONS
More terms from Paolo Xausa, Feb 22 2024
STATUS
approved