|
|
A115335
|
|
a(0) = 3, a(1) = 5, a(2) = 1, and a(n) = (2^(1 + n) - 11*(-1)^n)/3 for n > 2.
|
|
4
|
|
|
3, 5, 1, 9, 7, 25, 39, 89, 167, 345, 679, 1369, 2727, 5465, 10919, 21849, 43687, 87385, 174759, 349529, 699047, 1398105, 2796199, 5592409, 11184807, 22369625, 44739239, 89478489, 178956967, 357913945, 715827879, 1431655769, 2863311527, 5726623065, 11453246119
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 2*abs((1/2)*(-1 + (-2)^n) - (2/3)*(2 + (-2)^n)*A057427(n)).
a(n) = a(n-1) + 2*a(n-2) for n > 4.
G.f.: (4*x^4 + 2*x^3 + 10*x^2 - 2*x - 3) / ((x + 1)*(2*x - 1)). (End)
|
|
MAPLE
|
seq(coeff(series((4*x^4+2*x^3+10*x^2-2*x-3)/((x+1)*(2*x-1)), x, n+1), x, n), n = 0 .. 35); # Muniru A Asiru, Nov 23 2018
|
|
MATHEMATICA
|
Join[{3, 5, 1}, LinearRecurrence[{1, 2}, {9, 7}, 40]] (* Harvey P. Dale, Jul 17 2014 *)
|
|
PROG
|
(PARI) x='x+O('x^50); Vec((4*x^4+2*x^3+10*x^2-2*x-3)/((x+1)*(2*x-1))) \\ G. C. Greubel, Nov 23 2018
(Magma) I:=[9, 7]; [3, 5, 1] cat [n le 2 select I[n] else Self(n-1) + 2*Self(n-2): n in [1..45]]; // G. C. Greubel, Nov 23 2018
(Sage) s=((4*x^4+2*x^3+10*x^2-2*x-3)/((x+1)*(2*x-1))).series(x, 50); s.coefficients(x, sparse=False) # G. C. Greubel, Nov 23 2018
(GAP) a:=[3, 5, 1];; for n in [4..35] do a[n]:=(2^n-11*(-1)^(n-1))/3; od; a; # Muniru A Asiru, Nov 23 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|