|
|
A052959
|
|
a(2n) = a(2n-1)+a(2n-2), a(2n+1) = a(2n)+a(2n-1)-1, a(0)=2, a(1)=1.
|
|
2
|
|
|
2, 1, 3, 3, 6, 8, 14, 21, 35, 55, 90, 144, 234, 377, 611, 987, 1598, 2584, 4182, 6765, 10947, 17711, 28658, 46368, 75026, 121393, 196419, 317811, 514230, 832040, 1346270, 2178309, 3524579, 5702887, 9227466, 14930352, 24157818, 39088169, 63245987, 102334155, 165580142, 267914296, 433494438
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
LINKS
|
|
|
FORMULA
|
G.f.: (2-x-2*x^2)/((1-x^2)*(1-x-x^2)).
a(n) = 2*a(n-2) + a(n-3) - 1, with a(0)=2, a(1)=1, a(2)=3.
a(n) = Sum_{alpha=RootOf(-1+z+z^2)} (1/5)*(1 + 2*alpha)*alpha^(-1-n) + Sum_{beta=RootOf(-1+z^2)} beta^(-n)/2.
a(n) = Sum_{k=0..n} ( C(k, n-k) + (-1)^(n-k) ). - Paul Barry, Jul 21 2003
|
|
MAPLE
|
spec:= [S, {S=Union(Sequence(Union(Prod(Z, Z), Z)), Sequence(Prod(Z, Z)))}, unlabeled ]: seq(combstruct[count ](spec, size=n), n=0..20);
seq(coeff(series((2-x-2*x^2)/((1-x^2)*(1-x-x^2)), x, n+1), x, n), n = 0..50); # G. C. Greubel, Oct 22 2019
|
|
MATHEMATICA
|
LinearRecurrence[{1, 2, -1, -1}, {2, 1, 3, 3}, 50] (* Harvey P. Dale, Apr 01 2014 *)
CoefficientList[Series[(2-x-2*x^2)/((1-x^2)*(1-x-x^2)), {x, 0, 50}], x] (* Vincenzo Librandi, Apr 07 2014 *)
Sum[Fibonacci[Range[50], k], {k, 0, 1}] (* G. C. Greubel, Oct 22 2019 *)
|
|
PROG
|
(PARI) my(x='x+O('x^50)); Vec((2-x-2*x^2)/((1-x^2)*(1-x-x^2))) \\ G. C. Greubel, Oct 22 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 50); Coefficients(R!( (2-x-2*x^2)/((1-x^2)*(1-x-x^2)) )); // G. C. Greubel, Oct 22 2019
(Sage)
P.<x> = PowerSeriesRing(ZZ, prec)
return P((2-x-2*x^2)/((1-x^2)*(1-x-x^2))).list()
(GAP) a:=[2, 1, 3, 3];; for n in [5..50] do a[n]:=a[n-1]+2*a[n-2]-a[n-3] -a[n-4]; od; a; # G. C. Greubel, Oct 22 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
encyclopedia(AT)pommard.inria.fr, Jan 25 2000
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|