A363283 Squares (A000290) and (1+squares) (A002522), in increasing order.
1, 2, 4, 5, 9, 10, 16, 17, 25, 26, 36, 37, 49, 50, 64, 65, 81, 82, 100, 101, 121, 122, 144, 145, 169, 170, 196, 197, 225, 226, 256, 257, 289, 290, 324, 325, 361, 362, 400, 401, 441, 442, 484, 485, 529, 530, 576, 577, 625, 626, 676, 677, 729, 730, 784, 785
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] u = Table[c[n], {n, 1, 120}] (* A363268 *) Union[u] (* this sequence *)
Formula
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
G.f.: x*(-1 - x + x^3 - x^4)/((-1 + x)^3 (1 + x)^2).
a(n) = ((2n^2 + 2n + 5) - (2n - 3)*(-1)^n)/8. - Aaron J Grech, Aug 26 2024
E.g.f.: ((4 + 3*x + x^2)*cosh(x) + (1 + x + x^2)*sinh(x) - 4)/4. - Stefano Spezia, Aug 27 2024
Extensions
Definition corrected by N. J. A. Sloane, Jun 12 2023
Comments