OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
f:= proc(n) local k, d;
if n::even then d:= 3*n else d:= 6*n fi;
for k from 1 by d do if isprime(k) then return k fi od
end proc:
map(f, [$1..100]); # Robert Israel, Sep 19 2019
MATHEMATICA
a[n_] := Module[{k, d}, If[EvenQ[n], d = 3n, d = 6n]; For[k = 1, True, k += d, If[PrimeQ[k], Return[k]]]];
Array[a, 100] (* Jean-François Alcover, Jun 11 2020, after Maple *)
PROG
(PARI) for(n=1, 80, s=1; while((isprime(s)*s-1)%(3*n)>0, s++); print1(s, ", "))
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Amarnath Murthy, May 15 2002
EXTENSIONS
More terms from Benoit Cloitre, May 18 2002
STATUS
approved