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.

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