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.

A054268 Sum of composite numbers between prime p and nextprime(p) is a repdigit.

This page as a plain text file.
%I A054268 #32 Feb 16 2025 08:32:42
%S A054268 3,5,109,111111109,259259257
%N A054268 Sum of composite numbers between prime p and nextprime(p) is a repdigit.
%C A054268 No additional terms below 472882027.
%C A054268 No additional terms below 10^58. - _Chai Wah Wu_, Jun 01 2024
%H A054268 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Repdigit.html">Repdigit</a>
%F A054268 Numbers A000040(n) for n > 1 such that A001043(n)*(A001223(n)-1)/2 is in A010785. - _Chai Wah Wu_, Aug 12 2014
%e A054268 a(5) is ok since between 259259257 and nextprime 259259261 we get the sum 259259258 + 259259259 + 259259260 which yield repdigit 777777777.
%t A054268 repQ[n_]:=Count[DigitCount[n],0]==9; Select[Prime[Range[2,14500000]], repQ[Total[Range[#+1,NextPrime[#]-1]]]&] (* _Harvey P. Dale_, Jan 29 2011 *)
%o A054268 (Python)
%o A054268 from sympy import prime
%o A054268 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]
%o A054268 # _Chai Wah Wu_, Aug 12 2014
%o A054268 (Python)
%o A054268 from itertools import count, islice
%o A054268 from sympy import isprime, nextprime
%o A054268 from sympy.abc import x,y
%o A054268 from sympy.solvers.diophantine.diophantine import diop_quadratic
%o A054268 def A054268_gen(): # generator of terms
%o A054268     for l in count(1):
%o A054268         c = []
%o A054268         for m in range(1,10):
%o A054268             k = m*(10**l-1)//9<<1
%o A054268             for a, b in diop_quadratic((x-y-1)*(x+y)-k):
%o A054268                 if isprime(b) and a == nextprime(b):
%o A054268                     c.append(b)
%o A054268         yield from sorted(c)
%o A054268 A054268_list = list(islice(A054268_gen(),5)) # _Chai Wah Wu_, Jun 01 2024
%Y A054268 Cf. A010785, A028987, A028988, A046933, A054264, A054265, A054266, A054267.
%K A054268 nonn,base,hard
%O A054268 1,1
%A A054268 _Patrick De Geest_, Apr 15 2000
%E A054268 Offset changed by _Andrew Howroyd_, Aug 14 2024