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.

Showing 1-4 of 4 results.

A054265 Sum of composite numbers between successive primes.

Original entry on oeis.org

0, 4, 6, 27, 12, 45, 18, 63, 130, 30, 170, 117, 42, 135, 250, 280, 60, 320, 207, 72, 380, 243, 430, 651, 297, 102, 315, 108, 333, 1560, 387, 670, 138, 1296, 150, 770, 800, 495, 850, 880, 180, 1674, 192, 585, 198, 2255, 2387, 675, 228, 693, 1180, 240, 2214, 1270
Offset: 1

Views

Author

Patrick De Geest, Apr 15 2000

Keywords

Examples

			Between 7 and 11 we have 8 + 9 + 10 which is a(4)=27.
		

Crossrefs

Programs

  • PARI
    a(n) = (prime(n+1) + prime(n))*(prime(n+1) - prime(n) - 1)/2; \\ Michel Marcus, Mar 24 2016
    
  • Python
    from sympy import nextprime, prime
    def A054265(n): return ((p:=prime(n))+(q:=nextprime(p)))*(q-p-1)>>1 # Chai Wah Wu, Jun 01 2024

Formula

a(n) = (prime(n+1) + prime(n))*(prime(n+1) - prime(n) - 1)/2. - Zak Seidov, Sep 12 2002

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

Original entry on oeis.org

3, 5, 109, 111111109, 259259257
Offset: 1

Views

Author

Patrick De Geest, Apr 15 2000

Keywords

Comments

No additional terms below 472882027.
No additional terms below 10^58. - Chai Wah Wu, Jun 01 2024

Examples

			a(5) is ok since between 259259257 and nextprime 259259261 we get the sum 259259258 + 259259259 + 259259260 which yield repdigit 777777777.
		

Crossrefs

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

A054266 Sum of composite numbers between prime p and nextprime(p) is palindromic.

Original entry on oeis.org

3, 5, 109, 193, 281, 509, 661, 827, 857, 1439, 2111, 3433, 3889, 3967, 4549, 6661, 7001, 8467, 10099, 17203, 18583, 21011, 21611, 23831, 24847, 25117, 26261, 26497, 26861, 28181, 29587, 30497, 31307, 47569, 47869, 49789, 53939, 54139, 66361
Offset: 1

Views

Author

Patrick De Geest, Apr 15 2000

Keywords

Examples

			a(4)=193 since between 193 and next prime 197 we get the palindromic sum 194 + 195 + 196 = 585.
		

Crossrefs

Programs

  • Mathematica
    okQ[l_]:=Module[{x=IntegerDigits[Total[Range[First[l]+1, Last[l]-1]]]},x==Reverse[x]];Transpose[Select[Partition[ Prime[Range[2,6700]],2,1],okQ]][[1]] (* Harvey P. Dale, Mar 18 2011 *)

Extensions

Corrected and extended b-file by Chai Wah Wu, Feb 25 2018

A054267 Sum of composite numbers between prime p and nextprime(p) is palindromic with restriction 'p + 1 <> sum'.

Original entry on oeis.org

109, 193, 509, 661, 1439, 3433, 3889, 3967, 4549, 6661, 7001, 8467, 10099, 17203, 18583, 24847, 25117, 26497, 29587, 30497, 31307, 47569, 47869, 49789, 53939, 54139, 66361, 67061, 70901, 71011, 102199, 132229, 158269, 171179, 185699
Offset: 0

Views

Author

Patrick De Geest, Apr 15 2000

Keywords

Examples

			a(4)=661 since between 661 and next prime 673 we get the palindromic sum 662 + 663 + 664 + 665 + 666 + 667 + 668 + 669 + 670 + 671 + 672 = 7337.
		

Crossrefs

Showing 1-4 of 4 results.