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 A101822 #31 Apr 19 2025 11:07:30 %S A101822 1,1,3,8,17,42,100,235,561,1331,3158,7503,17812,42292,100425,238445, %T A101822 566171,1344336,3192013,7579198,17996232,42730667,101460725,240910755, %U A101822 572024206,1358227891,3225008568,7657536968,18182237777,43172337417 %N A101822 Expansion of 1/(1-x-2*x^2-3*x^3). %C A101822 a(n) is the number of compositions (ordered partitions) of n into parts 1, 2, and 3 where there is one kind of part 1, two kinds of part 2, and three kinds of part 3. - _Joerg Arndt_, Apr 19 2025 %H A101822 G. C. Greubel, <a href="/A101822/b101822.txt">Table of n, a(n) for n = 0..1000</a> %H A101822 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,3). %F A101822 a(n) = a(n-1) + 2*a(n-2) + 3*a(n-3), a(0) = a(1) = 1, a(2) = 3. %F A101822 a(n) is the top term in M^n * [1, 0, 0], where M = the 3X3 matrix ([1, 1, 1], [2, 0, 0], [0, 3/2, 0]). %t A101822 a[0]=a[1]=1; a[2]=3; a[n_]:= a[n]= a[n-1] + 2a[n-2] + 3a[n-3]; %t A101822 Table[ a[n], {n, 0, 29}] (* Or *) %t A101822 a[n_]:= (MatrixPower[{{1,1,1}, {2,0,0}, {0,3/2,0}}, n].{{1}, {0}, {0}})[[1, 1]]; %t A101822 Table[ a[n], {n, 0, 29}] (* _Robert G. Wilson v_, Dec 20 2004 *) %t A101822 LinearRecurrence[{1,2,3},{1,1,3},30] (* _Harvey P. Dale_, Feb 06 2019 *) %o A101822 (PARI) Vec(1/(1-x-2*x^2-3*x^3)+O(x^99)) \\ _Charles R Greathouse IV_, Sep 26 2012 %o A101822 (Magma) I:=[1,1,3]; [n le 3 select I[n] else Self(n-1) +2*Self(n-2) +3*Self(n-3): n in [1..41]]; // _G. C. Greubel_, Mar 27 2023 %o A101822 (SageMath) %o A101822 @CachedFunction %o A101822 def a(n): # a = A101822 %o A101822 if (n<3): return (1,1,3)[n] %o A101822 else: return a(n-1) + 2*a(n-2) + 3*a(n-3) %o A101822 [a(n) for n in range(41)] # _G. C. Greubel_, Mar 27 2023 %Y A101822 Cf. A000073, A100550. Row k=3 in A380886. %K A101822 nonn,easy %O A101822 0,3 %A A101822 _Gary W. Adamson_, Dec 17 2004 %E A101822 More terms from _Robert G. Wilson v_, Dec 20 2004