login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) is the smallest odd number that can be represented as the sum of one or more consecutive primes in n ways.
1

%I #24 Nov 20 2022 08:15:15

%S 3,5,41,1151,311,34421,442019,3634531,48205429,1798467197

%N a(n) is the smallest odd number that can be represented as the sum of one or more consecutive primes in n ways.

%H Sean A. Irvine, <a href="https://github.com/archmageirvine/joeis/blob/master/src/irvine/oeis/a060/A060433.java">Java program</a> (github)

%H Carlos Rivera, <a href="http://www.primepuzzles.net/problems/prob_009.htm">Problem 9. Let f(n) be the number of ways of representing n as the sum of one or more consecutive primes. Is f(n)=k solvable for every k?</a>, The Prime Puzzles and Problems Connection.

%e a(2) = 5 because of 5 and 2+3 = 5. a(3) = 41 because of 41, 2+3+5+7+11+13 = 41 and 11+13+17 = 41.

%t lim = 500000; cnt = Table[If[OddQ[n] && PrimeQ[n], 1, 0], {n, lim}]; ps = Prime[Range[PrimePi[lim]]]; sm = ps; i = 0; While[i++; j = 1; While[sm[[j]] = sm[[j]] + ps[[i + j]]; sm[[j]] <= lim, If[OddQ[sm[[j]]], cnt[[sm[[j]]]]++]; j++]; j > 1]; Table[Position[cnt, i, 1, 1][[1, 1]], {i, Union[cnt][[-1]]}] (* _T. D. Noe_, Nov 03 2011 *)

%K nonn

%O 1,1

%A _Jason Earls_, Apr 06 2001

%E Edited by Larry Reeves (larryr(AT)acm.org), Apr 25 2001

%E a(10) from _Sean A. Irvine_, Nov 20 2022