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 10 results.

A127337 Numbers that are the sum of 10 consecutive primes.

Original entry on oeis.org

129, 158, 192, 228, 264, 300, 340, 382, 424, 468, 510, 552, 594, 636, 682, 732, 780, 824, 870, 912, 954, 1008, 1060, 1114, 1164, 1216, 1266, 1320, 1376, 1434, 1494, 1546, 1596, 1650, 1704, 1752, 1800, 1854, 1914, 1974, 2030, 2084, 2142, 2192, 2250, 2310, 2374
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

a(n) is the absolute value of coefficient of x^9 of the polynomial Product_{j=0..9} (x - prime(n+j)) of degree 10; the roots of this polynomial are prime(n), ..., prime(n+9).

Crossrefs

Programs

  • Magma
    [&+[ NthPrime(n+k): k in [0..9] ]: n in [1..90] ]; // Vincenzo Librandi, Apr 03 2011
    
  • Maple
    A127337 := proc(n)
        local i ;
        add(ithprime(n+i),i=0..9) ;
    end proc:
    seq(A127337(n),n=1..30) ; # R. J. Mathar, Apr 24 2023
  • Mathematica
    a = {}; Do[AppendTo[a, Sum[Prime[x + n], {n, 0, 9}]], {x, 1, 50}]; a
    Table[Plus@@Prime[Range[n, n + 9]], {n, 50}] (* Alonso del Arte, Feb 15 2011 *)
    ListConvolve[ConstantArray[1, 10], Prime[Range[50]]]
    Total/@Partition[Prime[Range[60]],10,1] (* Harvey P. Dale, Jan 31 2013 *)
  • PARI
    {m=46;k=10;for(n=1,m,print1(a=sum(j=0,k-1,prime(n+j)),","))} \\ Klaus Brockhaus, Jan 13 2007
    
  • PARI
    {m=46;k=10;for(n=1,m,print1(abs(polcoeff(prod(j=0,k-1,(x-prime(n+j))),k-1)),","))} \\ Klaus Brockhaus, Jan 13 2007
    
  • Python
    from sympy import prime
    def a(n): return sum(prime(n + i) for i in range(10))
    print([a(n) for n in range(1, 48)]) # Michael S. Branicky, Dec 09 2021
    
  • Python
    # faster version for generating initial segment of sequence
    from sympy import nextprime
    def aupton(terms):
        alst, plst = [], [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
        for n in range(terms):
            alst.append(sum(plst))
            plst = plst[1:] + [nextprime(plst[-1])]
        return alst
    print(aupton(47)) # Michael S. Branicky, Dec 09 2021

Formula

a(n) = A127336(n)+A000040(n+9). - R. J. Mathar, Apr 24 2023

Extensions

Edited by Klaus Brockhaus, Jan 13 2007

A127333 Numbers that are the sum of 6 consecutive primes.

Original entry on oeis.org

41, 56, 72, 90, 112, 132, 156, 180, 204, 228, 252, 280, 304, 330, 358, 384, 410, 434, 462, 492, 522, 552, 580, 606, 630, 660, 690, 724, 756, 796, 834, 864, 896, 926, 960, 990, 1020, 1054, 1084, 1114, 1140, 1172, 1214, 1250, 1286, 1322, 1362, 1392, 1420
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

a(n) is the absolute value of coefficient of x^5 of the polynomial Prod_{j=0,5}(x-prime(n+j)) of degree 6; the zeros of this polynomial are prime(n), ..., prime(n+5).

Crossrefs

Programs

  • Magma
    [&+[ NthPrime(n+k): k in [0..5] ]: n in [1..80] ]; /* Vincenzo Librandi, Apr 03 2011 */
  • Mathematica
    a = {}; Do[AppendTo[a, Sum[Prime[x + n], {n, 0, 5}]], {x, 1, 50}]; a
    Total/@Partition[Prime[Range[60]],6,1] (* Harvey P. Dale, Mar 12 2015 *)
  • PARI
    {m=50;k=6;for(n=0,m-1,print1(a=sum(j=1,k,prime(n+j)),","))} \\ Klaus Brockhaus, Jan 12 2007
    
  • PARI
    {m=50;k=6;for(n=1,m,print1(abs(polcoeff(prod(j=0,k-1,(x-prime(n+j))),k-1)),","))} \\ Klaus Brockhaus, Jan 12 2007
    

Extensions

Edited by Klaus Brockhaus, Jan 12 2007

A127335 Numbers that are the sum of 8 successive primes.

Original entry on oeis.org

77, 98, 124, 150, 180, 210, 240, 270, 304, 340, 372, 408, 442, 474, 510, 546, 582, 620, 660, 696, 732, 768, 802, 846, 888, 928, 966, 1012, 1056, 1104, 1154, 1194, 1236, 1278, 1320, 1362, 1404, 1444, 1480, 1524, 1574, 1622, 1670, 1712, 1758, 1802, 1854, 1900
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

a(n) is the absolute value of coefficient of x^7 of the polynomial Prod_{j=0,7}(x-prime(n+j)) of degree 8; the roots of this polynomial are prime(n), ..., prime(n+7).

Crossrefs

Programs

  • Magma
    [&+[ NthPrime(n+k): k in [0..7] ]: n in [1..90] ]; // Vincenzo Librandi, Apr 03 2011
  • Maple
    S:= [0,op(ListTools:-PartialSums(select(isprime, [2,seq(i,i=3..1000,2)])))]:
    S[9..-1]-S[1..-9]; # Robert Israel, Nov 27 2017
  • Mathematica
    a = {}; Do[AppendTo[a, Sum[Prime[x + n], {n, 0, 7}]], {x, 1, 50}]; a
    Total/@Partition[Prime[Range[60]],8,1] (* Harvey P. Dale, Sep 10 2019 *)
  • PARI
    {m=48;k=8;for(n=1,m,print1(a=sum(j=0,k-1,prime(n+j)),","))} \\ Klaus Brockhaus, Jan 13 2007
    
  • PARI
    {m=48;k=8;for(n=1,m,print1(abs(polcoeff(prod(j=0,k-1,(x-prime(n+j))),k-1)),","))} \\ Klaus Brockhaus, Jan 13 2007
    
  • PARI
    a(n)=my(p=prime(n));p+sum(i=2,8,p=nextprime(p+1)) \\ Charles R Greathouse IV, Apr 19 2015
    

Formula

a(n) ~ 8n log n. - Charles R Greathouse IV, Apr 19 2015

Extensions

Edited by Klaus Brockhaus, Jan 13 2007

A127336 Numbers that are the sum of 9 consecutive primes.

Original entry on oeis.org

100, 127, 155, 187, 221, 253, 287, 323, 363, 401, 439, 479, 515, 553, 593, 635, 679, 721, 763, 803, 841, 881, 929, 977, 1025, 1067, 1115, 1163, 1213, 1267, 1321, 1367, 1415, 1459, 1511, 1555, 1601, 1643, 1691, 1747, 1801, 1851, 1903, 1951, 1999, 2053
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

a(n) = absolute value of coefficient of x^8 of the polynomial Product_{j=0..8}(x - prime(n+j)) of degree 9; the roots of this polynomial are prime(n), ..., prime(n+8).

Crossrefs

Programs

  • Magma
    [&+[ NthPrime(n+k): k in [0..8] ]: n in [1..100] ]; // Vincenzo Librandi, Apr 03 2011
    
  • Mathematica
    A127336 = {}; Do[AppendTo[A127336, Sum[Prime[x + n], {n, 0, 8}]], {x, 1, 50}]; A127336 (* Artur Jasinski, Jan 11 2007 *)
    Table[Plus@@Prime[Range[n, n + 8]], {n, 50}] (* Alonso del Arte, Aug 27 2013 *)
    Total/@Partition[Prime[Range[60]],9,1] (* Harvey P. Dale, Nov 18 2020 *)
  • PARI
    {m=46;k=9;for(n=1,m,print1(a=sum(j=0,k-1,prime(n+j)),","))} \\ Klaus Brockhaus, Jan 13 2007
    {m=46;k=9;for(n=1,m,print1(abs(polcoeff(prod(j=0,k-1,(x-prime(n+j))),k-1)),","))} \\ Klaus Brockhaus, Jan 13 2007
    
  • Python
    from sympy import prime
    def a(x): return sum([prime(x + n) for n in range(9)])
    print([a(i) for i in range(1, 50)]) # Indranil Ghosh, Mar 18 2017

Formula

a(n) = A127335(n)+A000040(n+8). - R. J. Mathar, Apr 24 2023

Extensions

Edited by Klaus Brockhaus, Jan 13 2007

A127338 Numbers that are the sum of 11 consecutive primes.

Original entry on oeis.org

160, 195, 233, 271, 311, 353, 399, 443, 491, 539, 583, 631, 677, 725, 779, 833, 883, 931, 979, 1025, 1081, 1139, 1197, 1253, 1313, 1367, 1423, 1483, 1543, 1607, 1673, 1727, 1787, 1843, 1901, 1951, 2011, 2077, 2141, 2203, 2263, 2323, 2383, 2443, 2507
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

a(n) = absolute value of coefficient of x^10 of the polynomial Product_{j=0..10} (x - prime(n+j)) of degree 11; the roots of this polynomial are prime(n), ..., prime(n+10).

Crossrefs

Programs

  • Magma
    [&+[ NthPrime(n+k): k in [0..10] ]: n in [1..70] ]; // Vincenzo Librandi, Apr 03 2011
  • Mathematica
    f[n_] := Sum[Prime[n + i], {i, 0, 10}]; Array[f, 45]
    Plus @@@ Partition[ Prime@ Range@ 55, 11, 1] (* Robert G. Wilson v, Jan 13 2011 *)
  • PARI
    {m=45;k=11;for(n=1,m,print1(a=sum(j=0,k-1,prime(n+j)),","))} \\ Klaus Brockhaus, Jan 13 2007
    
  • PARI
    {m=45;k=11;for(n=1,m,print1(abs(polcoeff(prod(j=0,k-1,(x-prime(n+j))),k-1)),","))} \\ Klaus Brockhaus, Jan 13 2007
    

Extensions

Edited by Klaus Brockhaus, Jan 13 2007

A127339 Numbers that are the sum of 12 consecutive primes.

Original entry on oeis.org

197, 236, 276, 318, 364, 412, 460, 510, 562, 612, 662, 714, 766, 822, 880, 936, 990, 1040, 1092, 1152, 1212, 1276, 1336, 1402, 1464, 1524, 1586, 1650, 1716, 1786, 1854, 1918, 1980, 2040, 2100, 2162, 2234, 2304, 2370, 2436, 2502, 2564, 2634, 2700, 2770
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

a(n) = absolute value of coefficient of x^11 of the polynomial Product_{j=0..11} (x - prime(n+j)) of degree 12; the roots of this polynomial are prime(n), ..., prime(n+11).

Crossrefs

Programs

  • Magma
    [&+[ NthPrime(n+k): k in [0..11] ]: n in [1..100] ]; // Vincenzo Librandi, Apr 03 2011
  • Mathematica
    a = {}; Do[AppendTo[a, Sum[Prime[x + n], {n, 0, 11}]], {x, 1, 50}]; a
    Total/@Partition[Prime[Range[60]],12,1] (* Harvey P. Dale, May 05 2018 *)
  • PARI
    {m=45;k=12;for(n=1,m,print1(a=sum(j=0,k-1,prime(n+j)),","))} \\ Klaus Brockhaus, Jan 13 2007
    
  • PARI
    {m=45;k=12;for(n=1,m,print1(abs(polcoeff(prod(j=0,k-1,(x-prime(n+j))),k-1)),","))} \\ Klaus Brockhaus, Jan 13 2007
    

Extensions

Edited by Klaus Brockhaus, Jan 13 2007

A362465 a(n) is the least number of 2 or more consecutive signed primes whose sum equals n.

Original entry on oeis.org

3, 2, 2, 4, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 5, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 3, 2, 5, 2, 3
Offset: 0

Views

Author

Karl-Heinz Hofmann, Apr 21 2023

Keywords

Comments

Inspired by a conjecture made by Carlos Rivera in 2000 (see link). Here we remove Rivera's restriction that the primes have to be smaller than n.
For every positive even n, a(n) = 2, provided there are 2 consecutive primes separated by a gap of size n. Polignac's conjecture says: "For any positive even number n, there are infinitely many prime gaps of size n." If so, a(3) is the only 4 in this sequence, as any even number of consecutive odd signed primes has an even sum.
There is also the reversed sequence for negative n with 0 as the symmetry point.
See A362466 for the first occurrences of numbers in this sequence.

Examples

			a(1) = 2: -2 + 3 = 1.
a(0) = 3: -2 - 3 + 5 = 0.
a(3) = 4:  2 + 3 + 5 - 7 = 3.
The example below for a(29) gives more detail of the general method employed.
a(29) = 5:  3 - 5 + 7 + 11 + 13 = 29.
Since any even number of consecutive odd signed primes has an even sum, we can show a(29) <> 4.
A test with all triples of consecutive signed primes up to 10^9 gave no solution for 29. The estimated lower bound for the permutation p1 + p2 - p3 is p1 - (p1 + 2)^0.525 and was never surpassed. (See Wikipedia link. "A result, due to Baker, Harman and Pintz in 2001, shows that Theta may be taken to be 0.525".) So the terms are calculated with the assumption that this is true.
		

Crossrefs

Cf. A000230, A001632, A362466 (first occurrences).

Programs

  • Python
    from sympy import primepi, sieve as prime
    import numpy
    upto = 50000                   # 5000000 good for 8 GB RAM (3 Minutes)
    primepi_of_upto, np, arr = primepi(upto), 1, []
    A362465 = numpy.zeros(upto + 1, dtype="i4")
    A362465[2:][::2] = 2           # holds if "upto" < 7 * 10^7
    for n in range(1,primepi_of_upto + 1): arr.append([prime[n]])
    while all(A362465) == 0:
        np += 1
        for k in range(0,primepi_of_upto):
            temp = []
            for i in arr[k]:
                temp.append(i + prime[k+np])
                temp.append(abs(i - prime[k+np]))
            arr[k] = set(temp)
            for n in temp:
                if n <= upto and A362465[n] == 0: A362465[n] = np
    print(list(A362465[0:100]))

Formula

a(n) = a(-n).

Extensions

Edited by Peter Munn, Aug 08 2023

A127492 Indices m of primes such that Sum_{k=0..2, k

Original entry on oeis.org

2, 10, 17, 49, 71, 72, 75, 145, 161, 167, 170, 184, 244, 250, 257, 266, 267, 282, 286, 301, 307, 325, 343, 391, 405, 429, 450, 537, 556, 561, 584, 685, 710, 743, 790, 835, 861, 904, 928, 953
Offset: 1

Views

Author

Artur Jasinski, Jan 16 2007

Keywords

Comments

Let p_0 .. p_4 be five consecutive primes, starting with the m-th prime. The index m is in the sequence if the absolute value [x^0] of the polynomial (x-p_0)*[(x-p_1)*(x-p_2) + (x-p_2)*(x-p_3) + (x-p_3)*(x-p_4)] + (x-p_1)*[(x-p_2)*(x-p_3) + (x-p_3)*(x-p_4)] + (x-p_2)*(x-p_3)*(x-p_4) is two times a prime. The correspondence with A127491: the coefficient [x^2] of the polynomial (x-p_0)*(x-p_1)*..*(x-p_4) is the sum of 10 products of a set of 3 out of the 5 primes. Here the sum is restricted to the 6 products where the two largest of the 3 primes are consecutive. - R. J. Mathar, Apr 23 2023

Crossrefs

Programs

  • Maple
    isA127492 := proc(k)
        local x,j ;
        (x-ithprime(k))* mul( x-ithprime(k+j),j=1..2)
        +(x-ithprime(k))* mul( x-ithprime(k+j),j=2..3)
        +(x-ithprime(k))* mul( x-ithprime(k+j),j=3..4)
        +(x-ithprime(k+1))* mul( x-ithprime(k+j),j=2..3)
        +(x-ithprime(k+1))* mul( x-ithprime(k+j),j=3..4)
        +(x-ithprime(k+2))* mul( x-ithprime(k+j),j=3..4) ;
        p := abs(coeff(expand(%/2),x,0)) ;
        if type(p,'integer') then
            isprime(p) ;
        else
            false ;
        end if ;
    end proc:
    for k from 1 to 900 do
        if isA127492(k) then
            printf("%a,",k) ;
        end if ;
    end do: # R. J. Mathar, Apr 23 2023
  • Mathematica
    a = {}; Do[If[PrimeQ[(Prime[x] Prime[x + 1]Prime[x + 2] + Prime[x] Prime[x + 2]Prime[x + 3] + Prime[x] Prime[x + 3] Prime[x + 4] + Prime[x + 1] Prime[x + 2]Prime[x + 3] + Prime[x + 1] Prime[x + 3]Prime[x + 4] + Prime[x + 2] Prime[x + 3] Prime[x + 4])/2], AppendTo[a, x]], {x, 1, 1000}]; a
    prQ[{a_,b_,c_,d_,e_}]:=PrimeQ[(a b c+a c d+a d e+b c d+b d e+c d e)/2]; PrimePi/@Select[ Partition[ Prime[Range[1000]],5,1],prQ][[;;,1]] (* Harvey P. Dale, Apr 21 2023 *)

Extensions

Definition simplified by R. J. Mathar, Apr 23 2023
Edited by Jon E. Schoenfield, Jul 23 2023

A283873 Smallest number that is the sum of n successive primes and also the sum of n successive semiprimes, n > 1.

Original entry on oeis.org

24, 749, 48, 311, 690, 251, 2706, 2773, 6504, 1081, 2162, 1753, 11356, 6223, 1392, 2303, 9838, 637, 14510, 1995, 3154, 21459, 72960, 5691, 8140, 1475, 2350, 3647, 1593, 7607, 55074, 2719, 9852, 12143, 106562, 12615, 9036, 19883, 15438, 28369, 8560, 8415, 3831
Offset: 2

Views

Author

Zak Seidov, Mar 17 2017

Keywords

Comments

The sequence is non-monotone.

Examples

			a(2) = 24 = A000040(5) + A000040(6) = 11 + 13 = A001358(4) + A001358(5) = 10 + 14,
a(3) = 749 = A000040(53) + A000040(54) + A000040(55) = 241 + 251 + 257 = A001358(79) + A001358(80) + A001358(81) = 247 + 249 + 253.
		

Crossrefs

Cf. A000040 Primes, A001358 Semiprimes, A118717 Sum of two consecutive semiprimes.
Sum of k consecutive primes: A001043 k=2, A034961 k=3, A034963 k=4, A034964 k=5, A127333 k=6, A127334 k=7, A127335 k=8, A127336 k=9, A127337 k=10, A127338 k=11, A127339 k=12.

Programs

  • Maple
    issp:= n-> is(not isprime(n) and numtheory[bigomega](n)=2):
    ithsp:= proc(n) option remember; local k; for k from 1+
            `if`(n=1, 1, ithsp(n-1)) while not issp(k) do od; k
            end:
    ps:= proc(i, j) option remember;
           ithprime(j)+`if`(i=j, 0, ps(i, j-1))
         end:
    ss:= proc(i, j) option remember;
           ithsp(j)+`if`(i=j, 0, ss(i, j-1))
         end:
    a:= proc(n) option remember; local i, j, k, l, p, s;
          i, j, k, l, p, s:= 1, n, 1, n, ps(1, n), ss(1, n);
          do if p=s then return p
           elif pAlois P. Heinz, Mar 24 2017
  • Mathematica
    sp=Select[Range[4,100000],2==PrimeOmega[#]&];pr=Prime[Range[PrimePi[Max[sp]]]];
    Table[Intersection[(Total/@Partition[pr,k,1]),Total/@Partition[sp,k,1]][[1]],{k,2,100}]

Extensions

More terms from Alois P. Heinz, Mar 24 2017

A125270 Coefficient of x^2 in polynomial whose zeros are 5 consecutive primes starting with the n-th prime.

Original entry on oeis.org

1358, 3954, 10478, 22210, 43490, 78014, 129530, 206650, 324350, 466270, 621466, 853742, 1132130, 1436690, 1870850, 2388050, 2886370, 3440410, 4133410, 4904906, 5926654, 7195670, 8425430, 9792950, 11040910, 12098990, 13917898, 16097810
Offset: 1

Author

Artur Jasinski, Jan 16 2007

Keywords

Comments

Sums of all distinct products of 3 out of 5 consecutive primes, starting with the n-th prime; value of 3rd elementary symmetric function on the 5 consecutive primes.

Programs

  • Mathematica
    a = {}; Do[AppendTo[a, (Prime[x] Prime[x + 1] Prime[x + 2] + Prime[x] Prime[x + 1] Prime[x + 3] + Prime[x] Prime[x + 1] Prime[x + 4] + Prime[x] Prime[x + 2] Prime[x + 3] + Prime[x] Prime[x + 2] Prime[x + 4] + Prime[x] Prime[x + 3] Prime[x + 4] + Prime[x + 1] Prime[x + 2] Prime[x + 3] + Prime[x + 1] Prime[x + 2] Prime[x + 4] + Prime[x + 1] Prime[x + 3] Prime[x + 4] + Prime[x + 2] Prime[x + 3] Prime[x + 4])], {x, 1, 100}]; a
    fcp[{p_,q_,r_,s_,t_}]:=p*q(r+s+t)+(p+q)r(s+t)+(p+q+r)s*t; fcp/@Partition[ Prime[ Range[40]],5,1] (* Harvey P. Dale, Sep 05 2014 *)

Formula

Let p = Prime(n), q = Prime(n+1), r = Prime(n+2), s = Prime(n+3) and t = Prime(n+4). Then a(n) = p q (r+s+t) + (p + q) r (s + t) + (p + q + r) s t.

Extensions

Edited and corrected by Franklin T. Adams-Watters, Jan 23 2007
Showing 1-10 of 10 results.