login
A349668
a(n) is the n-th safe prime reduced mod n.
1
0, 1, 2, 3, 2, 5, 6, 3, 5, 9, 7, 11, 9, 9, 8, 3, 3, 17, 12, 7, 5, 3, 12, 23, 8, 5, 26, 23, 2, 29, 3, 31, 2, 27, 9, 23, 20, 13, 11, 23, 8, 23, 39, 39, 14, 13, 12, 23, 23, 49, 14, 51, 40, 17, 2, 39, 17, 33, 28, 47, 42, 49, 32, 43, 34, 59, 58, 55, 11, 27, 42, 23
OFFSET
1,3
LINKS
FORMULA
a(n) = A005385(n) mod n.
a(n) = (2*A005384(n) + 1) mod n.
EXAMPLE
A005385(12) = 263; 263 == 11 mod 12.
MATHEMATICA
p = Select[Prime[Range[700]], PrimeQ[(# - 1)/2] &]; Mod[p, Range[Length[p]]] (* Amiram Eldar, Jan 10 2022 *)
PROG
(Python)
from sympy import isprime
n = 1
for p in range (2, 10000):
if isprime(p) and isprime(2*p+1):
print ((2*p+1)%n, end=", ")
n += 1
(PARI) lista(nn) = my(v=[x|x<-primes(nn), bigomega(x-1)==2]); vector(#v, k, v[k] % k); \\ Michel Marcus, Jan 10 2022
CROSSREFS
Cf. A005385 (safe primes), A005384 (Sophie Germain primes).
Sequence in context: A348066 A227071 A276270 * A214571 A135873 A070673
KEYWORD
nonn
AUTHOR
Karl-Heinz Hofmann, Jan 09 2022
STATUS
approved