A054265 Sum of composite numbers between successive primes.
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
Keywords
Examples
Between 7 and 11 we have 8 + 9 + 10 which is a(4)=27.
Links
- James Spahlinger, Table of n, a(n) for n = 1..1000
- Paul Barry, On the Gap-sum and Gap-product Sequences of Integer Sequences, arXiv:2104.05593 [math.CO], 2021.
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