login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A050936 Sum of two or more consecutive prime numbers. 16
5, 8, 10, 12, 15, 17, 18, 23, 24, 26, 28, 30, 31, 36, 39, 41, 42, 48, 49, 52, 53, 56, 58, 59, 60, 67, 68, 71, 72, 75, 77, 78, 83, 84, 88, 90, 95, 97, 98, 100, 101, 102, 109, 112, 119, 120, 121, 124, 127, 128, 129, 131, 132, 138, 139, 143, 144, 150, 152, 155, 156, 158, 159, 160, 161, 162 (list; graph; refs; listen; history; internal format)
OFFSET

1,1

LINKS

T. D. Noe, Table of n, a(n) for n=1..10000

P. De Geest, WONplate 122

C. Rivera, Puzzle 46

Eric Weisstein's World of Mathematics, Prime Sums

EXAMPLE

E.g. 5 = (2 + 3) or (#2,2).

2+3 = 5, 3+5 = 8, 2+3+5 = 10, 7+5 = 12, 3+5+7 = 15, etc.

MATHEMATICA

lst={}; Do[p=Prime[n]; Do[p=p+Prime[k]; AppendTo[lst, p], {k, n+1, 2*10^2}], {n, 2*10^2}]; Take[Union[lst], 10^2] [From Vladimir Orlovsky , Aug 21 2008]

f[n_] := Block[{len = PrimePi@ n}, p = Prime@ Range@ len; Count[ Flatten[ Table[ p[[i ;; j]], {i, len}, {j, i+1, len}], 1], q_ /; Total@ q == n]]; Select[ Range@ 150, f@ # > 0 &] (* Or quicker for a larger range *)

lmt = 150; p = Prime@ Range@ PrimePi@ lmt; t = Table[0, {lmt}]; Do[s = 0; j = i+1; While[s = s + p[[j]]; s <= lmt, t[[s]]++; j++], {i, Length@ p}]; Select[ Range@ lmt, t[[#]] > 0 &] (* RGWv *)

PROG

(Haskell)

import Data.Set (empty, findMin, deleteMin, insert)

import qualified Data.Set as Set (null)

a050936 n = a050936_list !! (n-1)

a050936_list = f empty [2] 2 $ tail a000040_list where

   f s bs c (p:ps)

     | Set.null s || head bs <= m = f (foldl (flip insert) s bs') bs' p ps

     | otherwise                  = m : f (deleteMin s) bs c (p:ps)

     where m = findMin s

           bs' = map (+ p) (c : bs)

-- Reinhard Zumkeller, Aug 26 2011

CROSSREFS

Cf. A067372 up to A067381, A054996, A000040.

A084143(a(n)) > 0, complement of A087072.

Cf. A034707, A054845, A097889.

Sequence in context: A115401 A153663 A065528 * A084146 A087280 A022413

Adjacent sequences:  A050933 A050934 A050935 * A050937 A050938 A050939

KEYWORD

nice,nonn,easy

AUTHOR

G. L. Honaker, Jr. (honak3r(AT)gmail.com), Dec 31 1999

EXTENSIONS

More terms from David W. Wilson (davidwwilson(AT)comcast.net), Jan 13, 2000.

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 14 22:15 EST 2012. Contains 205670 sequences.