login
a(n) = n^3 mod 15.
2

%I #40 Dec 27 2023 15:07:44

%S 0,1,8,12,4,5,6,13,2,9,10,11,3,7,14,0,1,8,12,4,5,6,13,2,9,10,11,3,7,

%T 14,0,1,8,12,4,5,6,13,2,9,10,11,3,7,14,0,1,8,12,4,5,6,13,2,9,10,11,3,

%U 7,14,0,1,8,12,4,5,6,13,2,9,10,11,3,7,14,0,1,8,12,4,5,6,13,2,9,10,11,3,7,14

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

%C It is also true that a(n) = n^(4k+3) mod 15 holds any k. - _Gary Detlefs_, Dec 15 2021

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

%H <a href="/index/Rec#order_15">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,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-15).

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

%t PowerMod[Range[0,90],3,15] (* or *) PadRight[{},90,{0,1,8,12,4,5,6,13,2,9,10,11,3,7,14}] (* _Harvey P. Dale_, Jan 27 2014 *)

%t Table[Mod[n^3, 15], {n, 0, 100}] (* _Vincenzo Librandi_, Jun 19 2014 *)

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

%o (Magma) [Modexp(n, 3, 15): n in [0..100]]; // _Vincenzo Librandi_, Mar 28 2016

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

%K nonn,easy

%O 0,3

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