OFFSET
1,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..2000
EXAMPLE
Residues are often also powers of 3, that is, 3^n = k*2*n + 3^j, as is the case for n=1..23. The first terms that are not powers of 3 are a(24)=33 and a(25)=43.
a(6)=9: modulus = 2*n = 12; 3^n = 3^6 = 729 = 60*12 + 9 = 720 + a(6).
MATHEMATICA
Table[PowerMod[3, n, 2n], {n, 90}] (* Harvey P. Dale, Jan 21 2014 *)
PROG
(Python) for n in range(1, 80): print(pow(3, n, 2*n), end=" ") # Stefano Spezia, Oct 20 2018
(PARI) a(n) = lift(Mod(3, 2*n)^n) \\ Felix Fröhlich, Oct 20 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Apr 28 2003
STATUS
approved
