login
Base-3 digits are, in order, the first n terms of the periodic sequence with initial period 1,0.
17

%I #74 Aug 09 2024 20:04:38

%S 1,3,10,30,91,273,820,2460,7381,22143,66430,199290,597871,1793613,

%T 5380840,16142520,48427561,145282683,435848050,1307544150,3922632451,

%U 11767897353,35303692060,105911076180,317733228541,953199685623

%N Base-3 digits are, in order, the first n terms of the periodic sequence with initial period 1,0.

%C Written in base 3, this yields A056830. - _M. F. Hasler_, Oct 05 2018

%H Vincenzo Librandi, <a href="/A033113/b033113.txt">Table of n, a(n) for n = 1..1000</a>

%H INRIA Algorithms Project, <a href="http://ecs.inria.fr/services/structure?nbr=906">Encyclopedia of Combinatorial Structures 906</a>

%H R. J. Mathar, <a href="/A102518/a102518.pdf">Counting Walks on Finite Graphs</a>, Nov 2020, Section 6.

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,1,-3).

%F a(n) = A039300(n)-1.

%F a(n)+a(n+1) = A003462(n+1).

%F a(n) = 3*a(n-1) + a(n-2) -3*a(n-3). - _R. J. Mathar_, Jun 28 2010

%F From _Paul Barry_, Nov 12 2003: (Start)

%F G.f.: x/((1-x)*(1+x)*(1-3*x)).

%F a(n) = 2*a(n-1) + 3*a(n-2) + 1.

%F Partial sums of A015518. (End)

%F E.g.f.: (1/2)*exp(x)*(sinh(x))^2. - _Paul Barry_, Mar 12 2003

%F a(n) = Sum_{k=0..floor(n/2)} C(n+2, 2k+2)*4^k. - _Paul Barry_, Aug 24 2003

%F a(n) = Sum_{k=0..floor(n/2)} 3^(n-2*k); a(n) = Sum_{k=0..n} Sum_{j=0..k} (-1)^(j+k)*3^j. - _Paul Barry_, Nov 12 2003

%F Convolution of A000244 and A059841 (3^n and periodic{1, 0}). a(n) = Sum_{k=0..n} (1 + (-1)^(n-k))*3^k/2. - _Paul Barry_, Jul 19 2004

%F a(n) = round(3^(n+1)/8) = floor((3^(n+1)-1)/8) = ceiling((3^(n+1)-3)/8) = round((3^(n+1)-3)/8). a(n) = a(n-2) + 3^(n-1), n > 2. - _Mircea Merca_, Dec 27 2010

%F a(n) = floor((3^(n+1))/4) / 2 = A081251(n)/2, n >= 1. - _Wolfdieter Lang_, Apr 13 2012

%p a[0]:=0: a[1]:=1: for n from 2 to 50 do a[n]:=2*a[n-1]+3*a[n-2]+1 od: seq(a[n], n=1..33);# _Zerinvary Lajos_, Dec 14 2008

%p g:=x*(1/(1-3*x)/(1-x))/(1+x): gser:=series(g, x=0, 43): seq(coeff(gser, x, n), n=1..30);# _Zerinvary Lajos_, Jan 11 2009

%p A033113 := proc(n) (9*3^(n-1)-(-1)^n-2)/8 ; end proc: # _R. J. Mathar_, Jan 08 2011

%t Join[{a=1,b=3},Table[c=2*b+3*a+1;a=b;b=c,{n,60}]] (* _Vladimir Joseph Stephan Orlovsky_, Feb 01 2011 *)

%t Module[{nn=30,d},d=PadRight[{},nn,{1,0}];Table[FromDigits[Take[d,n],3],{n,nn}]] (* or *) LinearRecurrence[{3,1,-3},{1,3,10},30] (* _Harvey P. Dale_, May 24 2014 *)

%o (PARI) a(n)=3^n*3\8 \\ Simplified by _M. F. Hasler_, Oct 06 2018

%o (PARI) A033113(n)=3^(n+1)>>3 \\ _M. F. Hasler_, Oct 05 2018

%o (Magma) [Round(3^(n+1)/8): n in [1..30]]; // _Vincenzo Librandi_, Jun 25 2011

%Y Cf. A003462, A039300.

%K nonn,base,easy

%O 1,2

%A _Clark Kimberling_