OFFSET
1,2
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.
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