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.

Previous Showing 11-20 of 20 results.

A065867 Primes which are the sum of a prime number of consecutive primes.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Dec 07 2001

Keywords

Examples

			5 = 2 + 3.
23 = 5 + 7 + 11.
31 = 7 + 11 + 13.
41 = 11 + 13 + 17.
53 = 5 + 7 + 11 + 13 + 17.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[s=Prime[m];k=1;Do[p=Prime[n];s+=p;k++;If[PrimeQ[s]&&PrimeQ[k],If[s<=10837,AppendTo[lst,s]]],{n,m+1,5*5!}],{m,5*5!}];lst=Take[Union@lst,500] (* Vladimir Joseph Stephan Orlovsky, Sep 13 2009 *)
    Module[{nn=60,prs},prs=Prime[Range[nn]];Take[Select[Union[ Flatten[ Table[ Total/@ Partition[prs,n,1],{n,prs}]]],PrimeQ],nn]] (* Harvey P. Dale, Aug 12 2016 *)

A133576 Numbers which are sums of consecutive composites.

Original entry on oeis.org

4, 6, 8, 9, 10, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80, 81
Offset: 1

Views

Author

Jonathan Vos Post, Dec 26 2007

Keywords

Comments

This is to composites A002808 as A034707 is to primes A000040. The complement of this sequence, numbers which are not sums of consecutive composites, begins 1, 2, 3, 5, 7, ... (A140464).

Examples

			Every composite is in this sequence as one consecutive composite. We account for primes thus:
a(10) = 17 = 8 + 9.
a(12) = 19 = 9 + 10.
a(16) = 23 = 6 + 8 + 9.
a(22) = 29 = 14 + 15.
a(24) = 31 = 9 + 10 + 12.
a(30) = 37 = 4 + 6 + 8 + 9 + 10.
a(34) = 41 = 20 + 21 = 12 + 14 + 15.
a(36) = 43 = 21 + 22.
Not included = 47.
a(45) = 53 = 26 + 27 = 8 + 9 + 10 + 12 + 14.
a(51) = 59 = 18 + 20 + 21 = 6 + 8 + 9 + 10 + 12 + 14.
Not included = 61.
a(58) = 67 = 33 + 34 = 21 + 22 + 24 = 10 + 12 + 14 + 15 + 16.
a(62) = 71 = 35 + 36 = 22 + 24 + 25 = 4 + 6 + 8 + 9 + 10 + 12 + 14.
Not included = 73.
a(69) = 79 = 39 + 40.
a(73) = 83 = 14 + 15 + 16 + 18 + 20.
a(79) = 89 = 44 + 45.
a(87) = 97 = 48 + 49 = 22 + 24 + 25 + 26.
a(91) = 101 = 50 + 51.
a(93) = 103 = 51 + 52.
		

Crossrefs

Cf. A002808, A034707, A037174, A140464 (complement).

Programs

  • Maple
    isA133576 := proc(n)
        local i,j ;
        for i from 1 do
            if A002808(i) > n then
                return false;
            end if;
            for j from i do
                s := add( A002808(l),l=i..j) ;
                if s > n then
                    break;
                elif s = n then
                    return true;
                end if;
            end do:
        end do:
    end proc:
    A133576 := proc(n)
        local a;
        if n = 1 then
            return A002808(1) ;
        else
            for a from procname(n-1)+1 do
                if isA133576(a) then
                    return a;
                end if;
            end do:
        end if ;
    end proc:
    seq(A133576(n),n=1..71) ; # R. J. Mathar, Feb 14 2015
  • Mathematica
    okQ[n_] := If[CompositeQ[n], True, MemberQ[IntegerPartitions[n, All, Select[Range[n], CompositeQ]], p_List /; Length[p] == Length[Union[p]] && AllTrue[Complement[Range[p[[-1]], p[[1]]], p], PrimeQ]]];
    Select[Range[150], okQ] (* Jean-François Alcover, Oct 27 2023 *)

A166709 Number of distinct integers expressible as sums of consecutive primes up to n-th prime.

Original entry on oeis.org

