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!)
A101400 a(n) = a(n-1) + 2*a(n-2) + a(n-3) - a(n-4). 5

%I #17 Sep 08 2022 08:45:16

%S 1,2,5,10,21,44,91,190,395,822,1711,3560,7409,15418,32085,66770,

%T 138949,289156,601739,1252230,2605915,5422958,11285279,23484880,

%U 48872481,101704562,211649125,440445850,916576181,1907412444,3969361531

%N a(n) = a(n-1) + 2*a(n-2) + a(n-3) - a(n-4).

%C Lengths of successive words (starting with a) under the substitution: {a -> ab, b -> aac, c -> d, d -> b}.

%H Harvey P. Dale, <a href="/A101400/b101400.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 (1,2,1,-1).

%F G.f.: (1+x+x^2)/(1-x-2*x^2-x^3+x^4). - _G. C. Greubel_, Apr 03 2018

%e a(0) = 1, a(1) = 2, a(2) = 5, a(3) = 10, a(4) = 21, a(5) = 44

%t a[0] = 1; a[1] = 2; a[2] = 5; a[3] = 10; a[n_] := a[n] = a[n - 1] + 2a[n - 2] + a[n - 3] - a[n - 4]; Table[ a[n], {n, 0, 30}] (* _Robert G. Wilson v_, Jan 15 2005 *)

%t LinearRecurrence[{1,2,1,-1},{1,2,5,10},40] (* _Harvey P. Dale_, Oct 24 2017 *)

%o (PARI) x='x+O('x^30); Vec((1+x+x^2)/(1-x-2*x^2-x^3+x^4)) \\ _G. C. Greubel_, Apr 03 2018

%o (Magma) I:=[1,2,5,10]; [n le 4 select I[n] else Self(n-1) + 2*Self(n-2) + Self(n-3) - Self(n-4): n in [1..30]]; /* or */ m:=25; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1+x+x^2)/(1-x-2*x^2-x^3+x^4))); // _G. C. Greubel_, Apr 03 2018

%o (GAP) a:=[1,2,5,10];; for n in [5..35] do a[n]:=a[n-1]+2*a[n-2]+a[n-3]-a[n-4]; od; a; # _Muniru A Asiru_, Apr 03 2018

%Y Cf. A092886, A105309.

%K nonn,easy

%O 0,2

%A _Jeroen F.J. Laros_, Jan 15 2005

%E More terms from _Robert G. Wilson v_, Jan 15 2005

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 23 16:40 EDT 2024. Contains 371916 sequences. (Running on oeis4.)