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 A037496 #24 Sep 08 2022 08:44:52 %S A037496 1,3,11,34,102,308,925,2775,8327,24982,74946,224840,674521,2023563, %T A037496 6070691,18212074,54636222,163908668,491726005,1475178015,4425534047, %U A037496 13276602142,39829806426,119489419280,358468257841,1075404773523 %N A037496 Base-3 digits are, in order, the first n terms of the periodic sequence with initial period 1,0,2. %H A037496 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (3,0,1,-3). %F A037496 a(n) = 3*a(n-1) + a(n-3) - 3*a(n-4). %F A037496 From _Bruno Berselli_, Jan 20 2011: (Start) %F A037496 G.f.: x*(1+2*x^2)/((1-x)*(1-3*x)*(1+x+x^2)). %F A037496 a(n) = round((11*3^n-13)/26) = (11*3^n-13)/26 + ((3-7*i*sqrt(3))*(-1+i*sqrt(3))^n + (3+7*i*sqrt(3))*(-1-i*sqrt(3))^n)/(78*2^n) where i is the imaginary unit. (End) %t A037496 With[{c=PadRight[{},30,{1,0,2}]},Table[FromDigits[Take[c,n],3],{n,30}]] (* or *) LinearRecurrence[{3,0,1,-3},{1,3,11,34},30] (* _Harvey P. Dale_, Mar 30 2012 *) %o A037496 (Magma) I:=[1,3,11,34]; [n le 4 select I[n] else 3*Self(n-1) +Self(n-3)-3*Self(n-4): n in [1..30]]; // _Vincenzo Librandi_, Nov 26 2016 %K A037496 nonn,base,easy %O A037496 1,2 %A A037496 _Clark Kimberling_