OFFSET
1,2
MATHEMATICA
Select[Range[10^6], Mod[#, 3] > 0 && PowerMod[3, #, 3*#-1] == 1 &] (* Giovanni Resta, May 29 2016 *)
PROG
(PARI) is(n)=n%3 && Mod(3, 3*n-1)^n==1 \\ Charles R Greathouse IV, May 29 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, May 28 2016
STATUS
approved