OFFSET
0,2
COMMENTS
REFERENCES
H. Cohn, A Second Course in Number Theory, Wiley, NY, 1962, p. 256.
I. M. Vinogradov, Elements of Number Theory, pp. 220 ff.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Wikipedia, Primitive roots
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,-1,1).
FORMULA
a(n) = a(n-1) - a(n-5) + a(n-6). - R. J. Mathar, Apr 13 2010
G.f.: (1+x+2*x^2+4*x^3-3*x^4+6*x^5)/ ((1-x) * (1+x) * (x^4-x^3+x^2-x+1)). - R. J. Mathar, Apr 13 2010
a(n+10) = a(n). - Jon Perry, Oct 30 2014
a(n+5) = 11 - a(n) for all n in Z. - Michael Somos, Oct 17 2018
EXAMPLE
2^6 = 64 = 66 - 2 == -2 mod 11 == 9 mod 11, so a(6) = 9.
MAPLE
i := 5: [ seq(numtheory[primroot](ithprime(i))^j mod ithprime(i), j=0..100) ];
MATHEMATICA
Table[Mod[2^n, 11], {n, 0, 6!}] (* Vladimir Joseph Stephan Orlovsky, Apr 29 2010 *)
PROG
(Sage) [power_mod(2, n, 11) for n in range(0, 78)] # Zerinvary Lajos, Nov 03 2009
(PARI) a(n)=lift(Mod(2, 11)^n) \\ Charles R Greathouse IV, Jul 02 2013
(Magma) [Modexp(2, n, 11): n in [0..100]]; // G. C. Greubel, Oct 16 2018
(GAP) List([0..70], n->PowerMod(2, n, 11)); # Muniru A Asiru, Oct 18 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved