The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A057821 a(n) is the least nonnegative integer k such that 2^n - k is a safe prime. 2
 1, 5, 9, 5, 21, 29, 9, 5, 9, 17, 45, 161, 165, 269, 285, 17, 45, 233, 9, 17, 321, 317, 633, 677, 405, 437, 189, 1385, 69, 209, 9, 641, 849, 137, 45, 401, 381, 437, 1965, 2201, 741, 1493, 573, 857, 1485, 5297, 2709, 161, 465, 473, 1269, 4805, 789 (list; graph; refs; listen; history; text; internal format)
 OFFSET 3,2 COMMENTS Previous name was: "Useful safe primes: a(n) = least nonnegative integer k such that 2^n - k is prime and (2^n-k-1)/2 is also prime". The resulting sequence of 2^n-k terms: 7, 11, 23, 59, 107, ..., are thus the largest safe primes smaller than 2^n (A243916), a subsequence of A005385. - Michel Marcus, Jan 08 2014 LINKS Artsiom Palkounikau, Table of n, a(n) for n = 3..3072 PROG (PARI) a(n) = {my(k=0); until (isprime(2^n-k) && isprime((2^n-k-1)/2), k++); return (k); } \\ Michel Marcus, Jun 29 2013 (Python) from sympy import isprime def a(n):     k=0     while True:         k+=1         if isprime(2**n - k) and isprime((2**n - k - 1)/2): return k print [a(i) for i in range(3, 21)] # Indranil Ghosh, Jun 12 2017, after PARI code by Michel Marcus CROSSREFS Cf. A005385, A013603, A243916. Sequence in context: A200283 A010720 A094389 * A133742 A134879 A051158 Adjacent sequences:  A057818 A057819 A057820 * A057822 A057823 A057824 KEYWORD nonn AUTHOR Warren D. Smith, Nov 23 2000 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified April 16 23:40 EDT 2021. Contains 343051 sequences. (Running on oeis4.)