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 A052993 #27 Jul 02 2025 16:01:58 %S A052993 1,1,4,4,13,13,40,40,121,121,364,364,1093,1093,3280,3280,9841,9841, %T A052993 29524,29524,88573,88573,265720,265720,797161,797161,2391484,2391484, %U A052993 7174453,7174453,21523360,21523360,64570081,64570081,193710244 %N A052993 a(n) = a(n-1) + 3*a(n-2) - 3*a(n-3), with a(0)=a(1)=1, a(2)=4. %H A052993 G. C. Greubel, <a href="/A052993/b052993.txt">Table of n, a(n) for n = 0..1000</a> %H A052993 INRIA Algorithms Project, <a href="http://ecs.inria.fr/services/structure?nbr=1069">Encyclopedia of Combinatorial Structures 1069</a> %H A052993 László Németh and László Szalay, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL24/Nemeth/nemeth8.html">Sequences Involving Square Zig-Zag Shapes</a>, J. Int. Seq., Vol. 24 (2021), Article 21.5.2. %H A052993 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,3,-3). %F A052993 G.f.: 1/((1-3*x^2)*(1-x)). %F A052993 a(n+2) = 3*a(n) + 1, where a(0) = a(1) = 1. %F A052993 a(n) = -1/2 + Sum((1/4)*(1+3*_alpha)*_alpha^(-1-n), _alpha = RootOf(-1 + 3*_Z^2)). %F A052993 a(n) = Sum{k=0..n} 3^(k/2)*(1-(-1)^k)/(2*sqrt(3)). - _Paul Barry_, Jul 28 2004 %F A052993 a(n) = (3^(1+floor((n-1)/2)) - 1)/2. - _Federico Provvedi_, Nov 22 2018 %F A052993 a(n)-a(n-1) = A254006(n). - _R. J. Mathar_, Feb 27 2019 %p A052993 spec := [S,{S=Prod(Sequence(Prod(Union(Z,Z,Z),Z)),Sequence(Z))},unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20); %t A052993 (3^(1+Floor[(Range@40-1)/2])-1)/2 (* _Federico Provvedi_, Nov 22 2018 *) %t A052993 LinearRecurrence[{1,3,-3}, {1,1,4}, 30] (* or *) RecurrenceTable[{a[n + 2] == 3*a[n] + 1, a[0] == 1, a[1] == 1}, a, {n,0,30}] (* _G. C. Greubel_, Nov 21 2018 *) %o A052993 (PARI) x='x+O('x^30); Vec(1/((1-3*x^2)*(1-x))) \\ _G. C. Greubel_, Nov 21 2018 %o A052993 (Magma) I:=[1,1,4]; [n le 3 select I[n] else Self(n-1) +3*Self(n-2) -3*Self(n-3): n in [1..30]]; // _G. C. Greubel_, Nov 21 2018 %o A052993 (Sage) s=(1/((1-3*x^2)*(1-x))).series(x,30); s.coefficients(x, sparse=False) # _G. C. Greubel_, Nov 21 2018 %Y A052993 Cf. A062318. %K A052993 easy,nonn %O A052993 0,3 %A A052993 encyclopedia(AT)pommard.inria.fr, Jan 25 2000 %E A052993 More terms from _James Sellers_, Jun 06 2000