1, 3, 5, 9, 14, 20, 25, 32, 39, 49, 56, 68, 78, 92, 105, 115, 128, 144, 157, 171, 192, 211, 231, 253, 276, 297, 319, 339, 366, 396, 419, 442, 473, 500, 533, 561, 592, 628, 665, 691, 726, 759, 794, 832, 868, 900, 936, 979, 1028, 1070, 1114, 1159, 1208, 1248, 1298
Offset: 1

Views

Author

Zak Seidov, Oct 18 2009

Keywords

Comments

a(n) <= n(n+1)/2 (= T(n), A000217 Triangular numbers) because some sums give the same value. E.g., a(4)=9, T(4)=10, a(4)=T(4)-1, because 5 is equal to two sums 2+3, and 5. For n=100 "deficit" is 700: a(100)=4350=T(100)-700=5050-700.

Examples

			n=4: 9 distinct integers = 2, 3, 5, 7, 8(=3+5), 10(=2+3+5), 12(=5+7), 15(=3+5+7), and 17(=2+3+5+7);
n=10: 49 distinct integers: 2, 3, 5, 7, 8, 10, 11, 12, 13, 15, 17, 18, 19, 23, 24, 26, 28, 29, 30, 31, 36, 39, 41, 42, 48, 49, 52, 53, 56, 58, 59, 60, 67, 71, 72, 75, 77, 83, 88, 90, 95, 98, 100, 101, 112, 119, 124, 127, 129.
From _Rick L. Shepherd_, Oct 18 2009: (Start)
The first 6 rows of actual sums are:
n=1: 2
n=2: 2,3,5
n=3: 2,3,5,8,10
n=4: 2,3,5,7,8,10,12,15,17
n=5: 2,3,5,7,8,10,11,12,15,17,18,23,26,28
n=6: 2,3,5,7,8,10,11,12,13,15,17,18,23,24,26,28,31,36,39,41 (End)
		

Crossrefs

Cf. A034707 (numbers which are sums of consecutive primes).

Programs

  • Mathematica
    Table[Length[Union[Total/@Flatten[Table[Partition[Prime[Range[m]],k,1],{k,m}],1]]],{m,100}]
  • PARI
    A166709(n)=#Set(concat(vector(n,i,vector(i,j,sum(k=j,i,prime(k)))))) \\ M. F. Hasler, Oct 18 2009

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

A272713 Prime powers (p^k, k>=2) that are the sum of consecutive prime numbers.

Original entry on oeis.org

8, 49, 121, 128, 169, 243, 625, 841, 961, 1331, 1369, 1681, 1849, 2209, 3125, 5329, 6241, 6859, 6889, 8192, 10201, 11449, 11881, 12167, 12769, 16384, 18769, 22801, 24649, 26569, 32768, 36481, 39601, 44521
Offset: 1

Views

Author

Altug Alkan, May 05 2016

Keywords

Comments

In other words, prime powers (p^k, k>=2) that are the sum of two or more consecutive prime numbers.
Intersection of A025475 and A034707.
Terms of this sequence are 2^3, 7^2, 11^2, 2^7, 13^2, 3^5, 5^4, 29^2, ...

Examples

			8 is a term because 8 = 2^3 = 3 + 5.
49 is a term because 49 = 7^2 = 13 + 17 + 19.
121 is a term because 121 = 11^2 = 37 + 41 + 43.
		

Crossrefs

Programs

  • PARI
    list(lim)=my(v=List(),n=1,p,q,t,s); while(1, t=primes(n++); p=2; q=t[n]; s=vecsum(t); if(s>lim, return(Set(v))); while(s<=lim, if(isprimepower(s)>1, listput(v,s)); q=nextprime(q+1); s+=q-p; p=nextprime(p+1))) \\ Charles R Greathouse IV, May 05 2016

Extensions

a(9)-a(34) from Charles R Greathouse IV, May 05 2016

A287027 Least sum s of consecutive prime numbers starting with prime(n) such that s is a perfect square.

Original entry on oeis.org

100, 961, 36, 14017536, 484, 49, 36, 134689, 354025, 80089, 443556, 121, 47524, 7744, 100, 700569, 344956329, 48841, 5329, 144, 324, 39601, 22801, 8649, 239438955625, 12250000, 197136, 222784, 147456, 319225, 316969, 24649, 576, 2975625, 7396, 21316, 70036245333532859364
Offset: 1

