login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A181356
Smallest k such that 2^(2^n) - k is a safe prime.
6
5, 29, 269, 209, 1469, 15449, 36113, 38117, 1093337, 1942289, 10895177, 43644929, 364486013, 718982153, 2356107437
OFFSET
2,1
COMMENTS
These numbers are useful as Diffie-Hellman moduli.
EXAMPLE
a(2)=5 because 2^(2^2) - 5 = 11 is the largest safe prime less than 16.
PROG
(PARI) a(n) = {k = 1; pow2 = 2^(2^n); while (! (isprime(pow2 - k) && isprime((pow2 - k - 1)/2)), k +=2; ); k; } \\ Michel Marcus, Aug 16 2013
CROSSREFS
KEYWORD
nonn,more,hard
AUTHOR
Ken Takusagawa, Jan 27 2011
EXTENSIONS
a(14) from Ken Takusagawa, May 31 2011
a(15) from Gary Barnes, Oct 26 2011
a(16) from Mark Andreas, Jan 23 2023
STATUS
approved