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

%I #22 May 28 2023 22:20:39

%S 3,14,57,228,915,3662,14649,58596,234387,937550,3750201,15000804,

%T 60003219,240012878,960051513,3840206052,15360824211,61443296846,

%U 245773187385,983092749540,3932370998163,15729483992654,62917935970617,251671743882468,1006686975529875,4026747902119502

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

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

%F a(n) = 4*a(n-1) + a(n-4) - 4*a(n-5); a(1)=3, a(2)=14, a(3)=57, a(4)=228, a(5)=915. - _Harvey P. Dale_, Jun 01 2014

%F G.f.: x*(3 + 2*x + x^2)/((x - 1)*(4*x - 1)*(1 + x)*(x^2 + 1)). - _R. J. Mathar_, May 01 2015

%F E.g.f.: (76*cosh(4*x) - 51*cosh(x) - 25*cos(x) + 76*sinh(4*x) - 34*sinh(x) - 15*sin(x))/85. - _Stefano Spezia_, May 28 2023

%t Module[{nn=30,per},per=PadRight[{},nn,{3,2,1,0}];Table[ FromDigits[ Take[ per,n],4],{n,nn}]] (* or *) LinearRecurrence[{4,0,0,1,-4},{3,14,57,228,915},30] (* _Harvey P. Dale_, Jun 01 2014 *)

%o (PARI) a(n) = 76<<(2*n) \ 85; \\ _Kevin Ryde_, May 28 2023

%K nonn,base,easy

%O 1,1

%A _Clark Kimberling_

%E a(24)-a(26) from _Stefano Spezia_, May 28 2023