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.

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

Original entry on oeis.org

1, 0, 6, 2, 26, 10, 106, 42, 426, 170, 1706, 682, 6826, 2730, 27306, 10922, 109226, 43690, 436906, 174762, 1747626, 699050, 6990506, 2796202, 27962026, 11184810, 111848106, 44739242, 447392426, 178956970, 1789569706, 715827882, 7158278826
Offset: 1

Views

Author

Roger L. Bagula, Apr 29 2010

Keywords

Comments

The ratio a(n+1)/a(n) approaches 10 for even n and 2/5 for odd n as n->infinity.

Crossrefs

Merger of A020988 (even n) and A020989 (odd n).

Programs

  • GAP
    List([1..30], n-> (3*2^(n-1) -(-2)^n -2)/3); # G. C. Greubel, Dec 28 2019
  • Magma
    [(3*2^(n-1) -(-2)^n -2)/3: n in [1..30]]; // G. C. Greubel, Dec 28 2019
    
  • Maple
    seq( (3*2^(n-1) -(-2)^n -2)/3, n=1..30); # G. C. Greubel, Dec 28 2019
  • Mathematica
    a[n_]:= a[n]= 2^(n-1)*If[n==1, 1, a[n-1]/2 +(-1)^(n-1)*Sqrt[(5 +4*(-1)^(n-1) )]/2]; Table[a[n], {n,30}]
    LinearRecurrence[{1,4,-4}, {1,0,6}, 30] (* G. C. Greubel, Dec 28 2019 *)
  • PARI
    vector(30, n, (3*2^(n-1) -(-2)^n -2)/3 ) \\ G. C. Greubel, Dec 28 2019
    
  • Sage
    [(3*2^(n-1) -(-2)^n -2)/3 for n in (1..30)] # G. C. Greubel, Dec 28 2019
    

Formula

From R. J. Mathar, Apr 30 2010: (Start)
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3).
G.f.: x*(1 - x + 2*x^2)/( (1-x)*(1+2*x)*(1-2*x) ). (End)
a(n) = A087231(n), n > 2. - R. J. Mathar, May 03 2010
a(2n-1) = A061547(2n), a(2n) = A061547(2n-1), n > 0. - Yosu Yurramendi, Dec 23 2016
a(n+1) = 2*A096773(n), n > 0. - Yosu Yurramendi, Dec 30 2016
a(2n-1) = A020989(n-1), a(2n) = A020988(n-1), n > 0. - Yosu Yurramendi, Jan 03 2017
a(2n-1) = (A083597(n-1) + A000302(n-1))/2, a(2n) = (A083597(n-1) - A000302(n-1))/2, n > 0. - Yosu Yurramendi, Mar 04 2017
a(n+2) = 4*a(n) + 2, a(1) = 1, a(2) = 0, n > 0. - Yosu Yurramendi, Mar 07 2017
a(n) = (-16 + (9 - (-1)^n) * 2^(n - (-1)^n))/24. - Loren M. Pearson, Dec 28 2019
E.g.f.: (3*exp(2*x) - 4*exp(x) + 3 - 2*exp(-2*x))/6. - G. C. Greubel, Dec 28 2019
a(n) = (2^n*5^(n mod 2) - 4)/6. - Heinz Ebert, Jun 29 2021