OFFSET
0,2
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Eric Weisstein's World of Mathematics, Rule 188
Eric Weisstein's World of Mathematics, Elementary Cellular Automaton
Index entries for linear recurrences with constant coefficients, signature (0,1,0,16,0,-16).
FORMULA
a(n) = (1/30)*(-14 + 3*i*(2*i)^n + 55*2^n) for n odd,
a(n) = (1/15)*(-13 + 3*(2*i)^n + 25*2^n) for n even, where i = sqrt(-1).
From Colin Barker, Oct 08 2015: (Start)
G.f.: -(8*x^5-8*x^4-12*x^3-4*x^2-3*x-1) / ((x-1)*(x+1)*(2*x-1)*(2*x+1)*(4*x^2+1)).
a(n) = a(n-2) + 16*a(n-4) - 16*a(n-6) for n>5. (End)
E.g.f.: (1/15)*(6*sinh(x) + (5/2)*sinh(2x) + 25*exp(2x) - 13*exp(x)) + (1/10)*(2*cos(2x)-sin(2x)). - G. C. Greubel, Oct 08 2015
a(n) = floor(28*4^n/15) + 2^n - floor(28*2^n/15)*2^n. - Karl V. Keller, Jr., Nov 11 2021
EXAMPLE
1; --> 1
0, 1, 1; --> 3
0, 0, 1, 0, 1; --> 5
0, 0, 0, 1, 1, 1, 1; --> 15
0, 0, 0, 0, 1, 1, 1, 0, 1; --> 29
MATHEMATICA
clip[lst_] := Block[{p = Flatten@ Position[lst, 1]}, Take[lst, {Min@ p, Max@ p}]]; FromDigits[#, 2] & /@ Map[clip, CellularAutomaton[188, {{1}, 0}, 32]] (* Michael De Vlieger, Oct 08 2015 *)
RecurrenceTable[{a[n+6]==a[n+4] + 16*a[n+2] - 16*a[n], a[0]==1, a[1]==3, a[2]==5, a[3]==15, a[4]==29, a[5]==55}, a, {n, 0, 100}] (* _G. C. Greubel, Oct 08 2015 *)
PROG
(PARI) Vec(-(8*x^5-8*x^4-12*x^3-4*x^2-3*x-1)/((x-1)*(x+1)*(2*x-1)*(2*x+1)*(4*x^2+1)) + O(x^40)) \\ Colin Barker, Oct 08 2015
(Python) print([28*4**n//15 + 2**n - (28*2**n//15)*2**n for n in range(50)]) # Karl V. Keller, Jr., Nov 11 2021
CROSSREFS
KEYWORD
nonn,base,easy,changed
AUTHOR
Eric W. Weisstein, Apr 13 2006
STATUS
approved