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!)
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
Sequence in context: A067307 A334135 A357155 * A363009 A052390 A002119
KEYWORD
nonn,base
AUTHOR
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 March 18 22:56 EDT 2024. Contains 370952 sequences. (Running on oeis4.)