OFFSET
1,1
COMMENTS
FORMULA
a(n+1) = A104163(n); n >= 1.
EXAMPLE
For p = 11, the only number t < 11 such that 3*t == 1 (mod 11) is t = 4, which is not prime, therefore 11 is not a term.
For p = 5, q = 2 (prime); 2*3 = 6 == 1 (mod 5) therefore 5 is a term.
MAPLE
for n from 3 to 300 do
Y := ithprime(n);
Z := 1/3 mod Y;
if isprime(Z) then print(Y);
end if:
end do:
MATHEMATICA
aQ[p_]:=Module[{ans=False, q=2}, While[q<p, If[Mod[3*q, p]==1, ans=True; Break[]]; q=NextPrime[q]]; ans]; Select[Prime[Range[350]], aQ] (* Amiram Eldar, Nov 12 2018 *)
Join[{5}, Select[Prime[Range[400]], PrimeQ[((2 # + 1)) / 3] &]] (* Vincenzo Librandi, Nov 17 2018 *)
PROG
(PARI) isok(p) = if (isprime(p), forprime(q=1, p-1, if ((3*q % p) == 1, return (1)))); \\ Michel Marcus, Nov 14 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Nov 11 2018
STATUS
approved