A363268 Squares (A000290) alternating with 1+squares (A002522).
1, 1, 4, 2, 9, 5, 16, 10, 25, 17, 36, 26, 49, 37, 64, 50, 81, 65, 100, 82, 121, 101, 144, 122, 169, 145, 196, 170, 225, 197, 256, 226, 289, 257, 324, 290, 361, 325, 400, 362, 441, 401, 484, 442, 529, 485, 576, 530, 625, 577, 676, 626, 729, 677, 784, 730, 841
Offset: 1
Links
- Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
Programs
-
Mathematica
c[1] = 1; c[2] = 1; c[n_] := If[OddQ[n], c[n - 2] + n, c[n - 1] - n + 2] Table[c[n], {n, 1, 120}]
Formula
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
G.f.: (-1 - x^2 + 2 x^3 - 2 x^4)/((-1 + x)^3 (1 + x)^2).