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”).

A102748
a(n) is the least k such that (2^n)*(10^k) -1 or +1 is prime.
0
0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 4554, 1, 1, 0, 1, 2, 0, 0, 2, 0, 2, 2, 3, 6, 1, 12, 21, 14, 4, 5, 74, 0, 3, 2, 5, 12, 7, 2, 1, 5, 16, 3, 1870, 5, 24, 22, 10, 1, 22, 20, 2, 19, 10, 1, 1, 1196, 9, 4, 10, 29, 34, 0, 2, 187, 3, 46, 29, 62, 62, 22, 2622, 1, 38, 2, 1, 172
OFFSET
0,11
COMMENTS
For n even >2 the least prime is of the form (2^n)*(10^k)+1. For n odd >2 the least prime is of the form (2^n)*(10^k)-1 Mersenne-primes are in the sequence with a(n)=0 and n prime.
EXAMPLE
(2^0)*(10^0)+1 = 2 prime so a(0) = 0.
(2^1)*(10^0)+1 = 3 prime so a(1) = 0.
(2^2)*(10^0)-1 = 3 prime as (2^2)*(10^0)+1 = 5 prime so a(2) = 0.
MATHEMATICA
a[n_] := Module[{k=0}, While[!PrimeQ[2^n*10^k - 1] && !PrimeQ[2^n*10^k + 1], k++]; k]; Array[a, 10, 0] (* Amiram Eldar, Aug 28 2021 *)
CROSSREFS
Sequence in context: A020432 A186471 A210305 * A032751 A020436 A104947
KEYWORD
nonn
AUTHOR
Pierre CAMI, Feb 09 2005
EXTENSIONS
More terms from Amiram Eldar, Aug 28 2021
STATUS
approved