login
a(n) = 6^n mod 31.
1

%I #24 Dec 27 2023 08:37:14

%S 1,6,5,30,25,26,1,6,5,30,25,26,1,6,5,30,25,26,1,6,5,30,25,26,1,6,5,30,

%T 25,26,1,6,5,30,25,26,1,6,5,30,25,26,1,6,5,30,25,26,1,6,5,30,25,26,1,

%U 6,5,30,25,26,1,6,5,30,25,26,1,6,5,30,25,26,1,6,5,30,25,26,1,6,5,30,25

%N a(n) = 6^n mod 31.

%H G. C. Greubel, <a href="/A070399/b070399.txt">Table of n, a(n) for n = 0..1000</a>

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

%F From _R. J. Mathar_, Apr 20 2010: (Start)

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

%F G.f.: ( -1-5*x+x^2-26*x^3 ) / ( (x-1)*(1+x)*(x^2-x+1) ). (End)

%F a(n) = a(n-6). - _G. C. Greubel_, Mar 18 2016

%t PowerMod[6, Range[0, 50], 31] (* _G. C. Greubel_, Mar 18 2016 *)

%o (Sage) [power_mod(6,n,31)for n in range(0,83)] # _Zerinvary Lajos_, Nov 27 2009

%o (PARI) a(n) = lift(Mod(6, 31)^n); \\ _Altug Alkan_, Mar 18 2016

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_, May 12 2002