login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A054268
Sum of composite numbers between prime p and nextprime(p) is a repdigit.
10
3, 5, 109, 111111109, 259259257
OFFSET
1,1
COMMENTS
No additional terms below 472882027.
No additional terms below 10^58. - Chai Wah Wu, Jun 01 2024
LINKS
Eric Weisstein's World of Mathematics, Repdigit
FORMULA
Numbers A000040(n) for n > 1 such that A001043(n)*(A001223(n)-1)/2 is in A010785. - Chai Wah Wu, Aug 12 2014
EXAMPLE
a(5) is ok since between 259259257 and nextprime 259259261 we get the sum 259259258 + 259259259 + 259259260 which yield repdigit 777777777.
MATHEMATICA
repQ[n_]:=Count[DigitCount[n], 0]==9; Select[Prime[Range[2, 14500000]], repQ[Total[Range[#+1, NextPrime[#]-1]]]&] (* Harvey P. Dale, Jan 29 2011 *)
PROG
(Python)
from sympy import prime
A054268 = [prime(n) for n in range(2, 10**5) if len(set(str(int((prime(n+1)-prime(n)-1)*(prime(n+1)+prime(n))/2)))) == 1]
# Chai Wah Wu, Aug 12 2014
(Python)
from itertools import count, islice
from sympy import isprime, nextprime
from sympy.abc import x, y
from sympy.solvers.diophantine.diophantine import diop_quadratic
def A054268_gen(): # generator of terms
for l in count(1):
c = []
for m in range(1, 10):
k = m*(10**l-1)//9<<1
for a, b in diop_quadratic((x-y-1)*(x+y)-k):
if isprime(b) and a == nextprime(b):
c.append(b)
yield from sorted(c)
A054268_list = list(islice(A054268_gen(), 5)) # Chai Wah Wu, Jun 01 2024
KEYWORD
nonn,base,hard
AUTHOR
Patrick De Geest, Apr 15 2000
EXTENSIONS
Offset changed by Andrew Howroyd, Aug 14 2024
STATUS
approved