login
a(n) = 3^n mod 79.
3

%I #27 Feb 21 2024 18:07:03

%S 1,3,9,27,2,6,18,54,4,12,36,29,8,24,72,58,16,48,65,37,32,17,51,74,64,

%T 34,23,69,49,68,46,59,19,57,13,39,38,35,26,78,76,70,52,77,73,61,25,75,

%U 67,43,50,71,55,7,21,63,31,14

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

%C Because a(39) = 78, the Legendre symbol (3/79) = -1, meaning that 3 is not a quadratic residue of 79. Furthermore, it means that 3 is prime in Z[sqrt(79)]. - _Alonso del Arte_, Oct 01 2012

%D I. M. Vinogradov, Elements of Number Theory, pp. 220 ff.

%H G. C. Greubel, <a href="/A036134/b036134.txt">Table of n, a(n) for n = 0..10000</a>

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

%F From _G. C. Greubel_, Oct 17 2018: (Start)

%F a(n) = a(n-1) - a(n-39) + a(n-40).

%F a(n+78) = a(n). (End)

%e a(4) = 2 because 3^4 = 81 and 81 - 79 = 2.

%p [ seq(primroot(ithprime(i))^j mod ithprime(i),j=0..100) ];

%t Table[Mod[3^n, 79], {n, 0, 60}] (* _Alonso del Arte_, Oct 01 2012 *)

%t PowerMod[3,Range[0,100],79] (* _Harvey P. Dale_, Feb 21 2024 *)

%o (PARI) a(n)=lift(Mod(3,79)^n) \\ _Charles R Greathouse IV_, Mar 22 2016

%o (Magma) [Modexp(3, n, 79): n in [0..100]]; // _G. C. Greubel_, Oct 17 2018

%o (Python) for n in range(0, 100): print(int(pow(3, n, 79)), end=' ') # _Stefano Spezia_, Oct 17 2018

%o (GAP) List([0..60],n->PowerMod(3,n,79)); # _Muniru A Asiru_, Oct 17 2018

%Y Cf. A000244 (3^n).

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_