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.

A320687 Sum of differences of the larger square and primes between two squares.

This page as a plain text file.
%I A320687 #11 Jun 17 2019 18:02:10
%S A320687 3,6,8,16,12,28,19,34,31,72,42,58,63,70,116,122,79,90,112,134,169,170,
%T A320687 108,212,200,196,246,226,240,244,292,318,394,276,336,418,283,528,445,
%U A320687 582,429,392,530,416,565,506,581,634,548,554,655,866,616,676,641,714,965,710,922,968,827
%N A320687 Sum of differences of the larger square and primes between two squares.
%C A320687 Consider the primes p1,...,pK between two squares n^2 and (n+1)^2, and take the sum of the differences (listed as A106044): ((n+1)^2 - p1) + ... + ((n+1)^2 - pK).
%H A320687 Robert Israel, <a href="/A320687/b320687.txt">Table of n, a(n) for n = 1..10000</a>
%F A320687 a(n) = A014085(n)*A000290(n+1) - A108314(n), where A000290(n) = n^2.
%e A320687 a(1) = 3 = 2 + 1, where {2, 1} = 4 - {2, 3: primes between 1^2 = 1 and 2^2 = 4}.
%e A320687 a(2) = 6 = 4 + 2, with {4, 2} = 9 - {5, 7: primes between 2^2 = 4 and 3^2 = 9}.
%e A320687 a(3) = 8 = sum of {5, 3} = 16 - {11, 13: primes between 3^2 = 9 and 4^2 = 16}.
%e A320687 a(4) = 16 = sum of {8, 6, 2} = 25 - {17, 19, 23: primes between 4^2 and 5^2 = 25}.
%e A320687 a(5) = 12 = sum of {7, 5} = 36 - {29, 31: primes between 5^2 = 25 and 6^2 = 36}.
%p A320687 N:= 100: # to get a(1)..a(N)
%p A320687 V:= Vector(N):
%p A320687 p:= 1;
%p A320687 do
%p A320687    p:= nextprime(p);
%p A320687    n:= floor(sqrt(p));
%p A320687    if n > N then break fi;
%p A320687    V[n]:= V[n]+(n+1)^2-p;
%p A320687 od:
%p A320687 convert(V,list); # _Robert Israel_, Jun 17 2019
%o A320687 (PARI) a(n,s=0)={forprime(p=n^2,(n+=1)^2,s+=n^2-p);s}
%Y A320687 Equals A014085 * A000290(.+1) - A108314.
%Y A320687 Row sums of A106044 read as a table.
%K A320687 nonn
%O A320687 1,1
%A A320687 _M. F. Hasler_, Oct 19 2018