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.

A365706 For n >= 1, a(n) is the least prime p such that the arithmetic mean of (n + 1) consecutive primes starting with p is a perfect square, or a(n) = -1 if no such p exists.

This page as a plain text file.
%I A365706 #47 Aug 15 2025 10:29:00
%S A365706 3,2393,5,827,53,271,1063,23993,197,29,193,2143,359,6829,397,17,433,
%T A365706 661,2837,25171,13597,563,10301,1814233,51427,6781,316817,7477,71,
%U A365706 238919,11491,3109,42293,38653,6263,13043,474497,21433,13,21419,16963,5119,705209,183761
%N A365706 For n >= 1, a(n) is the least prime p such that the arithmetic mean of (n + 1) consecutive primes starting with p is a perfect square, or a(n) = -1 if no such p exists.
%C A365706 Does a(n) exists for all n >= 1 ?
%C A365706 From _David A. Corneth_, Oct 18 2023: (Start)
%C A365706 Let s(n) be the sum of n + 1 consecutive primes starting with a(n). Then s(n)/(n+1) = m^2 for some positive integer m.
%C A365706 This means s(n) = (n + 1) * m^2. If n is even then m is odd if a(n) > 2.
%C A365706 As s(n) >= A007504(n) we have m^2 >= s(n)/(n+1) >= A007504(n)/(n+1) i.e. m >= sqrt(A007504(n)/(n+1)). So for some m we can see if m^2 * (n+1) is the sum of n+1 consecutive primes and if so a(n) is the smallest prime of these n+1 primes after testing all candidates up to m. (End)
%C A365706 s(n) = (n + 1)* a(n) + Sum_{i=0..(n-1)} (n-i)*g(i+1), thus we have Sum_{i=0..(n-1)} (n-i)*g(i+1) = (m^2 - a(n)) * (n + 1), g(j) are the n gaps between n + 1 consecutive primes. - _Ctibor O. Zizka_, Oct 18 2023
%H A365706 David A. Corneth, <a href="/A365706/b365706.txt">Table of n, a(n) for n = 1..1000</a>
%e A365706 n = 2: we search for the least prime(i) such that (prime(i) + prime(i + 1) + prime(i + 2))/3 = m^2, m an integer. This is valid for (2393 + 2399 + 2411)/3 = 49^2 thus a(2) = 2393.
%o A365706 (PARI) isok(x) = (denominator(x)==1) && issquare(x);
%o A365706 a(n) = my(k=1); while (!isok((vecsum(primes(k+n))-vecsum(primes(k-1)))/(n+1)), k++); prime(k); \\ _Michel Marcus_, Oct 16 2023
%o A365706 (PARI) a(n) = {my(m = n + 1, ps = vector(m, i, prime(i)), s); forprime(p = ps[m] + 1, , s = vecsum(ps); if(!(s % m) && issquare(s/m), return(ps[1])); ps = concat(vecextract(ps, "^1"), p));} \\ _Amiram Eldar_, Oct 18 2023
%Y A365706 Cf. A000040, A007504, A053001, A225195.
%K A365706 nonn
%O A365706 1,1
%A A365706 _Ctibor O. Zizka_, Oct 15 2023
%E A365706 More terms from _Amiram Eldar_, Oct 18 2023