cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A213037 a(n) = n^2 - 2*floor(n/2)^2.

Original entry on oeis.org

0, 1, 2, 7, 8, 17, 18, 31, 32, 49, 50, 71, 72, 97, 98, 127, 128, 161, 162, 199, 200, 241, 242, 287, 288, 337, 338, 391, 392, 449, 450, 511, 512, 577, 578, 647, 648, 721, 722, 799, 800, 881, 882, 967, 968, 1057, 1058, 1151, 1152, 1249, 1250, 1351
Offset: 0

Views

Author

Clark Kimberling, Jun 06 2012

Keywords

Crossrefs

Cf. A247375.
Cf. A322630 (diagonal).

Programs

  • Mathematica
    a[n_] := n^2 - 2 Floor[n/2]^2
    Table[a[n], {n, 0, 90}]    (* A213037 *)
    LinearRecurrence[{1,2,-2,-1,1},{0,1,2,7,8},60] (* Harvey P. Dale, Oct 06 2016 *)
  • PARI
    a(n) = n^2 - 2*(n\2)^2; \\ Michel Marcus, May 25 2022

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 + 3*x^2 - x^3)/((1 - x)^3*(1 + x)^2). [Corrected by Bruno Berselli, Sep 16 2014]
a(n) = A000290(n) - 2*A008794(n). - Michel Marcus, May 27 2022
E.g.f.: ((3*x + x^2)*cosh(x) + (-1 + x + x^2)*sinh(x))/2. - David Lovler, Jun 20 2022
Sum_{n>=1} 1/a(n) = Pi^2/12 - cot(Pi/sqrt(2))*Pi/(2*sqrt(2)) + 1/2. - Amiram Eldar, Sep 24 2022