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.

A163980 a(n) = 2*n + (-1)^n.

Original entry on oeis.org

1, 5, 5, 9, 9, 13, 13, 17, 17, 21, 21, 25, 25, 29, 29, 33, 33, 37, 37, 41, 41, 45, 45, 49, 49, 53, 53, 57, 57, 61, 61, 65, 65, 69, 69, 73, 73, 77, 77, 81, 81, 85, 85, 89, 89, 93, 93, 97, 97, 101, 101, 105, 105, 109, 109, 113, 113, 117, 117, 121, 121, 125, 125, 129, 129, 133
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 09 2009

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1, 1, -1}, {1, 5, 5}, 50] (* or *) Table[2*n + (-1)^n, {n,1,50}] (* G. C. Greubel, Aug 24 2017 *)
  • PARI
    a(n)=n+n+(-1)^n \\ Charles R Greathouse IV, Jun 09 2011

Formula

a(n) = A005843(n) - (-1)^A001477(n).
a(n) = 2*A000027(n) + (-1)^A000027(n).
a(n) = A005843(n) + A033999(n).
From R. J. Mathar, Aug 21 2009: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3).
G.f.: x*(1+4*x-x^2)/((1+x)*(1-x)^2). (End)
a(n) = 4*n - 2 - a(n-1), with a(1)=1. - Vincenzo Librandi, Nov 30 2010
E.g.f.: (2*x+1)*cosh(x) +(2*x-1)* sinh(x) -1. - G. C. Greubel, Aug 24 2017
Sum_{n>=1} 1/a(n)^2 = Pi^2/8 + G - 1, where G is Catalan's constant (A006752). - Amiram Eldar, Aug 21 2022

Extensions

Link by Charles R Greathouse IV, Mar 25 2010