OFFSET
3,1
LINKS
Hugo Pfoertner, Table of n, a(n) for n = 3..10000
FORMULA
a(n) = A056221(n-1)/2 for n >= 3.
MATHEMATICA
a[n_]:=(Prime[n]^2 - Prime[n-1]*Prime[n+1])/2; Array[a, 54, 3] (* Stefano Spezia, Jul 15 2024 *)
PROG
(PARI) forprime(p=5, 265, my(pp=precprime(p-1), pn=nextprime(p+1)); print1((p^2-pp*pn)/2, ", "))
(Python)
from primesieve.numpy import n_primes
primesarray = numpy.array(n_primes(10005, 1))
for i in range (2, 10003):
print(((primesarray[i]**2)-(primesarray[i-1]*primesarray[i+1]))//2)
# Karl-Heinz Hofmann, Jun 20 2021
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Hugo Pfoertner, Jun 20 2021
STATUS
approved