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 A238389 #40 Feb 28 2023 12:07:15 %S A238389 1,1,1,4,4,7,16,19,37,67,94,178,295,460,829,1345,2209,3832,6244,10459, %T A238389 17740,29191,49117,82411,136690,229762,383923,639832,1073209,1791601, %U A238389 2992705,5011228,8367508,13989343,23401192,39091867,65369221,109295443 %N A238389 Expansion of (1+x)/(1-x^2-3*x^3). %H A238389 Vincenzo Librandi, <a href="/A238389/b238389.txt">Table of n, a(n) for n = 0..1000</a> %H A238389 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,3). %F A238389 a(0)=1, a(1)=1, a(2)=1; for n>2, a(n) = a(n-2) + 3*a(n-3). %F A238389 a(2n) = Sum_{j=0}^{n/3} binomial(n-j,2j)*3^(2j) + Sum_{j=0}^{(n-2)/3} binomial(n-1-j,2j+1)*3^(2j+1). %F A238389 a(2n+1) = Sum_{j=0}^{n/3} binomial(n-j,2j)*3^(2j) + Sum_{j=0}^{(n-1)/3} binomial(n-j,2j+1)*3^(2j+1). %F A238389 a(n) = |A106855(n)| + |A106855(n-1)| . - _R. J. Mathar_, Mar 13 2014 %e A238389 a(3) = 3*a(0)+a(1) = 4; a(4) = 3*a(1)+a(2) = 4; a(5) = 3*a(2)+a(3) = 7. %p A238389 a:= n-> (<<0|1|0>, <0|0|1>, <3|1|0>>^n.<<(1$3)>>)[(1$2)]: %p A238389 seq(a(n), n=0..44); # _Alois P. Heinz_, May 09 2021 %t A238389 (* First program *) %t A238389 For[j=0, j<3, j++, a[j] = 1] %t A238389 For[j=3, j<51, j++, a[j] = 3a[j-3] + a[j-2]] %t A238389 Table[a[j], {j, 0, 50}] %t A238389 (* Second program *) %t A238389 CoefficientList[Series[(1+x)/(1-x^2-3x^3), {x, 0, 40}], x] (* _Vincenzo Librandi_, Mar 16 2014 *) %t A238389 LinearRecurrence[{0,1,3},{1,1,1},40] (* _Harvey P. Dale_, Feb 28 2023 *) %o A238389 (PARI) Vec((1+x)/(1-x^2-3*x^3)+O(x^99)) \\ _Charles R Greathouse IV_, Mar 06 2014 %o A238389 (Magma) [n le 3 select 1 else Self(n-2) +3*Self(n-3): n in [1..41]]; // _G. C. Greubel_, May 09 2021 %o A238389 (Sage) %o A238389 def A238389_list(prec): %o A238389 P.<x> = PowerSeriesRing(ZZ, prec) %o A238389 return P( (1+x)/(1-x^2-3*x^3) ).list() %o A238389 A238389_list(40) # _G. C. Greubel_, May 09 2021 %Y A238389 Cf. A006190, A134816, A159284, A213713. %K A238389 nonn,easy %O A238389 0,4 %A A238389 _Sergio Falcon_, Feb 26 2014 %E A238389 Terms corrected by _Charles R Greathouse IV_, Mar 06 2014