This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A104387 #17 Jun 30 2022 10:27:00 %S A104387 5,7,11,101,113,4447,111111113,555555555559,10000000000000061, %T A104387 111111111111111131,444444444444444469,555555555555555555619, %U A104387 777777777777777777777787,333333333333333333333333333333373,444444444444444444444444444444444497 %N A104387 Larger of two successive primes the average of which is a repdigit. %C A104387 Lesser primes A104388, repdigits A104389. What is the next term? %C A104387 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 %H A104387 Michael S. Branicky, <a href="/A104387/b104387.txt">Table of n, a(n) for n = 1..31</a> %F A104387 a(n) = prime(A104386(n)+1). %t A104387 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 *) %o A104387 (Python) %o A104387 from itertools import count, islice %o A104387 from sympy import isprime, prevprime %o A104387 def agen(): %o A104387 for d in count(1): %o A104387 ru = int("1"*d) %o A104387 for r in range(ru, 10*ru, ru): %o A104387 if r > 2: %o A104387 p = prevprime(r) %o A104387 if isprime(r + (r-p)) and prevprime(r+(r-p)) == p: %o A104387 yield 2*r - p %o A104387 print(list(islice(agen(), 15))) # _Michael S. Branicky_, Jun 30 2022 %Y A104387 Cf. A054268, A104386, A104388, A104389. %K A104387 nonn,base %O A104387 1,1 %A A104387 _Zak Seidov_, Mar 04 2005 %E A104387 More terms from _Giovanni Resta_, Apr 05 2006