A054998 Integers that can be expressed as the sum of consecutive primes in exactly 3 ways.
41, 83, 197, 199, 223, 240, 251, 281, 287, 340, 371, 401, 439, 491, 510, 593, 660, 733, 803, 857, 864, 883, 931, 941, 961, 983, 990, 991, 1012, 1060, 1061, 1099, 1104, 1187, 1236, 1283, 1313, 1361, 1381, 1392, 1433, 1439, 1493, 1511, 1523, 1524, 1553
Offset: 1
Keywords
Examples
41 can be expressed as 41 or 11+13+17 or 2+3+5+7+11+13, so 41 is in the sequence.
References
- R. K. Guy, Unsolved Problems in Number Theory, section C2.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- Carlos Rivera, Puzzle 46. Primes expressible as sum of consecutive primes in K ways, The Prime Puzzles and Problems Connection.
Programs
-
Maple
N:= 10^4: # to get all terms <= N P:= [0,op(select(isprime, [2,seq(i,i=3..N,2)]))]: nP:= nops(P); S:= ListTools:-PartialSums(P): V:= Vector(N): for i from 1 to nP-1 do for j from i+1 to nP while S[j] - S[i] <= N do V[S[j]-S[i]]:= V[S[j]-S[i]]+1 od od: select(t -> V[t] = 3, [$1..N]): # Robert Israel, Apr 05 2017
-
Mathematica
Module[{nn = 300, s}, s = Array[Prime, nn]; Keys@ Take[Select[KeySort@ Merge[Table[PositionIndex@ Map[Total, Partition[s, k, 1]], {k, nn/2}], Identity], Length@ # == 3 &], Floor[nn/6]]] (* Michael De Vlieger, Apr 06 2017, Version 10 *)
Formula
A054845(a(n)) = 3. - Ray Chandler, Sep 20 2023