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

 

Logo

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A268702 Largest n digit prime having at least n-1 digits equal to 1. 6
7, 71, 911, 8111, 16111, 911111, 1171111, 71111111, 131111111, 1711111111, 31111111111, 311111111111, 5111111111111, 41111111111111, 111151111111111, 5111111111111111, 11111611111111111, 191111111111111111, 2111111111111111111, 11111111611111111111 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Michel Lagneau, Michael De Vlieger and Robert G. Wilson v, Table of n, a(n) for n = 1..1000

EXAMPLE

a(3) = 911 since 111, 211, 311, ..., 811 are all composites but 911 is prime. Also of the ten primes of 3 digits which contain at least 2 ones, {101, 113, 131, 151, 181, 191, 211, 311, 811, 911}, 911 is the greatest.

MATHEMATICA

f[n_] := Block[{k = 0, p = {}, r = (10^n - 1)/9, s = Range@ 10 - 2}, While[k < n, AppendTo[p, Select[r + 10^k*s, PrimeQ]]; k++]; p = Max@ Flatten@ p]; Array[f, 20]

PROG

(PARI) a(n) = {p = precprime(10^n-1); while (#select(x->x==1, digits(p)) != n-1, p = precprime(p-1)); p; } \\ Michel Marcus, Feb 21 2016

CROSSREFS

Cf. A177999, A241100, A268703 - A268707, A241206.

Sequence in context: A048552 A260033 A067307 * A052390 A002119 A146752

Adjacent sequences:  A268699 A268700 A268701 * A268703 A268704 A268705

KEYWORD

nonn,base

AUTHOR

Michel Lagneau, Michael De Vlieger and Robert G. Wilson v, Feb 11 2016

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 23 10:48 EST 2020. Contains 331171 sequences. (Running on oeis4.)