login
A342567
a(n) = (prime(n)^2 - prime(n-1)*prime(n+1))/2, n >= 3.
2
2, -3, 15, -9, 21, -15, -11, 64, -56, 49, 45, -39, -35, 18, 124, -116, 79, 75, -140, 91, -71, -65, 210, 105, -99, 111, -105, -537, 663, -119, 280, -546, 606, -296, 18, 175, -155, 18, 364, -714, 774, -189, 201, -983, 72, 916, 231, -225, -221, 484, -954, 532, 18, 18
OFFSET
3,1
LINKS
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
Cf. A056221.
Sequence in context: A266618 A082572 A075244 * A088030 A101047 A251618
KEYWORD
sign,easy
AUTHOR
Hugo Pfoertner, Jun 20 2021
STATUS
approved