# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a101399 Showing 1-1 of 1 %I A101399 #23 Sep 08 2022 08:45:16 %S A101399 1,2,5,10,22,47,101,217,466,1001,2150,4618,9919,21305,45761,98290, %T A101399 211117,453458,973982,2092015,4493437,9651449,20730338,44526673, %U A101399 95638798,205422482,441226751,947710513,2035586497,4372234274 %N A101399 a(0) = 1, a(1) = 2, a(2) = 5; for n >= 3, a(n) = a(n-1) + 2*a(n-2) + a(n-3). %C A101399 Lengths of successive words (starting with a) under the substitution: {a -> ab, b -> aac, c -> a}. %H A101399 G. C. Greubel, Table of n, a(n) for n = 0..1000 %H A101399 Dun Qiu, Classical pattern distributions in Sn(132) and Sn(123), arXiv:1810.10099 [math.CO], 2018. See p. 11. %H A101399 Index entries for linear recurrences with constant coefficients, signature (1, 2, 1). %F A101399 G.f.: (1+x+x^2)/(1-x-2*x^2-x^3). - _G. C. Greubel_, Apr 03 2018 %t A101399 a[0] = 1; a[1] = 2; a[2] = 5; a[n_] := a[n] = a[n - 1] + 2a[n - 2] + a[n - 3]; Table[ a[n], {n, 0, 30}] (* _Robert G. Wilson v_, Jan 15 2005 *) %t A101399 LinearRecurrence[{1,2,1},{1,2,5},30] (* _Harvey P. Dale_, Aug 29 2012 *) %t A101399 CoefficientList[Series[(1+x+x^2)/(1-x-2*x^2-x^3), {x, 0, 50}], x] (* _G. C. Greubel_, Apr 03 2018 *) %o A101399 (PARI) x='x+O('x^30); Vec((1+x+x^2)/(1-x-2*x^2-x^3)) \\ _G. C. Greubel_, Apr 03 2018 %o A101399 (Magma) I:=[1,2,5]; [n le 3 select I[n] else Self(n-1) + 2*Self(n-2) + Self(n-3): n in [1..30]]; /* or */ m:=25; R:=PowerSeriesRing( Integers(), m); Coefficients(R!((1+x+x^2)/(1-x-2*x^2-x^3))); // _G. C. Greubel_, Apr 03 2018 %o A101399 (GAP) a:=[1,2,5];; for n in [4..35] do a[n]:=a[n-1]+2*a[n-2]+a[n-3]; od; a; # _Muniru A Asiru_, Apr 03 2018 %Y A101399 Pairwise sums of A078007. Bisection of A003410 and A058278. %K A101399 nonn,easy %O A101399 0,2 %A A101399 _Jeroen F.J. Laros_, Jan 15 2005 %E A101399 More terms from _Robert G. Wilson v_ and _Lior Manor_, Jan 15 2005 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE