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.

Showing 1-10 of 15 results. Next

A050936 Sum of two or more consecutive prime numbers.

Original entry on oeis.org

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
Offset: 1

Views

Author

G. L. Honaker, Jr., Dec 31 1999

Keywords

Examples

			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.
		

Crossrefs

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

Programs

  • 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
    
  • Maple
    # uses code of A084143
    isA050936 := proc(n::integer)
        if A084143(n) >= 1 then
            true;
        else
            false;
        end if;
    end proc:
    for n from 1 to 300 do
        if isA050936(n) then
            printf("%d,",n);
        end if;
    end do: # R. J. Mathar, Aug 19 2020
  • 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] (* Vladimir Joseph Stephan 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 &] (* Robert G. Wilson v *)
    Module[{nn=70,prs},prs=Prime[Range[nn]];Take[Union[Flatten[Table[Total/@ Partition[prs,i,1],{i,2,nn}]]],nn]] (* Harvey P. Dale, Nov 13 2013 *)
  • PARI
    is(n)=my(v,m=1,t); while(1,v=vector(m++); v[m\2]=precprime(n\m); for(i=m\2+1,m, v[i]=nextprime(v[i-1]+1)); forstep(i=m\2-1,1,-1, v[i]=precprime(v[i+1]-1)); if(v[1]==0, return(0)); t=vecsum(v); if(t==n,return(1)); if(t>n, while(t>n,t-=v[m]; v=concat(precprime(v[1]-1), v[1..m-1]); t+=v[1]), while(tCharles R Greathouse IV, May 05 2016
    
  • PARI
    list(lim)=my(v=List(),s,n=1,p); while(1, p=2; s=vecsum(primes(n++)); if(s>lim,return(Set(v))); listput(v,s); forprime(q=prime(n+1),, s+=q-p; if(s>lim,break); listput(v,s); p=nextprime(p+1))); \\ Charles R Greathouse IV, Nov 24 2021

Extensions

More terms from David W. Wilson, Jan 13 2000

A054859 Smallest positive integer that can be expressed as the sum of consecutive primes in exactly n ways.

Original entry on oeis.org

1, 2, 5, 41, 1151, 311, 34421, 218918, 3634531, 48205429, 1798467197, 12941709050, 166400805323, 6123584726269
Offset: 0

Views

Author

Jud McCranie, May 25 2000

Keywords

Comments

a(10)-a(12) found by Wilfred Whiteside in 2007. - Giovanni Resta, May 07 2020

Examples

			41 = 41 = 11+13+17 = 2+3+5+7+11+13, 41 is the smallest number expressible in 3 ways, so a(3)=41.
From _Robert G. Wilson v_, Feb 21 2011: (Start)
a(0) = 1 because 1 cannot be expressed as the sum of any set of consecutive primes,
a(1) = 2 because 2 is the first prime,
a(2) = 5 because 2+3 = 5,
a(4) = 1151 because 7+11+13+17+19+23+29+31+37+41+43+47+53+59+61+67+71+73+79+83+89+97+101 = 223+227+229+233+239 = 379+383+389 = 1151,
a(5) = 311 because 11+13+17+19+23+29+31+37+41+43+47 = 31+37+41+43+47+53+59 = 53+59+61+67+71 = 101+103+107 = 311,
a(6) = 34421 because  269+271+...+701+709 = 1429+1433+...+1567+1571 = 3793+3797+3803+3821+3823+3833+3847+3851+3853 = 4889+4903+4909+4919+4931+4933+4937 = 11467+11471+11483 = 34421,
a(7) = 218918 because 3301+3307+...+3767+3769 = 4561+4567+...+4951+4957 = 5623+5639+...+5881+5897 = 7691+7699+...+7933+7937 = 9851+9857+...+10067+10069  = 13619+13627+...+13723+13729 = 18199+18211+...+18287+18289,
a(8) = 3634531 because 313+317+...+7873+7877 = 977+983+...+7933+7937 = 31567+31573+...+32707+32713 = 70997+70999+...+71479+71483 = 73897+73907+...+74413+74419 = 172969+172973+...+173189+173191 = 519161+519193+...+519247+519257 = 3634531,
a(9) = 48205429 because 124291+124297+...+128747+128749 = 176303+176317+...+179453+179461 = 331537+331543+...+333383+333397 = 433577+433607+...+434933+434939 = 541061+541087+...+542141+542149 = 2536943+2536991+...+2537303+2537323 = 16068461+16068469+16068499 = 48205429, etc. (End)
From _Giovanni Resta_, May 07 2020: (Start)
The runs of primes corresponding to a(10)-a(13), in the format first prime (run length), are:
a(10) = 1798467197 (1), 599489047 (3), 51384499 (35), 41824483 (43), 14862469 (121), 2233859 (803), 1652909 (1083), 742243 (2371), 280591 (5683), 118297 (10073);
a(11) = 6470854519 (2), 2156951369 (6), 431390039 (30), 323542441 (40), 71896949 (180), 56266367 (230), 5574659 (2314), 4481189 (2874), 3547639 (3620), 1487399 (8366), 993197 (12024);
a(12) = 166400805323 (1), 55466935091 (3), 18488978293 (9), 3025468583 (55), 155650259 (1069), 135604109 (1227), 50227297 (3311), 29640257 (5605), 19365569 (8561), 6284627 (25655), 3188819 (46977), 429467 (127483);
a(13) = 6123584726269 (1), 360210866021 (17), 197534990813 (31), 124971116311 (49), 48217200953 (127), 40023427859 (153), 21188870723 (289), 13225879553 (463), 6166740911 (993), 3642804197 (1681), 2232410683 (2743), 992896649 (6167), 17062531 (311319). (End)
		

References

  • R. K. Guy, Unsolved Problems In Number Theory, C2.

Crossrefs

Programs

  • Mathematica
    lmt = 500000000; p = Prime@ Range@ PrimePi@ lmt; t = Table[0, {lmt}]; Do[s = 0; j = i; While[s = s + p[[j]]; s <= lmt, t[[s]]++; j++], {i, Length@ p}]; Table[ Position[t, n, 1, 1], {n, 0, 0}] (* Robert G. Wilson v, Feb 21 2011 *)

Extensions

a(10)-a(11) from Bert Dobbelaere, Apr 14 2020
a(12)-a(13) from Giovanni Resta, May 07 2020

A067372 Integers expressible as the sum of (at least two) consecutive primes in at least 2 ways.

Original entry on oeis.org

36, 41, 60, 72, 83, 90, 100, 112, 119, 120, 138, 143, 152, 180, 187, 197, 199, 204, 210, 221, 223, 228, 240, 251, 258, 276, 281, 287, 300, 304, 311, 323, 330, 340, 371, 372, 384, 390, 395, 401, 408, 410, 434, 439, 456, 462, 473, 480, 491, 492, 508, 510, 533
Offset: 1

Views

Author

Patrick De Geest, Feb 04 2002

Keywords

Examples

			36 = (17 + 19) = (5 + 7 + 11 + 13) or (#2,17) (#4,5).
		

Crossrefs

Programs

  • Mathematica
    m=5!; lst={}; Do[p=Prime[a]; Do[p+=Prime[b]; If[pVladimir Joseph Stephan Orlovsky, Aug 15 2009 *)
  • PARI
    upto(n) = {my(s = 0, pr = List([0]), l = List(), res = List()); forprime(p = 2, n + 100, s+=p; listput(pr, s) ); for(i = 3, #pr, for(j = 2, i-1, if(pr[i] - pr[i-j] <= n, listput(l, pr[i] - pr[i-j]) , next(2) ) ) ); listsort(l); for(i = 2, #l, if(l[i-1] == l[i], listput(res, l[i]) ) ); Set(res); } \\ David A. Corneth, Aug 22 2019

Formula

A084143(a(n)) > 1. - Ray Chandler, Sep 20 2023

Extensions

Offset corrected by Donovan Johnson, Nov 14 2013

A067377 Primes expressible as the sum of (at least two) consecutive primes in at least 1 way.

Original entry on oeis.org

5, 17, 23, 31, 41, 53, 59, 67, 71, 83, 97, 101, 109, 127, 131, 139, 173, 181, 197, 199, 211, 223, 233, 251, 263, 269, 271, 281, 311, 331, 349, 353, 373, 379, 401, 421, 431, 439, 443, 449, 457, 463, 479, 487, 491, 499, 503, 523, 563, 587, 593, 607, 617, 631, 647, 659, 661, 677, 683, 691, 701, 719
Offset: 1

Views

Author

Patrick De Geest, Feb 04 2002

Keywords

Examples

			The prime 83, for example, is the sum of the five consecutive primes 11 + 13 + 17 + 19 + 23.
The prime 2011, for example, is the sum of the eleven consecutive primes 157 + 163 + 167 + 173 + 179 + 181 + 191 + 193 + 197 + 199 + 211. - _Daniel Forgues_, Nov 03 2011
		

Crossrefs

Cf. A197227 (primes that are not the sum of consecutive primes).

Programs

  • Mathematica
    p = {}; Do[a = Table[ Prime[i], {i, n, 150}]; l = Length[a]; k = 2; While[k < l + 1, b = Plus @@@ Partition[a, k]; k++; p = Append[ p, Select[ b, PrimeQ[ # ] &]]], {n, 1, 149}]; Take[ Union[ Flatten[p]], 70]
    m=5!; lst={}; Do[p=Prime[a]; Do[p+=Prime[b]; If[PrimeQ[p]&&p<=Prime[m]*3+8,AppendTo[lst,p]],{b,a+1,m+2,1}],{a,m}]; Union[lst] (* Vladimir Joseph Stephan Orlovsky, Aug 15 2009 *)

Formula

Prime(n) such that A307610(n) > 1. - Ray Chandler, Sep 21 2023

Extensions

Offset changed to 1 by Hans Havermann, Oct 07 2018

A067380 Primes expressible as the sum of (at least two) consecutive primes in at least 4 ways.

Original entry on oeis.org

311, 863, 14369, 14699, 15329, 19717, 29033, 34421, 36467, 37607, 40433, 42463, 48731, 49253, 49499, 55813, 67141, 70429, 76423, 78791, 85703, 90011, 94559, 97159, 98411, 109159, 110359, 110527, 125821, 130513, 134921, 141587, 147031, 147347, 155087, 155387
Offset: 1

Views

Author

Patrick De Geest, Feb 04 2002

Keywords

Comments

Note that the definition says "at least two", so a(n) = a(n) itself is not allowed as a possible sum (see Examples).

Examples

			311 is a term because 311 is prime and
  11+13+17+19+23+29+31+37+41+43+47 = 311,
  31+37+41+43+47+53+59 = 311,
  53+59+61+67+71 = 311,
  101+103+107 = 311.
1151 is not a term, since although 1151 is prime it only has three representations of the required form:
  101+97+89+83+79+73+71+67+61+59+53+47+43+41+37+31+29+23+19+17+13+11+7 = 1151,
  239+233+229+227+223 = 1151,
  389+383+379 = 1151.
Also, 16277 is not a term because although it has five representations as a sum of consecutive primes, it is not itself a prime. - _Sean A. Irvine_, Dec 25 2021
		

Crossrefs

Programs

  • Magma
    M:=160000; P:=PrimesUpTo(M); S:=[0]; for p in P do t:=S[#S]+p; if #S ge 3 then if t-S[#S-2] gt M then break; end if; end if; S[#S+1]:=t;end for; c:=[0:j in [1..M]]; for C in [2..#S-1] do if IsEven(C) then L:=1; else L:=#S-C; end if; for j in [1..L] do s:=S[j+C]-S[j]; if s gt M then break; end if; if IsPrime(s) then c[s]+:=1; end if; end for; end for; [j:j in [1..M]|c[j] ge 4]; // Jon E. Schoenfield, Dec 25 2021
  • Mathematica
    m=7!; lst={}; Do[p=Prime[a]; Do[p+=Prime[b]; If[PrimeQ[p]&&pVladimir Joseph Stephan Orlovsky, Aug 15 2009 *)

Formula

Prime(n) such that A307610(n) > 4. - Ray Chandler, Sep 21 2023

Extensions

The terms have been confirmed by Sean A. Irvine, Dec 24 2021. - N. J. A. Sloane, Dec 25 2021

A067378 Primes expressible as the sum of (at least two) consecutive primes in at least 2 ways.

Original entry on oeis.org

41, 83, 197, 199, 223, 251, 281, 311, 401, 439, 491, 593, 733, 857, 863, 883, 941, 983, 991, 1061, 1151, 1187, 1283, 1361, 1367, 1381, 1433, 1439, 1493, 1511, 1523, 1553, 1607, 1753, 1801, 1823, 1901, 1951, 2011, 2027, 2099, 2111, 2179, 2203, 2267, 2357, 2393, 2417, 2579, 2647, 2689, 2731
Offset: 1

Views

Author

Patrick De Geest, Feb 04 2002

Keywords

Crossrefs

Programs

  • Mathematica
    m=3*5!; lst={}; Do[p=Prime[a]; Do[p+=Prime[b]; If[PrimeQ[p]&&pVladimir Joseph Stephan Orlovsky, Aug 15 2009 *)
  • PARI
    e=2500; for(d=2,e, if(d%2==1,h=d/3,h=d/2); f=floor(2*d/(log(d)*3)); g=0; for(c=1,f,a=0; b=0; forprime(n=prime(c),h+50,a=a+n; b=b+1;if (a==d,g=g+1; if(g>=2&isprime(a),print1(a, ", ")),if(a>d,next(2)))))) /* The parameter g selects the number of ways wanted. - Robin Garcia, Jan 11 2011 */

Formula

Prime(n) such that A307610(n) > 2. - Ray Chandler, Sep 21 2023

A067379 Primes expressible as the sum of (at least two) consecutive primes in at least 3 ways.

Original entry on oeis.org

311, 863, 1151, 1367, 1951, 2393, 2647, 2689, 3389, 4957, 5059, 5153, 7451, 7901, 8819, 10499, 10859, 10949, 12329, 12641, 12713, 13127, 13297, 14369, 14699, 14759, 14951, 15091, 15329, 15527, 16223, 16249, 16829, 18089, 18311, 18401
Offset: 1

Views

Author

Patrick De Geest, Feb 04 2002

Keywords

Crossrefs

Programs

  • Mathematica
    m=2*6!; lst={}; Do[p=Prime[a]; Do[p+=Prime[b]; If[PrimeQ[p]&&pVladimir Joseph Stephan Orlovsky, Aug 15 2009 *)

Formula

Prime(n) such that A307610(n) > 3. - Ray Chandler, Sep 21 2023

A164556 Primes expressible as the sum of (at least two) consecutive primes in at least 5 ways.

Original entry on oeis.org

34421, 229841, 235493, 271919, 345011, 358877, 414221, 442019, 488603, 532823, 621937, 655561, 824099, 888793, 896341, 935791, 954623, 963173, 988321, 1055969, 1083371, 1083941, 1115911, 1170857, 1261763, 1338823, 1352863, 1409299, 1444957, 1598953, 1690597
Offset: 1

Views

Author

Keywords

Comments

Subsequence of A067380.

Examples

			a(1) = 34421 = Sum_{i=57..127} prime(i) = Sum_{i=226..248} prime(i) = Sum_{i=527..535} prime(i) = Sum_{i=654..660} prime(i) = Sum_{i=1382..1384} prime(i) and
a(3) = 235493 = Sum_{i=50..284} prime(i) = Sum_{i=120..300} prime(i) = Sum_{i=123..301} prime(i) = Sum_{i=334..424} prime(i) = Sum_{i=7701..7703} prime(i)
are expressible in 5 ways as the sum of two or more consecutive primes.
		

Crossrefs

Programs

  • Magma
    M:=1695000; P:=PrimesUpTo(M); S:=[0]; for p in P do t:=S[#S]+p; if #S ge 3 then if t-S[#S-2] gt M then break; end if; end if; S[#S+1]:=t;end for; c:=[0:j in [1..M]]; for C in [2..#S-1] do if IsEven(C) then L:=1; else L:=#S-C; end if; for j in [1..L] do s:=S[j+C]-S[j]; if s gt M then break; end if; if IsPrime(s) then c[s]+:=1; end if; end for; end for; [j:j in [1..M]|c[j] ge 5]; // Jon E. Schoenfield, Dec 25 2021
  • Mathematica
    m=3*7!;lst={};Do[p=Prime[a];Do[p+=Prime[b];If[PrimeQ[p]&&p
    				

Formula

A067375 INTERSECT A000040.

Extensions

Examples added by R. J. Mathar, Aug 19 2009
a(10)-a(28) from Donovan Johnson, Sep 16 2009
a(29)-a(31) from Jon E. Schoenfield, Dec 25 2021

A067373 Integers expressible as the sum of (at least two) consecutive primes in at least 3 ways.

Original entry on oeis.org

240, 287, 311, 340, 371, 510, 660, 803, 863, 864, 931, 961, 990, 1012, 1060, 1099, 1104, 1151, 1164, 1236, 1313, 1320, 1367, 1392, 1524, 1643, 1650, 1710, 1788, 1793, 1854, 1951, 1956, 2040, 2303, 2304, 2387, 2393, 2436, 2507, 2556, 2586, 2647, 2670
Offset: 1

Views

Author

Patrick De Geest, Feb 04 2002

Keywords

Examples

			240 = (113 + 127) = (53 + 59 + 61 + 67) = (17 + 19 + 23 + 29 + 31 + 37 + 41 + 43) or (#2,113) (#4,53) (#8,17).
		

Crossrefs

Programs

  • Mathematica
    m=3*5!; lst={}; Do[p=Prime[a]; Do[p+=Prime[b]; If[pVladimir Joseph Stephan Orlovsky, Aug 15 2009 *)

Formula

A084143(a(n)) > 2. - Ray Chandler, Sep 20 2023

Extensions

Offset corrected by Donovan Johnson, Nov 14 2013

A067374 Integers expressible as the sum of (at least two) consecutive primes in at least 4 ways.

Original entry on oeis.org

311, 863, 1164, 1320, 1650, 1854, 2856, 2867, 3198, 3264, 3754, 4200, 4920, 5100, 5770, 5999, 6504, 8152, 10134, 10320, 10536, 10649, 11058, 12294, 12438, 12762, 12820, 12954, 12990, 14369, 14699, 14826, 15329, 15610, 15762, 16199, 16277
Offset: 1

Views

Author

Patrick De Geest, Feb 04 2002

Keywords

Examples

			E.g., 311 = 101 + 103 + 107 = 53 + 59 + 61 + 67 + 71 = 31 + 37 + 41 + 43 + 47 + 53 + 59 = 11 + 13 + 17 + 19 + 23 + 29 + 31 + 37 + 41 + 43 + 47.
		

Crossrefs

Programs

  • Mathematica
    Clear[lst,lst1,m,n,p,a,b] m=2*6!; lst={}; Do[p=Prime[a]; Do[p+=Prime[b]; If[pVladimir Joseph Stephan Orlovsky, Aug 15 2009 *)

Formula

A084143(a(n)) > 3. - Ray Chandler, Sep 20 2023

Extensions

Offset corrected by Donovan Johnson, Nov 14 2013
Showing 1-10 of 15 results. Next