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”).
%I #20 Nov 24 2024 13:59:28
%S 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,
%T 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,
%U -4,-2,3,1,-8,-4,1,-1,-4,10,-2,15,8,10,2
%N a(n) = (A062772(n) + A054270(n)) / 2 - A001248(n).
%C 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.
%H Robert Israel, <a href="/A339640/b339640.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = (nextprime(prime(n)^2) + precprime(prime(n)^2)) / 2 - prime(n)^2.
%e 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.
%p f:= p -> (nextprime(p^2) + prevprime(p^2))/2 - p^2:
%p map(f, [seq(ithprime(i),i=1..100)]); # _Robert Israel_, Nov 24 2024
%t Array[(Total@ NextPrime[#, {-1, 1}])/2 - # &[Prime[#]^2] &, 73] (* _Michael De Vlieger_, Dec 11 2020 *)
%o (PARI) forprime(n = 2, 370, print1((nextprime(n^2) + precprime(n^2)) / 2 - n^2", "))
%Y Cf. A000040, A001248, A054270, A062772, A123993.
%K sign
%O 1,8
%A _Dimitris Valianatos_, Dec 11 2020