A069568 a(n) = smallest number m > 0 such that n followed by m 1's yields a prime, or -1 if no such m exists.
1, 2, 1, 1, 5, 1, 1, 2, 2, 1, 17, 136, 1, 9, 1, 3, 8, 1, 1, 2, 1, 3, 2, 1, 1, 3, 1, 1, 6, 2, 1, 35, 1, 6, 2, 4, -1, -1, 2, 1, 2, 1, 1, 3, 772, 1, 3, 5, 1, 2, 4, 1, 9, 1, 31, 18470, 1, 3, 18, 1, 4, 2, 1, 1, 3, 1, 210, 3, 1, 1, 6, 2, 7, 2, 1, 1, 9, 4, 3, 2, 1, 1, 2, 5, 6, 3, 149, 1, 6, 2, 1, 3, 2, 1, 2, 7, 1, 2, 1, 10, 2, 1, 1, 44, 1, 1, 2, 5, 1, 17, 16, 3, 2, 2, 1, 9, 1, 1
Offset: 1
Examples
a(5) = 5 as the smallest prime of the type 5 followed by 1's is 511111 (though 5 itself is a prime).
Links
- Toshitaka Suzuki, Table of n, a(n) for n = 1..602
- Lenny Jones, When does appending the same digit repeatedly on the right of a positive integer generate a sequence of composite numbers?, Amer. Math. Monthly, 118 (2011), 153-160.
- Jon Perry, Wilde Primes.
- Toshitaka Suzuki, Additional n such that a(n)=-1
Programs
-
Mathematica
Do[k = 1; While[ !PrimeQ[ ToExpression[ StringJoin[ ToString[n], ToString[(10^k - 1)/9]]]], k++ ]; Print[k], {n, 1, 100}] (* Robert G. Wilson v *)
-
PARI
{ aopo(n) = local(c, k, stop); c=1; k=n; stop=500; k=k*10+1; while(!isprime(k) && c
Extensions
More terms from Jason Earls, Jun 16 2003
Comments