login
A054265
Sum of composite numbers between successive primes.
44
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,2
LINKS
Paul Barry, On the Gap-sum and Gap-product Sequences of Integer Sequences, arXiv:2104.05593 [math.CO], 2021.
FORMULA
a(n) = (prime(n+1) + prime(n))*(prime(n+1) - prime(n) - 1)/2. - Zak Seidov, Sep 12 2002
EXAMPLE
Between 7 and 11 we have 8 + 9 + 10 which is a(4)=27.
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Patrick De Geest, Apr 15 2000
STATUS
approved