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.

A309770 Numbers that are sums of one or more consecutive primes in more than one way.

This page as a plain text file.
%I A309770 #14 Feb 16 2025 08:33:55
%S A309770 5,17,23,31,36,41,53,59,60,67,71,72,83,90,97,100,101,109,112,119,120,
%T A309770 127,131,138,139,143,152,173,180,181,187,197,199,204,210,211,221,223,
%U A309770 228,233,240,251,258,263,269,271,276,281,287,300,304,311,323,330,331,340,349
%N A309770 Numbers that are sums of one or more consecutive primes in more than one way.
%C A309770 Contains A067372 as a subsequence.
%H A309770 Robert Israel, <a href="/A309770/b309770.txt">Table of n, a(n) for n = 1..10000</a>
%H A309770 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimeSums.html">Prime Sums</a>
%F A309770 A054845(a(n)) > 1.
%e A309770 5 is in the sequence because it can be written as either 5 or 2 + 3.
%e A309770 36 is the sequence because it can be written as either 5 + 7 + 11 + 13 or 17 + 19.
%p A309770 N:= 1000: # for terms <= N
%p A309770 P:= select(isprime, [2, seq(i,i=3..N,2)]):
%p A309770 S:= [0,op(ListTools:-PartialSums(P))]:
%p A309770 V:= Vector(N):
%p A309770 for i from 1 to nops(S) do
%p A309770   for j from i-1 to 1 by -1 do
%p A309770     v:= S[i]-S[j];
%p A309770     if v > N then break fi;
%p A309770     V[v]:= V[v]+1;
%p A309770 od od:
%p A309770 select(t -> V[t]>1, [$1..N]); # _Robert Israel_, Aug 22 2019
%Y A309770 Cf. A000040, A034707, A050936, A054845, A054996, A067372, A067377.
%K A309770 nonn
%O A309770 1,1
%A A309770 _Ilya Gutkovskiy_, Aug 16 2019