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 21-27 of 27 results.

A254859 Numbers that are both a sum and a product of two or more consecutive primes.

Original entry on oeis.org

15, 30, 77, 143, 210, 221, 323, 1001, 2310, 4199, 5767, 7429, 9797, 10403, 11021, 12317, 20711, 22499, 23707, 25591, 28891, 30030, 33263, 34571, 36863, 38021, 46189, 47053, 75067, 77837, 79523, 82861, 82919, 89951, 95477, 99221, 104927, 111547, 116939, 136891, 141367, 145157, 146969, 154433
Offset: 1

Views

Author

Altug Alkan, May 05 2016

Keywords

Examples

			15 is a term because 15 = 3 + 5 + 7 = 3*5.
30 is a term because 30 = 13 + 17 = 2*3*5.
77 is a term because 77 = 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 = 7*11.
		

Crossrefs

Intersection of A050936 and A097889.

Programs

  • Mathematica
    np = NextPrime; pro[n_] := Block[{e, f}, {f, e} = Transpose@ FactorInteger@ n; Length@ f > 1 && Union@ e == {1} && np@ Most@ f == Rest@ f]; seq[lim_] := Union[Reap[Block[{p = 2, q, s}, While[2 p < lim, q = np@p; s = p+q; While[s <= lim, If[pro@s, Sow@s]; q = np@q; s += q]; p = np@p]]][[2, 1]]]; seq[10^5] (* Giovanni Resta, May 05 2016 *)
  • Python
    # see link

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

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.

A337065 Infinite sum of the prime numbers, compacted (see the Comments line for an explanation).

Original entry on oeis.org

5, 12, 24, 59, 97, 84, 159, 128, 144, 162, 186, 420, 647, 457, 503, 360, 1214, 1677, 532, 548, 564, 600, 624, 648, 1033, 1079, 752, 772, 798, 828, 852, 1315, 906, 924, 1924, 3096, 1667, 3496, 1208, 1230, 3834, 1993, 1360, 2101, 1446, 1472, 2251, 1530, 3977, 2471, 1668, 2569
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Aug 14 2020

Keywords

Comments

If the successive terms of the present sequence are expressed as the sum of k>1 consecutive primes in only one way and added, the end result will be 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + ... (conjectured to extend ad infinitum).
This is the lexicographically earliest sequence of distinct positive terms with this property.
a(n) is the smallest term of A084146 such that the set of prime parts of a(n) has (i) no primes in common with the union of the prime parts of a(1), ..., a(n-1) and (ii) contains the smallest prime excluded in the union of the prime parts of a(1), ..., a(n-1). - R. J. Mathar, Aug 19 2020

Examples

			The 1st term is 5 and 5 = 2+3.
The 2nd term is 12 and 12 = 5+7.
The 3rd term is 24 and 24 = 11+13.
The 4th term is 59 and 59 = 17+19+23.
The 5th term is 97 and 97 = 29+31+37.
The 6th term is 84 and 84 = 41+43; etc.
(The 4th term is NOT a(4) = 36 as 36 is the sum of consecutive primes in more than one way: 36 = 17+19 and 36 = 5+7+11+13).
		

Crossrefs

Programs

  • Maple
    # the set of prime partitions of A084146(n)
    A084146Pset := proc(n::integer)
        option remember;
        local pset,k,i,spr ;
        pset := {} ;
        if isA084146(n) then
            for k from 2 do
                if add(ithprime(i),i=1..k) > n then
                    break;
                end if;
                for i from 1 do
                    spr := add( ithprime(j),j=i..i+k-1) ;
                    if spr > n then
                        break;
                    elif spr = n then
                        return {seq(ithprime(j),j=i..i+k-1)} ;
                    end if;
                end do:
            end do:
        end if;
        pset ;
    end proc:
    A337065 := proc(n)
        option remember;
        local pprev,i,pmex,uni, thiss ;
        # the set of all primes needed to represent all previous terms
        pprev := {} ;
        for i from 1 to n-1 do
            pprev := pprev union A084146Pset(procname(i)) ;
        end do ;
        # smallest prime not in the representation of previous terms
        for i from 1 do
            if not ithprime(i) in pprev then
                pmex := ithprime(i) ;
                break;
            end if;
        end do:
        for uni from 1 do
            thiss := A084146Pset(uni) ;
            if pmex in thiss and thiss intersect(pprev) = {} then
                return uni ;
            end if;
        end do:
    end proc:
    for n from 1 do
        print(A337065(n)) ;
    end do: # R. J. Mathar, Aug 19 2020

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

A336581 Mersenne exponents whose corresponding prime can be expressed as the sum of at least two consecutive primes.

Original entry on oeis.org

5, 7, 13, 17, 61
Offset: 1

Views

Author

Michel Marcus, Aug 30 2020

Keywords

Comments

127 is a term.

Examples

			5 is a term because 2^5-1 = 7 + 11 + 13.
17 is a term because 2^17-1 = 43669 + 43691 + 43711.
		

Crossrefs

Cf. A000043 (Mersenne exponents), A000668, A050936, A067377.

Programs

  • PARI
    isok(m) = my(p=2^m-1); isprime(p) && isA050936(p);

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 21-27 of 27 results.