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!)
A104387 Larger of two successive primes the average of which is a repdigit. 4

%I #17 Jun 30 2022 10:27:00

%S 5,7,11,101,113,4447,111111113,555555555559,10000000000000061,

%T 111111111111111131,444444444444444469,555555555555555555619,

%U 777777777777777777777787,333333333333333333333333333333373,444444444444444444444444444444444497

%N Larger of two successive primes the average of which is a repdigit.

%C Lesser primes A104388, repdigits A104389. What is the next term?

%C 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 Michael S. Branicky, <a href="/A104387/b104387.txt">Table of n, a(n) for n = 1..31</a>

%F a(n) = prime(A104386(n)+1).

%t 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 (Python)

%o from itertools import count, islice

%o from sympy import isprime, prevprime

%o def agen():

%o for d in count(1):

%o ru = int("1"*d)

%o for r in range(ru, 10*ru, ru):

%o if r > 2:

%o p = prevprime(r)

%o if isprime(r + (r-p)) and prevprime(r+(r-p)) == p:

%o yield 2*r - p

%o print(list(islice(agen(), 15))) # _Michael S. Branicky_, Jun 30 2022

%Y Cf. A054268, A104386, A104388, A104389.

%K nonn,base

%O 1,1

%A _Zak Seidov_, Mar 04 2005

%E More terms from _Giovanni Resta_, Apr 05 2006

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 July 25 10:18 EDT 2024. Contains 374587 sequences. (Running on oeis4.)