A054268 Sum of composite numbers between prime p and nextprime(p) is a repdigit.
3, 5, 109, 111111109, 259259257
Offset: 1
Examples
a(5) is ok since between 259259257 and nextprime 259259261 we get the sum 259259258 + 259259259 + 259259260 which yield repdigit 777777777.
Links
- Eric Weisstein's World of Mathematics, Repdigit
Programs
-
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 *)
-
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
Formula
Numbers A000040(n) for n > 1 such that A001043(n)*(A001223(n)-1)/2 is in A010785. - Chai Wah Wu, Aug 12 2014
Extensions
Offset changed by Andrew Howroyd, Aug 14 2024
Comments