login
A349669
a(n) is the n-th Sophie Germain prime reduced mod n.
1
0, 1, 2, 3, 3, 5, 6, 5, 2, 9, 3, 11, 4, 11, 11, 9, 1, 17, 15, 13, 2, 1, 17, 11, 16, 15, 26, 25, 15, 29, 1, 15, 17, 13, 4, 11, 28, 25, 5, 31, 24, 11, 19, 41, 29, 29, 29, 11, 11, 49, 32, 51, 46, 35, 28, 19, 8, 45, 43, 53, 51, 55, 47, 21, 49, 29, 62, 27, 5, 13, 56, 11
OFFSET
1,3
LINKS
FORMULA
a(n) = A005384(n) mod n.
a(n) = ((A005385(n) - 1) / 2) mod n.
MATHEMATICA
p = Select[Prime[Range[400]], PrimeQ[2*# + 1] &]; Mod[p, Range[Length[p]]] (* Amiram Eldar, Jan 11 2022 *)
PROG
(Python)
from sympy import isprime
n = 1
for p in range (2, 10000):
if isprime(p) and isprime(2*p+1):
print (p % n, end=", ")
n += 1
(PARI) lista(nn) = my(v=select(p->isprime(2*p+1), primes(nn))); vector(#v, k, v[k] % k); \\ Michel Marcus, Jan 11 2022
CROSSREFS
Cf. A005385 (safe primes), A005384 (Sophie Germain primes).
Sequence in context: A301853 A141419 A072451 * A023156 A051599 A207292
KEYWORD
nonn
AUTHOR
Karl-Heinz Hofmann, Jan 10 2022
STATUS
approved