|
|
A054268
|
|
Sum of composite numbers between prime p and nextprime(p) is a repdigit.
|
|
10
|
|
|
|
OFFSET
|
0,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
|
|
|
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]
(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)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,hard
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|