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!)
 A284631 a(n) = smallest odd k such that either k*2^n - 1 or k*2^n + 1 is prime. 3
 1, 1, 1, 1, 1, 3, 1, 1, 7, 5, 3, 3, 1, 5, 5, 1, 1, 3, 1, 7, 7, 25, 13, 39, 5, 7, 15, 13, 7, 3, 1, 5, 9, 3, 25, 3, 15, 3, 5, 27, 3, 9, 3, 15, 7, 19, 27, 5, 19, 7, 17, 7, 51, 5, 3, 27, 29, 77, 27, 17, 1, 53, 9, 3, 9, 3, 9, 31, 23, 27, 39, 5, 15, 21, 5, 3, 29 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,6 COMMENTS As N increases, (Sum_{n=1..N} a(n)) / (Sum_{n=1..N} n) tends to log(2)/2 as seen by plotting data; this is consistent with the prime number theorem as the probability that x*2^n - 1 and x*2^n + 1 are prime is ~ 2/(n*log(2)) if n is great enough, so after n*log(2)/2 try (n*log(2)/2)*(2/n*log(2))=1. For n=1 to 10000, a(n)/n is always < 3.2. a(n)*2^n - 1 and a(n)*2^n + 1 are twin primes for n = 2, 6, 18, 63, 211, 546, 1032, 1156, 1553, 4901, 8335, 8529; corresponding values of a(n) are 1, 3, 3, 9, 9,297, 177, 1035, 291, 2565, 3975, 459. LINKS Pierre CAMI, Table of n, a(n) for n = 1..10000 Pierre CAMI, PFGW Script EXAMPLE 1*2^1 + 1 = 3 (prime), so a(1) = 1; 1*2^2 - 1 = 3 (prime), so a(2) = 1; 1*2^3 - 1 = 7 (prime), so a(3) = 1. MATHEMATICA Table[k = 1; While[Nor @@ Map[PrimeQ, k*2^n + {-1, 1}], k += 2]; k, {n, 77}] (* Michael De Vlieger, Apr 02 2017 *) PROG (PARI) a(n) = my(k=1); while (!isprime(k*2^n-1) && !isprime(k*2^n+1), k+=2); k; \\ Michel Marcus, Mar 31 2017 CROSSREFS Sequence in context: A094507 A065625 A287213 * A154341 A202181 A130749 Adjacent sequences:  A284628 A284629 A284630 * A284632 A284633 A284634 KEYWORD nonn AUTHOR Pierre CAMI, Mar 30 2017 EXTENSIONS Missing a(9153)-a(9163) in b-file inserted by Andrew Howroyd, Feb 27 2018 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 July 12 06:21 EDT 2020. Contains 335658 sequences. (Running on oeis4.)