|
|
A104387
|
|
Larger of two successive primes the average of which is a repdigit.
|
|
4
|
|
|
5, 7, 11, 101, 113, 4447, 111111113, 555555555559, 10000000000000061, 111111111111111131, 444444444444444469, 555555555555555555619, 777777777777777777777787, 333333333333333333333333333333373, 444444444444444444444444444444444497
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
The next term is 444444444444444444444444444444444497. The first term with more than 100 digits is a(22) which has 109 digits. - Harvey P. Dale, Jun 28 2011
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
Union[Flatten[Table[NextPrime/@Select[FromDigits/@Table[PadLeft[{i}, n, i], {n, 45}], Mean[{NextPrime[#], NextPrime[#, -1]}]==#&], {i, 9}]]] (* Harvey P. Dale, Jun 28 2011 *)
|
|
PROG
|
(Python)
from itertools import count, islice
from sympy import isprime, prevprime
def agen():
for d in count(1):
ru = int("1"*d)
for r in range(ru, 10*ru, ru):
if r > 2:
p = prevprime(r)
if isprime(r + (r-p)) and prevprime(r+(r-p)) == p:
yield 2*r - p
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|