login
A202035
Greatest prime residue of x^n (mod n) for x=0..n-1, or 0 if no such prime exists.
1
0, 0, 2, 0, 3, 3, 5, 0, 0, 5, 7, 0, 11, 11, 13, 0, 13, 0, 17, 5, 13, 11, 19, 0, 7, 23, 0, 0, 23, 19, 29, 0, 31, 19, 31, 0, 31, 23, 31, 0, 37, 7, 41, 37, 37, 41, 43, 0, 31, 0, 47, 29, 47, 0, 43, 0, 37, 53, 53, 0, 59, 59, 0, 0, 61, 37, 61, 17, 67, 29, 67, 0, 71
OFFSET
1,3
EXAMPLE
a(7) = 3 because k^7 ==0, 1, 2, 3, 4, 5, 6 (mod 7) => 5 is the greatest prime.
MAPLE
for n from 1 to 100 do: W:={}:for k from 0 to n-1 do:z:= irem(k^n, n): if type(z, prime)=true then W:=W union {z}:else fi:od: x:=nops(W): if x<>0 then printf(`%d, `, W[x]): else printf(`%d, `, 0):fi: od:
CROSSREFS
Sequence in context: A370594 A291304 A245332 * A369494 A343762 A247508
KEYWORD
nonn
AUTHOR
Michel Lagneau, Dec 09 2011
STATUS
approved