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 13 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

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

A307610 Number of partitions of prime(n) into consecutive primes.

Original entry on oeis.org

1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 1, 2, 2, 1, 2, 2, 1, 1, 3, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 3, 3, 2, 3, 1, 1, 2, 1, 1, 3, 1, 2, 2, 2, 1, 3, 1, 1, 1, 5, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 3, 1, 1, 2, 2, 1, 3, 2, 2, 2, 1, 2, 1, 2, 2, 3, 2, 2, 1, 1, 2
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 18 2019

Keywords

Comments

a(n) - 1 = number of partitions of prime(n) into two or more consecutive primes. - Ray Chandler, Sep 26 2023

Examples

			prime(13) = 41 = 2 + 3 + 5 + 7 + 11 + 13 = 11 + 13 + 17, so a(13) = 3.
		

Crossrefs

Formula

a(n) = [x^prime(n)] Sum_{i>=1} Sum_{j>=i} Product_{k=i..j} x^prime(k).
a(n) = A054845(A000040(n)).

A084146 Integers that have exactly one representation as a sum of two or more consecutive primes.

Original entry on oeis.org

5, 8, 10, 12, 15, 17, 18, 23, 24, 26, 28, 30, 31, 39, 42, 48, 49, 52, 53, 56, 58, 59, 67, 68, 71, 75, 77, 78, 84, 88, 95, 97, 98, 101, 102, 109, 121, 124, 127, 128, 129, 131, 132, 139, 144, 150, 155, 156, 158, 159, 160, 161, 162, 168, 169, 172, 173, 181, 184, 186, 192
Offset: 1

Views

Author

Eric W. Weisstein, May 15 2003

Keywords

Comments

More fundamental than A050936, which gives integers having 1 *or more* such representations

Crossrefs

Cf. A050936, A084143, A337095 (subset of primes).

Programs

  • Maple
    # uses code of A084143
    isA084146 := proc(n::integer)
        if A084143(n) = 1 then
            true;
        else
            false;
        end if;
    end proc:
    for n from 1 to 300 do
        if isA084146(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Aug 19 2020

Formula

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

Extensions

More terms from Matthew Conroy, May 25 2003

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

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

Original entry on oeis.org

16277, 20272, 25416, 28500, 34421, 41074, 45101, 46660, 50560, 53424, 59068, 68787, 70104, 70692, 71548, 78756, 85433, 85481, 88453, 94350, 98881, 105827, 117907, 120151, 121847, 125952, 130638, 130789, 131420, 132539, 133367, 134376, 135918, 139853, 158810
Offset: 1

Views

Author

Patrick De Geest, Feb 04 2002

Keywords

Examples

			E.g. 16277 = (#7,2297) (#11,1451) (#13,1213) (#35,359) (#37,331).
		

Crossrefs

Programs

  • Mathematica
    t={};Do[p=Prime[m];Do[p=p+Prime[n];If[p<200000,AppendTo[t,p]],{n,m+1,7001}],{m,1,7000}];t=Sort@t;f5[l_]:=Module[{t={}},Do[If[l[[n]]==l[[n+4]],AppendTo[t,l[[n]]]],{n,Length[l]-4}];t];Union@f5[t] (* Vladimir Joseph Stephan Orlovsky, Jan 30 2012 *)

Formula

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

Extensions

Offset and a(35) corrected by Donovan Johnson, Nov 14 2013

A084147 Integers that have exactly 2 representations as sums of consecutive primes.

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, 251, 258, 276, 281, 300, 304, 323, 330, 372, 384, 390, 395, 401, 408, 410, 434, 439, 456, 462, 473, 480, 491, 492, 508, 533, 540, 551, 552, 558, 559, 576
Offset: 1

Views

Author

Eric W. Weisstein, May 15 2003

Keywords

Comments

More fundamental than A067372, which gives integers having 2 *or more* such representations

Examples

			36 is in the sequence because it can be written in exactly two ways as sum of consecutive primes: 17+19 and 5+7+11+13.
		

Crossrefs

Programs

  • Maple
    g:=sum(sum(product(x^ithprime(k),k=i..j),j=i+1..150),i=1..150): gser:=series(g,x=0,605): a:=proc(n) if coeff(gser,x^n)=2 then op(2,x^n) else fi end: seq(a(n),n=1..600); # Emeric Deutsch, Mar 30 2006
    # Alternative
    N:= 70: # for terms up to prime(N-1)+prime(N)
    P:= [seq(ithprime(i),i=1..N)]: m:= P[N-1]+P[N]:
    S:= ListTools:-PartialSums(P):
    V:= Vector(m):
    for i from 2 while S[i] <= m do V[S[i]]:= 1 od:
    for i from 1 to N-2 do
      for j from i+2 to N while S[j]-S[i] <= m do V[S[j]-S[i]]:= V[S[j]-S[i]] + 1
    od od:
    select(t -> V[t] = 2, [$1..m]); # Robert Israel, Feb 14 2021
  • Mathematica
    With[{nn=100},Take[Sort[Select[Tally[Flatten[Table[Total/@Partition[Prime[Range[nn]],n,1],{n,2,nn}]]],#[[2]]==2&]][[All,1]],nn]] (* Harvey P. Dale, Mar 06 2020 *)

Extensions

More terms from John W. Layman, May 21 2003

A087072 Numbers having no partitions into a sum of two or more consecutive primes.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 9, 11, 13, 14, 16, 19, 20, 21, 22, 25, 27, 29, 32, 33, 34, 35, 37, 38, 40, 43, 44, 45, 46, 47, 50, 51, 54, 55, 57, 61, 62, 63, 64, 65, 66, 69, 70, 73, 74, 76, 79, 80, 81, 82, 85, 86, 87, 89, 91, 92, 93, 94, 96, 99, 103, 104, 105, 106, 107, 108, 110, 111
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 08 2003

Keywords

Comments

A084143(a(n)) = 0; complement of A050936.

Crossrefs

A163246 Squares which can be represented as the sum of consecutive primes in more than one way.

Original entry on oeis.org

36, 100, 576, 841, 961, 1764, 1849, 2209, 2304, 7056, 22801, 24649, 25600, 30276, 31684, 32400, 36481, 39601, 40000, 47524, 48400, 48841, 57600, 58081, 66564, 69169, 69696, 76729, 77284, 80089, 85849, 93636, 94864, 96721, 112896, 119716, 128164, 134689, 138384, 140625, 142884, 147456
Offset: 1

Views

Author

Gaurav Kumar, Jul 23 2009

Keywords

Examples

			6^2 = 36 = 5 + 7 + 11 + 13 = 17 + 19.
		

Crossrefs

Formula

{ A000290 } intersect { A034707 }.
{ A000290 } intersect { A050936 }.
k^2 such that A084143(k^2) > 1. - Georg Fischer, Jul 08 2022

Extensions

Offset corrected by Arkadiusz Wesolowski, Mar 28 2012
Duplicate 2304 removed and some missing terms inserted by Georg Fischer, Jul 08 2022
Showing 1-10 of 13 results. Next