%I #33 Dec 25 2023 11:23:50
%S 1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,
%T 3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,
%U 9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15
%N a(n) = 3^n mod 22.
%H G. C. Greubel, <a href="/A070355/b070355.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,1).
%F From _R. J. Mathar_, Apr 13 2010: (Start)
%F a(n) = a(n-5).
%F G.f.: (1+3*x+9*x^2+5*x^3+15*x^4)/ ((1-x) * (1+x+x^2+x^3+x^4)). (End)
%t PowerMod[3, Range[0,50], 22] (* or *) Table[Mod[3^n, 22], {n, 0, 100}] (* _G. C. Greubel_, Mar 09 2016 *)
%o (Sage) [power_mod(3,n,22)for n in range(0, 95)] # _Zerinvary Lajos_, Nov 25 2009
%o (PARI) a(n)=lift(Mod(3,22)^n) \\ _Charles R Greathouse IV_, Mar 22 2016
%Y Cf. A000244.
%K nonn,easy
%O 0,2
%A _N. J. A. Sloane_, May 12 2002