login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

Vincenzo Librandi, Table of n, a(n) for n = 0..1000

INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 1030

Index entries for linear recurrences with constant coefficients, signature (1,2,-1,-1).

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) = Fibonacci(n+1) + (1+(-1)^n)/2 = A000045(n+1) + A059841(n). - Vladeta Jovovic, Apr 23 2003

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)

def A052959_list(prec):

    P.<x> = PowerSeriesRing(ZZ, prec)

    return P((2-x-2*x^2)/((1-x^2)*(1-x-x^2))).list()

A052959_list(50) # G. C. Greubel, Oct 22 2019

(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

Sequence in context: A108949 A167704 A109522 * A257702 A034399 A005292

Adjacent sequences:  A052956 A052957 A052958 * A052960 A052961 A052962

KEYWORD

easy,nonn

AUTHOR

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

EXTENSIONS

More terms from James A. Sellers, Jun 05 2000

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 12 09:35 EDT 2020. Contains 335657 sequences. (Running on oeis4.)