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.

A232801 a(2n) = (3^n - 1)/2, a(2n+1) = 3^n.

Original entry on oeis.org

0, 1, 1, 3, 4, 9, 13, 27, 40, 81, 121, 243, 364, 729, 1093, 2187, 3280, 6561, 9841, 19683, 29524, 59049, 88573, 177147, 265720, 531441, 797161, 1594323, 2391484, 4782969, 7174453, 14348907, 21523360, 43046721, 64570081, 129140163, 193710244, 387420489
Offset: 0

Views

Author

Richard R. Forberg, Nov 30 2013

Keywords

Crossrefs

Programs

  • Magma
    [(1+(-1)^n)*(3^(n div 2)-1)/4+(1-(-1)^n)*3^((n-1) div 2)/2 : n in [0..50]]; // Wesley Ivan Hurt, Aug 29 2015
  • Maple
    A232801:=n->(1+(-1)^n)*(3^(n/2)-1)/4+(1-(-1)^n)*3^(n/2-1/2)/2: seq(A232801(n), n=0..50); # Wesley Ivan Hurt, Aug 29 2015
  • Mathematica
    Table[If[OddQ[n], 3^((n-1)/2), (3^(n/2)-1)/2], {n, 0, 50}] (* T. D. Noe, Dec 11 2013 *)
    RecurrenceTable[{a[n]== 4*a[n-2] - 3*a[n-4], a[0]==0, a[1]==1, a[2]==1, a[3]==3}, a, {n,0,50}] (* G. C. Greubel, Aug 29 2015 *)

Formula

a(2n+1) = (a(2n) + a(2n+2) + 1)/2, a(0) = 0.
The second differences of a(n) alternate: -1, 3^(n-1) + 1, for n >= 0.
a(2n) = A003462(n), a(2n+1) = A000244(n).
G.f.: x*(x^2-x-1)/((x^2-1)*(1-3*x^2)). - Philippe Deléham, Dec 12 2013
a(n) = 4*a(n-2)-3*a(n-4) for n>3, a(0)=0, a(1)=1, a(2)=1, a(3)=3. - Philippe Deléham, Dec 12 2013
a(n) = (1+(-1)^n)*(3^(n/2)-1)/4+(1-(-1)^n)*3^(n/2-1/2)/2. - Wesley Ivan Hurt, Aug 29 2015
E.g.f.: (1/2)*(cosh(sqrt(3)*x) - cosh(x)) + (1/sqrt(3))*sinh(sqrt(3)*x). - G. C. Greubel, Aug 29 2015