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.

A328264 a(n) is the least prime p such that prime(n) divides the sum of n consecutive primes starting with p.

This page as a plain text file.
%I A328264 #13 Oct 10 2019 21:31:12
%S A328264 2,5,2,37,83,17,7,23,13,67,163,821,227,7,13,151,599,643,271,2,83,19,
%T A328264 83,1069,61,37,823,263,23,857,89,1931,139,181,71,239,1861,739,487,37,
%U A328264 1237,3833,37,6961,1709,499,587,271,2687,359,5,727,73,491,73,41,3989,797,2083,1451,199,349,2027,2441
%N A328264 a(n) is the least prime p such that prime(n) divides the sum of n consecutive primes starting with p.
%C A328264 a(n)=3 for n=850 and 55154 (and presumably infinitely many others).
%H A328264 Robert Israel, <a href="/A328264/b328264.txt">Table of n, a(n) for n = 1..9332</a>
%e A328264 a(4)=37 because prime(4)=7 divides the sum of 4 consecutive primes starting with 37 (37+41+43+47=168), but does not divide any earlier sum of 4 consecutive primes.
%p A328264 P:= [0,seq(ithprime(i),i=1..100000)]:
%p A328264 S:= ListTools:-PartialSums(P):
%p A328264 f:= proc(n) local p,k;
%p A328264   p:= ithprime(n);
%p A328264   for k from 1 to nops(S)-n do
%p A328264       if S[k+n]-S[k] mod p = 0 then
%p A328264       return P[k+1]
%p A328264       fi
%p A328264     od;
%p A328264   FAIL
%p A328264 end proc:
%p A328264 map(f, [$1..200]);
%t A328264 a[n_] := Block[{m=Prime@n, s=Sum[Prime@i, {i, n}], p=2, q}, q=m; While[Mod[s, m] > 0, s-=p; {p, q} = NextPrime@{p, q}; s+=q]; p]; Array[a, 70] (* _Giovanni Resta_, Oct 10 2019 *)
%Y A328264 Cf. A024011 (a(n)=2).
%K A328264 nonn
%O A328264 1,1
%A A328264 _J. M. Bergot_ and _Robert Israel_, Oct 09 2019