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.

A357813 a(n) is the least number k such that the sum of n^2 consecutive primes starting at prime(k) is a square.

This page as a plain text file.
%I A357813 #55 Dec 15 2022 21:24:23
%S A357813 3,1,78,333,84,499,36,1874,1102,18,183,2706,23,104,739,1055,8435,633,
%T A357813 42130,13800,942,55693,7449,13270,41410,4317,17167,61999,17117,9161,
%U A357813 46704,12447,2679,2971,3946,103089,6359,19601,7240,422,690,20851,963,36597,3559,111687,12926,4071,30622,6355
%N A357813 a(n) is the least number k such that the sum of n^2 consecutive primes starting at prime(k) is a square.
%F A357813 a(n) = A230327(n^2).
%e A357813 Define sp(k,n) to be the sum of n^2 consecutive primes starting at prime(k).
%e A357813 a(2) = 3 because sp(k,2) at k=3 is 5 + 7 + 11 + 13 = 36 = 6^2, a square, and no smaller k has this property.
%e A357813 a(3) = 1 because sp(k,3) at k=1 is 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 = 100 = 10^2, a square, and no smaller k has this property.
%e A357813 a(4) = 78 because sp(k,4) at k=78 is 397 + 401 + ... + 487 = 7056 = 84^2, a square, and no smaller k has this property.
%o A357813 (PARI)
%o A357813 \\ sum of n^2 consecutive primes starting at prime(k).
%o A357813 sp(k,n)=my(u=primes([prime(k),prime(k+n*n-1)]));return(vecsum(u))
%o A357813 \\ Least number k such that sp(k,n) is a square.
%o A357813 a(n)=my(k=1);while(!issquare(sp(k,n)),k++);k
%o A357813 (PARI) a(n) = { my(pr = primes(n^2), s = vecsum(pr), startprime = nextprime(pr[#pr] + 1), res = 1); pr = List(pr); forprime(p = startprime, oo, if(issquare(s), return(res); ); res++; s += (p - pr[1]); listput(pr, p); listpop(pr, 1); ) } \\ _David A. Corneth_, Nov 13 2022
%Y A357813 Cf. A034963, A127336.
%Y A357813 Cf. A358156. Subsequence of A230327.
%K A357813 nonn
%O A357813 2,1
%A A357813 _Jean-Marc Rebert_, Nov 12 2022