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.

A074741 Sum of squares of gaps between consecutive primes.

This page as a plain text file.
%I A074741 #33 Dec 19 2024 20:37:28
%S A074741 1,5,9,25,29,45,49,65,101,105,141,157,161,177,213,249,253,289,305,309,
%T A074741 345,361,397,461,477,481,497,501,517,713,729,765,769,869,873,909,945,
%U A074741 961,997,1033,1037,1137,1141,1157,1161,1305,1449,1465,1469,1485,1521
%N A074741 Sum of squares of gaps between consecutive primes.
%D A074741 R. K. Guy, Unsolved Problems in Number Theory, Springer-Verlag, New York, Heidelberg, 1994, problem A8.
%H A074741 T. D. Noe, <a href="/A074741/b074741.txt">Table of n, a(n) for n = 1..10000</a>
%H A074741 Paul Erdös, <a href="https://users.renyi.hu/~p_erdos/1955-12.pdf">Some problems on the distribution of prime numbers</a>, C.I.M.E., Teoria dei numeri (1955).
%H A074741 D. R. Heath-Brown, <a href="http://matwbn.icm.edu.pl/ksiazki/aa/aa41/aa4118.pdf">Gaps between primes and the pair correlation of zeros of the zeta function</a>, Acta Arithmetica, vol. XLI (1982), 85.
%H A074741 M. Wolf, <a href="https://pdfs.semanticscholar.org/78a1/7349819304863ae061df88dbcb26b4908f03.pdf">Some conjectures on the gaps between consecutive primes</a>, preprint IFTUWr 894//95, submitted to Asterisque.
%F A074741 a(n) = Sum_{k=1..n} (prime(k+1)-prime(k))^2 = Sum_{k=1..n} A001223(k)^2.
%F A074741 Asymptotic expressions: D. R. Heath-Brown's conjecture: Sum_{prime(n)<=N} (prime(n)-prime(n-1))^2 ~ 2*N*log(N). Marek Wolf's conjecture: Sum_{prime(n)<N} (prime(n)-prime(n-1))^2 = 2*N^2/pi(N) + error term(N), pi(N)=A000720(n).
%p A074741 with(numtheory): a := proc(n) option remember: if (n=1) then RETURN(1) else RETURN(a(n-1)+(ithprime(n+1)-ithprime(n))^2) fi: end:
%t A074741 Rest[FoldList[Plus, 0, (#[[2]] - #[[1]])^2 & /@ Partition[Prime[Range[100]], 2, 1]]]
%t A074741 nn=60;With[{dsp=Differences[Prime[Range[nn+1]]]^2},Table[Total[Take[ dsp,n]],{n,nn}]] (* _Harvey P. Dale_, Nov 30 2011 *)
%t A074741 Accumulate[Differences[Prime[Range[60]]]^2] (* _Harvey P. Dale_, May 08 2015 *)
%o A074741 (PARI) a(n) = sum(k=1, n, (prime(k+1) - prime(k))^2); \\ _Michel Marcus_, May 26 2018
%o A074741 (Python)
%o A074741 from sympy import nextprime
%o A074741 from itertools import islice, accumulate
%o A074741 def gen():
%o A074741     p, q = 2, 3
%o A074741     while True:
%o A074741         r = (q - p) ** 2
%o A074741         yield r
%o A074741         p, q = q, nextprime(q)
%o A074741 print(list(accumulate(islice(gen(), 51)))) # _Adrienne Leonardo_, Dec 18 2024
%Y A074741 Partial sums of A076821. - _Michel Marcus_, May 26 2018
%Y A074741 Cf. A001223.
%K A074741 nonn,nice
%O A074741 1,2
%A A074741 Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Sep 05 2002