A023146 Numbers k such that prime(k) == 4 (mod k).
1, 75, 77, 637331, 637333, 637341, 637343, 27067053, 179992917, 8179002205, 2636913002917, 6201265271239157, 6201265271239347, 6201265271239413, 6201265271239981, 6201265271240331, 6201265271240341, 2159986889494445405, 2159986889494445525, 2159986889494445615
Offset: 1
Keywords
Examples
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.
Crossrefs
Programs
-
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 *)
-
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
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
Comments