Views

Author

Zak Seidov, May 18 2017

Keywords

Comments

Squares that are the sum of 4 consecutive primes: 36, 324, 576, 1764, 2304, 4900, 20736, 63504, 66564, 128164, 142884, 150544, 156816, 183184, 236196, 256036, 260100, 311364, 369664, 414736.
Squares that are the sum of 5 consecutive primes: 961, 1089, 1681, 17689, 18769, 21025, 23409, 45369, 76729, 80089, 97969, 124609, 218089, 235225, 290521, 421201, 434281.
Squares that are the sum of 6 consecutive primes: 3600, 24336, 25600, 47524, 66564, 98596, 129600, 138384, 228484, 236196, 331776, 379456, 404496, 490000, 559504.
Squares that are the sum of 7 consecutive primes: 169, 625, 2209, 10201, 25921, 235225, 342225, 361201, 380689, 383161, 426409, 508369, 531441, 537289, 543169, 564001, 603729.
Note that A007504(m) - A007504(n) ~ m^2 log(m)/2 as m -> infinity. Heuristically this has probability ~ 1/(m sqrt(2 log(m))) of being a square. Since the sum of these probabilities diverges, on the basis of the second Borel-Cantelli lemma we should expect a(n) to exist. Of course, this is not a proof. Moreover, since the sum diverges very slowly, we might expect some very large values of a(n). - Robert Israel, May 18 2017

Examples

			Sum of set {2,3,5,7,11,13,17,19,23} is 100 = 10^2, sum of set {3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83} is 961=31^2, sum of set {5,7,11,13}=36=6^2.
		

Crossrefs

Cf. A062703 (squares that are the sum of 2 consecutive primes), A080665 (squares that are the sum of 3 consecutive primes), A034707 (numbers that are sums of consecutive primes).
Cf. A007504.

Programs

  • Maple
    f:= proc(n) local p, s;
      p:= ithprime(n); s:= p;
    while not issqr(s) do p:= nextprime(p); s:= s+p od:
      s
    end proc:
    map(f, [$1..36]); # Robert Israel, May 18 2017
  • Mathematica
    Table[Set[{k, s}, {n, 0}]; While[! IntegerQ@ Sqrt[AddTo[s, Prime@ k]], k++]; s, {n, 36}] (* Michael De Vlieger, May 20 2017 *)
  • PARI
    a(n) = my(s=0); forprime(p=prime(n), , s=s+p; if(issquare(s), return(s))) \\ Felix Fröhlich, May 25 2017

Extensions

Missing a(25) and a(37) from Giovanni Resta, May 18 2017

A309770 Numbers that are sums of one or more consecutive primes in more than one way.

Original entry on oeis.org

5, 17, 23, 31, 36, 41, 53, 59, 60, 67, 71, 72, 83, 90, 97, 100, 101, 109, 112, 119, 120, 127, 131, 138, 139, 143, 152, 173, 180, 181, 187, 197, 199, 204, 210, 211, 221, 223, 228, 233, 240, 251, 258, 263, 269, 271, 276, 281, 287, 300, 304, 311, 323, 330, 331, 340, 349
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 16 2019

Keywords

Comments

Contains A067372 as a subsequence.

Examples

			5 is in the sequence because it can be written as either 5 or 2 + 3.
36 is the sequence because it can be written as either 5 + 7 + 11 + 13 or 17 + 19.
		

Crossrefs

Programs

  • Maple
    N:= 1000: # for terms <= N
    P:= select(isprime, [2, seq(i,i=3..N,2)]):
    S:= [0,op(ListTools:-PartialSums(P))]:
    V:= Vector(N):
    for i from 1 to nops(S) do
      for j from i-1 to 1 by -1 do
        v:= S[i]-S[j];
        if v > N then break fi;
        V[v]:= V[v]+1;
    od od:
    select(t -> V[t]>1, [$1..N]); # Robert Israel, Aug 22 2019

Formula

A054845(a(n)) > 1.

A338446 Numbers that are sums of consecutive odd primes.

Original entry on oeis.org

