login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A131269 a(n) = 3*a(n-1) - 2*a(n-2) - a(n-3) + a(n-4) with n>3, a(0)=1, a(1)=2, a(2)=3, a(3)=6. 7

%I #35 Sep 08 2022 08:45:31

%S 1,2,3,6,11,20,35,60,101,168,277,454,741,1206,1959,3178,5151,8344,

%T 13511,21872,35401,57292,92713,150026,242761,392810,635595,1028430,

%U 1664051,2692508,4356587,7049124,11405741,18454896,29860669,48315598,78176301,126491934

%N a(n) = 3*a(n-1) - 2*a(n-2) - a(n-3) + a(n-4) with n>3, a(0)=1, a(1)=2, a(2)=3, a(3)=6.

%C Row sums of triangles A131268 and A131270.

%C a(n)/a(n-1) tends to phi (A001622).

%H Bruno Berselli, <a href="/A131269/b131269.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,-1,1).

%F a(n) = a(n-2) + a(n-1) + n - 2 with n>1, a(0)=1, a(1)=2. - _Alex Ratushnyak_, May 02 2012

%F From _Bruno Berselli_, May 03 2012: (Start)

%F G.f.: (1-x-x^2+2*x^3)/((1-x-x^2)*(1-x)^2). - _Bruno Berselli_, May 03 2012

%F a(n) = A001595(n+1) - n = A006355(n+3) - n - 1 = ((1+sqrt(5))^(n+2) - (1-sqrt(5))^(n+2))/(2^(n+1)*sqrt(5))-n-1. (End)

%e a(4) = 11 = sum of row 4 terms of triangle A131268: ((1 + 1 + 5 + 3 + 1), or the reversed terms of triangle A131270, row 4.

%t LinearRecurrence[{3, -2, -1, 1}, {1, 2, 3, 6}, 41] (* _Bruno Berselli_, May 03 2012 *)

%t Table[2*Fibonacci[n+2]-n-1, {n,0,40}] (* _G. C. Greubel_, Jul 09 2019 *)

%o (Python)

%o prpr = 1

%o prev = 2

%o for n in range(2,99):

%o current = prpr + prev + n - 2

%o print(prpr, end=',')

%o prpr = prev

%o prev = current # from _Alex Ratushnyak_, May 02 2012

%o # Contribution from _Bruno Berselli_, May 03 2012: (Start)

%o (PARI) Vec((1-x-x^2+2*x^3)/((1-x-x^2)*(1-x)^2)+O(x^40))

%o (Magma) /* By the first comment: */ [&+[2*Binomial(n-Floor((k+1)/2), Floor(k/2))-1: k in [0..n]]: n in [0..40]];

%o (Maxima) makelist(expand(((1+sqrt(5))^(n+2)-(1-sqrt(5))^(n+2) )/(2^(n+1)*sqrt(5))-n-1), n, 0, 40); (End)

%o (PARI) vector(40, n, n--; 2*fibonacci(n+2)-n-1) \\ _G. C. Greubel_, Jul 09 2019

%o (Magma) [2*Fibonacci(n+2)-n-1: n in [0..40]]; // _G. C. Greubel_, Jul 09 2019

%o (Sage) [2*fibonacci(n+2)-n-1 for n in (0..40)] # _G. C. Greubel_, Jul 09 2019

%o (GAP) List([0..40], n-> 2*Fibonacci(n+2)-n-1) # _G. C. Greubel_, Jul 09 2019

%Y Cf. A000045, A001622, A065941, A131268, A131270.

%Y Cf. A001595 (first differences).

%K nonn,easy

%O 0,2

%A _Gary W. Adamson_, Jun 23 2007

%E Better definition and more terms from _Bruno Berselli_, May 03 2012

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 18:05 EDT 2024. Contains 371798 sequences. (Running on oeis4.)