cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A342567 a(n) = (prime(n)^2 - prime(n-1)*prime(n+1))/2, n >= 3.

Original entry on oeis.org

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

Views

Author

Hugo Pfoertner, Jun 20 2021

Keywords

Crossrefs

Cf. A056221.

Programs

  • Mathematica
    a[n_]:=(Prime[n]^2 - Prime[n-1]*Prime[n+1])/2; Array[a,54,3] (* Stefano Spezia, Jul 15 2024 *)
  • 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

Formula

a(n) = A056221(n-1)/2 for n >= 3.