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.

A339640 a(n) = (A062772(n) + A054270(n)) / 2 - A001248(n).

Original entry on oeis.org

0, 0, 1, 1, -1, 1, -1, 2, 3, 5, -1, 1, 0, 5, 1, 2, -1, 2, -1, 4, -1, -3, 2, 2, -1, 1, 1, 8, -4, 3, 4, 2, -4, 5, 10, -4, -4, -2, -1, 8, -1, -1, 5, -1, 3, -7, 4, 4, 1, 2, 1, 4, 5, 8, 8, 8, -1, 2, -4, -2, 3, 1, -8, -4, 1, -1, -4, 10, -2, 15, 8, 10, 2
Offset: 1

Views

Author

Dimitris Valianatos, Dec 11 2020

Keywords

Comments

Conjecture: The partial sums of this sequence are greater than or equal to zero. This means that the squares of the prime numbers are smaller than the average of the previous and the next prime number most of the time.

Examples

			For n = 10 prime(10)^2 = 29^2 = 841. The previous prime of 841 is 839 and the next 853. The average of 839 and 853 is (839 + 853)/2 = 846. So a(10) = 846 - 841 = 5.
		

Crossrefs

Programs

  • Maple
    f:= p -> (nextprime(p^2) + prevprime(p^2))/2 - p^2:
    map(f, [seq(ithprime(i),i=1..100)]); # Robert Israel, Nov 24 2024
  • Mathematica
    Array[(Total@ NextPrime[#, {-1, 1}])/2 - # &[Prime[#]^2] &, 73] (* Michael De Vlieger, Dec 11 2020 *)
  • PARI
    forprime(n = 2, 370, print1((nextprime(n^2) + precprime(n^2)) / 2 - n^2", "))

Formula

a(n) = (nextprime(prime(n)^2) + precprime(prime(n)^2)) / 2 - prime(n)^2.