login
Squares (A000290) alternating with 1+squares (A002522).
3

%I #10 Jun 04 2023 08:55:39

%S 1,1,4,2,9,5,16,10,25,17,36,26,49,37,64,50,81,65,100,82,121,101,144,

%T 122,169,145,196,170,225,197,256,226,289,257,324,290,361,325,400,362,

%U 441,401,484,442,529,485,576,530,625,577,676,626,729,677,784,730,841

%N Squares (A000290) alternating with 1+squares (A002522).

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,-2,-1,1).

%F a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).

%F G.f.: (-1 - x^2 + 2 x^3 - 2 x^4)/((-1 + x)^3 (1 + x)^2).

%t c[1] = 1; c[2] = 1;

%t c[n_] := If[OddQ[n], c[n - 2] + n, c[n - 1] - n + 2]

%t Table[c[n], {n, 1, 120}]

%Y Cf. A000290, A002522, A123596, A363267, A363269, A363283.

%K nonn,easy

%O 1,3

%A _Clark Kimberling_, May 24 2023