OFFSET
0,4
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..4192
László Németh and László Szalay, Sequences Involving Square Zig-Zag Shapes, J. Int. Seq., Vol. 24 (2021), Article 21.5.2.
Index entries for linear recurrences with constant coefficients, signature (0,4,0,-3).
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.
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
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Richard R. Forberg, Nov 30 2013
STATUS
approved