login
a(n) = n^3 mod 13.
1

%I #21 Dec 18 2023 14:42:03

%S 0,1,8,1,12,8,8,5,5,1,12,5,12,0,1,8,1,12,8,8,5,5,1,12,5,12,0,1,8,1,12,

%T 8,8,5,5,1,12,5,12,0,1,8,1,12,8,8,5,5,1,12,5,12,0,1,8,1,12,8,8,5,5,1,

%U 12,5,12,0,1,8,1,12,8,8,5,5,1,12,5,12,0,1,8,1,12,8,8,5,5,1,12,5,12,0,1

%N a(n) = n^3 mod 13.

%C Periodic with period length = 13. - _Harvey P. Dale_, Sep 24 2023

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

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

%F From _G. C. Greubel_, Mar 28 2016: (Start)

%F a(n) = a(n-13).

%F G.f.: (-x - 8*x^2 - x^3 - 12*x^4 - 8*x^5 - 8*x^6 - 5*x^7 - 5*x^8 - x^9 - 12*x^10 - 5*x^11 - 12*x^12)/(-1 + x^13). (End)

%t Table[Mod[n^3, 13], {n, 0, 100}] (* _G. C. Greubel_, Mar 28 2016 *)

%t PowerMod[Range[0,100],3,13] (* or *) PadRight[{},100,{0,1,8,1,12,8,8,5,5,1,12,5,12}] (* _Harvey P. Dale_, Sep 24 2023 *)

%o (Sage) [power_mod(n,3,13 )for n in range(0, 93)] # _Zerinvary Lajos_, Oct 29 2009

%o (PARI) a(n)=n^3%13 \\ _Charles R Greathouse IV_, Apr 06 2016

%K nonn,easy

%O 0,3

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