%I #5 Mar 30 2012 18:36:00
%S 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,
%T 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,
%U 43,0,37,53,53,0,59,59,0,0,61,37,61,17,67,29,67,0,71
%N Greatest prime residue of x^n (mod n) for x=0..n-1, or 0 if no such prime exists.
%e a(7) = 3 because k^7 ==0, 1, 2, 3, 4, 5, 6 (mod 7) => 5 is the greatest prime.
%p 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:
%Y Cf. A196082, A202034.
%K nonn
%O 1,3
%A _Michel Lagneau_, Dec 09 2011