login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A112386 Smallest prime obtained by appending one or more 1's to n, -1 if no such prime exists. 4
11, 211, 31, 41, 511111, 61, 71, 811, 911, 101, 1111111111111111111, 121111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111, 131, 14111111111, 151, 16111, 1711111111, 181, 191, 2011, 211, 22111, 2311, 241 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(37) = -1 since there is a covering of the set {371, 3711, 37111, ...} by the prime moduli 3, 7, 13, 37. Hence, there are infinitely many values -1 in the sequence (at 371, 3711, 37111, ...). - Emmanuel Vantieghem, Oct 27 2022
a(38) = -1 because 38 followed by m >= 1 1's is divisible by 3 or 37 or by (7*10^k-1)/3 if m = 3k. - Toshitaka Suzuki, Nov 07 2023
LINKS
EXAMPLE
a(5) = 511111 because 51, 511, 5111 and 51111 are not primes.
MATHEMATICA
f[n_] := Block[{k = 1, e = Floor[Log[10, n] + 1]}, While[ !PrimeQ[n*10^k + (10^k - 1)/9], k++ ]; n*10^k + (10^k - 1)/9]; Array[f, 24] (* Robert G. Wilson v, Dec 05 2005 *)
Table[SelectFirst[Table[FromDigits[PadRight[IntegerDigits[k], n, 1]], {n, IntegerLength[k]+1, 250}], PrimeQ], {k, 25}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 30 2017 *)
CROSSREFS
Cf. A069568.
Sequence in context: A280072 A157691 A196944 * A160693 A167442 A249974
KEYWORD
nonn,base
AUTHOR
Michel Dauchez (mdzdm(AT)yahoo.fr), Dec 04 2005
EXTENSIONS
Edited, corrected and extended by Robert G. Wilson v, Dec 05 2005
Name edited by Emmanuel Vantieghem, Oct 27 2022
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 07:57 EDT 2024. Contains 371905 sequences. (Running on oeis4.)