OFFSET
1,2
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000 (first 1000 terms from Alois P. Heinz)
MAPLE
a:= proc(n) option remember; local k;
if n=1 then 1 else for k from 1+a(n-1)
while 3&^k mod(3*k-1)<>1 do od; k fi
end:
seq(a(n), n=1..40); # Alois P. Heinz, May 27 2016
MATHEMATICA
Select[Range[10^6], PowerMod[3, #, 3*# - 1] == 1 &] (* Giovanni Resta, May 27 2016 *)
PROG
(Magma) [n: n in [1..200000] | Modexp(3, n, 3*n-1) eq 1];
(PARI) is(n)=Mod(3, 3*n-1)^n==1 \\ Charles R Greathouse IV, May 29 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, May 26 2016
STATUS
approved