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.

A029579 a(2*n) = n+1, a(2*n-1) = 2*n-1.

Original entry on oeis.org

1, 1, 2, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • GAP
    a:=[1,1,2,3];; for n in [5..80] do a[n]:=2*a[n-2]-a[n-4]; od; a; # Muniru A Asiru, Sep 21 2018
  • Haskell
    import Data.List (transpose)
    a029579 n = if m == 0 then n' + 1 else n  where (n', m) = divMod n 2
    a029579_list = concat $ transpose [[1 ..], [1, 3 ..]]
    -- Reinhard Zumkeller, Apr 06 2015
    
  • Maple
    seq(coeff(series((1+x+x^3)/(1-x^2)^2,x,n+1), x, n), n = 0 .. 80); # Muniru A Asiru, Sep 21 2018
  • Mathematica
    With[{nn = 50}, Riffle[Range[nn], Range[1, 2 nn + 1, 2]]] (* or *) LinearRecurrence[{0, 2, 0, -1}, {1, 1, 2, 3}, 120] (* Harvey P. Dale, Apr 22 2018 *)
  • PARI
    a(n)=(3*n+2+(2-n)*(-1)^n)/4 \\ Charles R Greathouse IV, Sep 02 2015
    

Formula

G.f.: (1 + x + x^3)/(1 - x^2)^2.
From Paul Barry, Aug 29 2004: (Start)
a(n) = (3*n + 2)/4 + (2 - n)*(-1)^n/4.
a(n) = 2*a(n-2) - a(n-4).
Binomial transform is A098156. (End)
From Gary W. Adamson, May 08 2010: (Start)
Let M = an infinite lower triangular matrix with (1, 1, 0, 1, 0, 0, 0, ...) in every column; for columns > 0, shifted down twice from the previous column.
Then A029579 = M * [1, 2, 3, 0, 0, 0, ...]. (End)
From Paul Curtz, Sep 21 2018: (Start)
a(-n) = -A174239(n).
Terms of A026741(n+1) swapped in pairs. (End)

Extensions

Title simplified by Sean A. Irvine, Feb 29 2020