3, 5, 7, 8, 11, 12, 13, 15, 17, 18, 19, 23, 24, 26, 29, 30, 31, 36, 37, 39, 41, 42, 43, 47, 48, 49, 52, 53, 56, 59, 60, 61, 67, 68, 71, 72, 73, 75, 78, 79, 83, 84, 88, 89, 90, 95, 97, 98, 100, 101, 102, 103, 107, 109, 112, 113, 119, 120, 121, 124, 127, 128, 131, 132, 137
Offset: 1

Views

Author

Ilya Gutkovskiy, Oct 28 2020

Keywords

Examples

			67 is in the sequence because 67 = 7 + 11 + 13 + 17 + 19.
		

Crossrefs

Programs

  • Maple
    q:= proc(n) local p, q, s; p, q, s:= prevprime(n+1)$3;
          do if p=2 then return false
           elif s=n then return true
           elif sAlois P. Heinz, Oct 31 2020
  • Mathematica
    okQ[n_] := Module[{p, q, s}, {p, q, s} = Table[NextPrime[n + 1, -1], {3}]; While[True, Which[
         p == 2, Return@ False,
         s == n, Return@ True,
         s < n, p = NextPrime[p, -1]; s = s + p,
         True, s = s - q; q = NextPrime[q, -1]]]];
    Select[Range[3, 150], okQ] (* Jean-François Alcover, Feb 21 2022, after Alois P. Heinz *)
  • Python
    from sympy import prevprime
    def ok(n):
        if n < 2: return False
        p, q, s = [prevprime(n+1)] * 3
        while True:
            if p == 2: return False
            if s == n: return True
            elif s < n: p = prevprime(p); s += p
            else: s -= q; q = prevprime(q)
    print([k for k in range(150) if ok(k)]) # Michael S. Branicky, Feb 21 2022 after Alois P. Heinz

A352423 Numbers that are the sum of some number of consecutive prime cubes.

Original entry on oeis.org

8, 27, 35, 125, 152, 160, 343, 468, 495, 503, 1331, 1674, 1799, 1826, 1834, 2197, 3528, 3871, 3996, 4023, 4031, 4913, 6859, 7110, 8441, 8784, 8909, 8936, 8944, 11772, 12167, 13969, 15300, 15643, 15768, 15795, 15803, 19026, 23939, 24389, 26136, 27467, 27810, 27935, 27962, 27970, 29791
Offset: 1

Views

Author

Michel Marcus, Apr 26 2022

Keywords

Crossrefs

Programs

  • PARI
    lista(nn) = {my(list = List(), ip = primepi(nn), vp = primes(ip)); for(i=1, ip, my(s=vp[i]^3); listput(list, s); for (j=i+1, ip, s += vp[j]^3; if (s >vp[ip]^3, break); listput(list, s); ); ); Vec(vecsort(list, , 8)); }
    
  • Python
    import heapq
    from sympy import prime
    from itertools import islice
    def agen(): # generator of terms
        p = prime(1)**3; h = [(p, 1, 1)]; nextcount = 2
        while True:
            (v, s, l) = heapq.heappop(h)
            yield v
            if v >= p:
                p += prime(nextcount)**3
                heapq.heappush(h, (p, 1, nextcount))
                nextcount += 1
            v -= prime(s)**3; s += 1; l += 1; v += prime(l)**3
            heapq.heappush(h, (v, s, l))
    print(list(islice(agen(), 47))) # Michael S. Branicky, Apr 26 2022

A351125 Numbers that are sums of consecutive primorial numbers.

Original entry on oeis.org

1, 2, 3, 6, 8, 9, 30, 36, 38, 39, 210, 240, 246, 248, 249, 2310, 2520, 2550, 2556, 2558, 2559, 30030, 32340, 32550, 32580, 32586, 32588, 32589, 510510, 540540, 542850, 543060, 543090, 543096, 543098, 543099, 9699690, 10210200, 10240230, 10242540, 10242750
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 22 2022

Keywords

Examples

			2550 is in the sequence because 2550 = 30 + 210 + 2310 = 2*3*5 + 2*3*5*7 + 2*3*5*7*11.
		

Crossrefs

Previous Showing 11-20 of 20 results.