cp's OEIS Frontend

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.

A104389 Repdigits which are the average of two successive primes.

This page as a plain text file.
%I A104389 #8 Jun 30 2022 10:25:18
%S A104389 4,6,9,99,111,4444,111111111,555555555555,9999999999999999,
%T A104389 111111111111111111,444444444444444444,555555555555555555555,
%U A104389 777777777777777777777777,333333333333333333333333333333333,444444444444444444444444444444444444
%N A104389 Repdigits which are the average of two successive primes.
%H A104389 Michael S. Branicky, <a href="/A104389/b104389.txt">Table of n, a(n) for n = 1..31</a>
%F A104389 a(n) = (A104387(n)+A104388(n))/2.
%o A104389 (Python)
%o A104389 from itertools import count, islice
%o A104389 from sympy import isprime, prevprime
%o A104389 def agen():
%o A104389     for d in count(1):
%o A104389         ru = int("1"*d)
%o A104389         for r in range(ru, 10*ru, ru):
%o A104389             if r > 2:
%o A104389                 p = prevprime(r)
%o A104389                 if isprime(r + (r-p)) and prevprime(r+(r-p)) == p:
%o A104389                     yield r
%o A104389 print(list(islice(agen(), 15))) # _Michael S. Branicky_, Jun 30 2022
%Y A104389 Corresponding primes: A104387, A104388.
%Y A104389 Cf. A054268, A104386, A104387, A104388.
%K A104389 nonn,base
%O A104389 1,1
%A A104389 _Zak Seidov_, Mar 04 2005
%E A104389 More terms from _Giovanni Resta_, Apr 05 2006