This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A101400 #20 Dec 01 2024 20:15:13 %S A101400 1,2,5,10,21,44,91,190,395,822,1711,3560,7409,15418,32085,66770, %T A101400 138949,289156,601739,1252230,2605915,5422958,11285279,23484880, %U A101400 48872481,101704562,211649125,440445850,916576181,1907412444,3969361531 %N A101400 a(n) = a(n-1) + 2*a(n-2) + a(n-3) - a(n-4). %C A101400 Lengths of successive words (starting with a) under the substitution: {a -> ab, b -> aac, c -> d, d -> b}. %H A101400 Harvey P. Dale, <a href="/A101400/b101400.txt">Table of n, a(n) for n = 0..1000</a> %H A101400 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,1,-1). %F A101400 G.f.: (1+x+x^2)/(1-x-2*x^2-x^3+x^4). - _G. C. Greubel_, Apr 03 2018 %e A101400 a(0) = 1, a(1) = 2, a(2) = 5, a(3) = 10, a(4) = 21, a(5) = 44 %t A101400 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 A101400 LinearRecurrence[{1,2,1,-1},{1,2,5,10},40] (* _Harvey P. Dale_, Oct 24 2017 *) %o A101400 (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 A101400 (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]]; // _G. C. Greubel_, Apr 03 2018 %o A101400 (Magma) 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 A101400 (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 A101400 Cf. A092886, A105309. %K A101400 nonn,easy %O A101400 0,2 %A A101400 _Jeroen F.J. Laros_, Jan 15 2005 %E A101400 More terms from _Robert G. Wilson v_, Jan 15 2005