Alois P. Heinz, <a href="/A371201/b371201_1.txt">Table of n, a(n) for n = 0..10000</a>
Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
Alois P. Heinz, <a href="/A371201/b371201_1.txt">Table of n, a(n) for n = 0..10000</a>
editing
approved
Alois P. Heinz, <a href="/A371201/b371201_1.txt">Table of n, a(n) for n = 0..10000</a>
approved
editing
proposed
approved
editing
proposed
a(n) = (prime(n+1)-prime(n))*(prime(n+1)+prime(n)-1)/2 for n>=1. - Chai Wah Wu, Jun 01 2024
return (q-p)*(p+q-1)>>1 # Chai Wah Wu, Jun 01 2024
(Python)
from sympy import nextprime, prime
def A371201(n):
if n == 0: return 1
q = nextprime(p:=prime(n))
return (q-p)*(p+q-1)>>1 # Chai Wah Wu, Jun 01 2024
approved
editing
reviewed
approved
proposed
reviewed
editing
proposed