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.

Original entry on oeis.org

2, 5, 2, 37, 83, 17, 7, 23, 13, 67, 163, 821, 227, 7, 13, 151, 599, 643, 271, 2, 83, 19, 83, 1069, 61, 37, 823, 263, 23, 857, 89, 1931, 139, 181, 71, 239, 1861, 739, 487, 37, 1237, 3833, 37, 6961, 1709, 499, 587, 271, 2687, 359, 5, 727, 73, 491, 73, 41, 3989, 797, 2083, 1451, 199, 349, 2027, 2441
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Oct 09 2019

Keywords

Comments

a(n)=3 for n=850 and 55154 (and presumably infinitely many others).

Examples

			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.
		

Crossrefs

Cf. A024011 (a(n)=2).

Programs

  • Maple
    P:= [0,seq(ithprime(i),i=1..100000)]:
    S:= ListTools:-PartialSums(P):
    f:= proc(n) local p,k;
      p:= ithprime(n);
      for k from 1 to nops(S)-n do
          if S[k+n]-S[k] mod p = 0 then
          return P[k+1]
          fi
        od;
      FAIL
    end proc:
    map(f, [$1..200]);
  • Mathematica
    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 *)