OFFSET
1,2
EXAMPLE
The 75th prime is 379 and 379 == 4 (mod 75). Hence 75 is in the sequence.
The 76th prime is 383, but 383 == 3, not 4, (mod 76). So 76 is not in the sequence.
MATHEMATICA
nextPrime[n_] := Block[{k = n + 1}, While[!PrimeQ[k], k++]; k]; p = 1; Do[If[Mod[p = nextPrime[p], n] == 4, Print[n]], {n, 1, 10^9}] (* Robert G. Wilson v, Feb 18 2004 *)
Select[Range[1000], Mod[Prime[#], #] == 4 &] (* Alonso del Arte, Nov 16 2018 *)
PROG
(Sage)
def A023146(max) :
terms = []
p = 2
for n in range(1, max+1) :
if (p - 4) % n == 0 : terms.append(n)
p = next_prime(p)
return terms
# Eric M. Schmidt, Feb 05 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Robert G. Wilson v, Feb 18 2004
2 more terms from Giovanni Resta and Robert G. Wilson v, Feb 22 2006
First term inserted by Eric M. Schmidt, Feb 05 2013
a(11)-a(20) from Giovanni Resta, Feb 23 2020
STATUS
approved