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.

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

Original entry on oeis.org

2, 10, 6, 14, 10, 18, 14, 22, 18, 26, 22, 30, 26, 34, 30, 38, 34, 42, 38, 46, 42, 50, 46, 54, 50, 58, 54, 62, 58, 66, 62, 70, 66, 74, 70, 78, 74, 82, 78, 86, 82, 90, 86, 94, 90, 98, 94, 102, 98, 106, 102, 110, 106, 114, 110
Offset: 1

Views

Author

Paul Curtz, Sep 29 2008

Keywords

Comments

First differences of A142717.

Crossrefs

First differences of A214345.

Programs

  • GAP
    List([1..55],n->2*n+3+3*(-1)^n); # Muniru A Asiru, Nov 01 2018
  • Magma
    I:=[2,10,6]; [n le 3 select I[n] else Self(n-1)+Self(n-2)-Self(n-3): n in [1..60]]; // Vincenzo Librandi, Apr 03 2013
    
  • Maple
    seq(2*n+3+3*(-1)^n,n=1..55); # Muniru A Asiru, Nov 01 2018
  • Mathematica
    Table[2 n + 3 + 3 (-1)^n, {n, 1, 60}] (* Vincenzo Librandi, Apr 03 2013 *)
    LinearRecurrence[{1,1,-1},{2,10,6},60] (* Harvey P. Dale, Aug 20 2015 *)
  • Python
    for n in range(1,50): print(2*n+3+3*(-1)**n, end=', ') # Stefano Spezia, Nov 01 2018
    

Formula

a(2n+1) = A016825(n). a(2n) = A016825(n+1).
From R. J. Mathar, Oct 24 2008: (Start)
G.f.: 2*x*(1+4*x-3*x^2)/((1+x)*(1-x)^2). [corrected by Jason Yuen, Oct 01 2024]
a(n) = a(n-1)+a(n-2)-a(n-3) = 2*A097062(n+2). (End)

Extensions

Edited by R. J. Mathar, Oct 24 2008