OFFSET
1,1
COMMENTS
All terms > a(1) are primes p such that either (2*p+1)/5 or (4*p+1)/5 is prime. A necessary (but not sufficient) condition for prime p > 3 to be a term is that its final digit must be 7 or 1 (otherwise (2*p+1), (4*p+1) respectively cannot be divisible by 5). The Maple code below computes terms > a(1).
EXAMPLE
3 is a term since with q = 2 (prime < 3) we have 5*2 = 10 == 1 (mod 3).
7 is a term since with q = 3 (prime < 7) we have 5*q = 5*3 = 15 == 1 (mod 7).
241 is a term since with q = 193 (prime < 241) we have 5*193 = 965 == 1 (mod 241).
MAPLE
for n from 4 to 350 do
Y := ithprime(n);
Z := 1/5 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[5*q, p]==1, ans=True; Break[]]; q=NextPrime[q]]; ans]; Select[Prime[Range[350]], aQ] (* Amiram Eldar, Nov 12 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Nov 12 2018
STATUS
approved