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 53 results. Next

A287609 Intersection of A034961 and A127345.

Original entry on oeis.org

31, 71, 311, 551, 1151, 14831, 45791, 455471, 2035271, 6345239, 7241615, 8290031, 8329991, 9086231, 9324351, 10449575, 11497199, 15454151, 16515815, 18337271, 20650811, 22946591, 27609311, 33220079, 40487471, 44106191, 45015791, 49021199, 53315519, 54536519
Offset: 1

Views

Author

Zak Seidov, May 27 2017

Keywords

Comments

Surprisingly many terms are prime numbers: 31,71,311,1151,14831,455471.
Positions of a(n) in A127345: {1,2,4,5,7,19,30,76,142}.
Positions of a(n) in A034961: {4,8,26,41,75,660,1780,14009,54929}.
Positions of primes in a(n): {1,2,3,5,6,8,21,22,25,32,37,39,40,45,49,50, 59,62,66,69,...}. - Michael De Vlieger, May 28 2017

Examples

			31 is in the sequence because it is both the total of three consecutive primes (7 + 11 + 13) and it is (2*3 + 2*5 + 3*5) = (6 + 10 + 15). - _Michael De Vlieger_, May 28 2017
		

Crossrefs

Programs

  • Mathematica
    Intersection[Map[Total, #], Map[#1 #2 + #1 #3 + #2 #3 & @@ # &, #]] &@ Partition[Prime@ Range[10^6], 3, 1] (* Michael De Vlieger, May 28 2017 *)
  • Python
    from _future_ import division
    from sympy import isprime, prevprime, nextprime
    A287609_list, p, q, r = [], 2, 3, 5
    while r < 10**6:
        n = p*(q+r) + q*r
        m = n//3
        pm, nm = prevprime(m), nextprime(m)
        k = n - pm - nm
        if isprime(m):
            if m == k:
                A287609_list.append(n)
        else:
            if nextprime(nm) == k or prevprime(pm) == k:
                A287609_list.append(n)
        p, q, r = q, r, nextprime(r) # Chai Wah Wu, May 31 2017

Extensions

More terms from Michael De Vlieger, May 28 2017

A287686 Numbers that are sums of three consecutive primes (A034961) and also sums of squares of three consecutive primes (A133529).

Original entry on oeis.org

83, 366819, 1055019, 1947411, 2740107, 3694179, 6627579, 8851251, 9430899, 20243811, 28391619, 37545291, 38242083, 49459179, 56550291, 88205211, 101931891, 103429491, 108060339, 135085851, 176962659, 183973851, 194907051, 196911171, 212874531, 249687699, 271986651
Offset: 1

Views

Author

Zak Seidov, May 29 2017

Keywords

Comments

The only prime number is 83.

Examples

			83=A034961(9)=A133529(2),
366819=A034961(11502)=A133529(69),
1055019=A034961(30105)=A133529(107),
1947411=A034961(52758)=A133529(139),
2740107=A034961(72260)=A133529(161),
3694179=A034961(95152)=A133529(185).
		

Crossrefs

Cf. A034961 Sums of three consecutive primes. A133529 Sum of squares of three consecutive primes.

Programs

  • Python
    from _future_ import division
    from sympy import prevprime, nextprime, isprime
    A287686_list, p2, q2, r2, r = [], 4, 9, 25, 5
    while r < 10**6:
        n = p2+q2+r2
        m = n//3
        pm, nm = prevprime(m), nextprime(m)
        k = n - pm - nm
        if isprime(m):
            if m == k:
                A287686_list.append(n)
        else:
            if nextprime(nm) == k or prevprime(pm) == k:
                A287686_list.append(n)
        s = nextprime(r)
        p2, q2, r2, r = q2, r2, s**2, s # Chai Wah Wu, May 30 2017

A034962 Primes that are the sum of three consecutive primes.

Original entry on oeis.org

23, 31, 41, 59, 71, 83, 97, 109, 131, 173, 199, 211, 223, 251, 269, 311, 349, 439, 457, 487, 503, 607, 661, 701, 829, 857, 883, 911, 941, 1033, 1049, 1061, 1151, 1187, 1229, 1249, 1303, 1367, 1381, 1409, 1433, 1493, 1511, 1553, 1667, 1867, 1931, 1973, 1993
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

Or, primes in A034961 (Sums of three consecutive primes). - Zak Seidov, Feb 16 2011

Examples

			E.g., 131 = 41 + 43 + 47.
A034962(n) = p+q+r, where p = A073681(n), and p<q<r are three consecutive primes. - _Zak Seidov_, Mar 09 2009
		

Crossrefs

Cf. A001043, A011974, A034707, A034961. Different from A050207.
Cf. A073681 (smallest of three consecutive primes whose sum is a prime).

Programs

  • Magma
    [a: n in [1..150] | IsPrime(a) where a is NthPrime(n)+NthPrime(n+1)+NthPrime(n+2)]; // Vincenzo Librandi, Jun 23 2016
    
  • Maple
    a:=proc(n) if isprime(ithprime(n)+ithprime(n+1)+ithprime(n+2))=true then ithprime(n)+ithprime(n+1)+ithprime(n+2) else fi end: seq(a(n), n=1..120); # Emeric Deutsch, Apr 24 2006
  • Mathematica
    a = {}; Do[k = Prime[x] + Prime[x + 1] + Prime[x + 2]; If[PrimeQ[k], AppendTo[a, k]], {x, 1, 350}]; a (* Artur Jasinski, Jan 27 2007 *)
    Select[(Plus@@@Partition[Prime[Range[200]],3,1]),PrimeQ] (* Zak Seidov, Feb 07 2012 *)
    Select[ListConvolve[{1,1,1},Prime[Range[200]]],PrimeQ] (* Harvey P. Dale, Jul 12 2013 *)
  • PARI
    forprime(p=2,1000, p2=nextprime(p+1); p3=nextprime(p2+1); q=p+p2+p3; if(isprime(q),print1(q",")) ) \\ Max Alekseyev, Jan 26 2007
    
  • PARI
    {p=2;q=3;for(n=1,100,r=nextprime(q+1); if(isprime(t=p+q+r),print1(t","));p=q;q=r;)} \\ Zak Seidov, Mar 09 2009
    
  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        p, q, r = 2, 3, 5
        while True:
            if isprime(p+q+r): yield p+q+r
            p, q, r = q, r, nextprime(r)
    print(list(islice(agen(), 50))) # Michael S. Branicky, Dec 27 2022

A054643 Primes prime(n) such that prime(n) + prime(n+1) + prime(n+2) == 0 (mod 3).

Original entry on oeis.org

3, 47, 151, 167, 199, 251, 257, 367, 503, 523, 557, 587, 601, 647, 727, 941, 971, 991, 1063, 1097, 1117, 1181, 1217, 1231, 1361, 1453, 1493, 1499, 1531, 1741, 1747, 1753, 1759, 1889, 1901, 1907, 2063, 2161, 2281, 2393, 2399, 2411, 2441, 2671, 2897, 2957
Offset: 1

Views

Author

Labos Elemer, May 15 2000

Keywords

Comments

The 2 differences of these 3 primes should be congruent of 6, except the first prime 3, for which 3 + 5 + 7 = 15 holds. Sequences like A047948, A052198 etc. are subsequences here.

Examples

			For prime(242) = 1531, the sum is 4623, the mean is 1541 and the successive differences are 6a=12 or 6b=6 resp.
		

Crossrefs

A122535 is a subsequence.
Cf. A075541 (for their indices).

Programs

  • Mathematica
    Select[Partition[Prime@ Range@ 430, 3, 1], Divisible[Total@ #, 3] &][[All, 1]] (* Michael De Vlieger, Jun 29 2017 *)

A031165 a(n) = prime(n+3) - prime(n).

Original entry on oeis.org

5, 8, 8, 10, 8, 10, 12, 12, 14, 12, 12, 10, 12, 16, 14, 14, 12, 12, 12, 12, 16, 18, 18, 14, 10, 8, 10, 20, 22, 24, 12, 18, 14, 18, 14, 16, 16, 16, 14, 18, 14, 16, 8, 18, 26, 28, 18, 10, 12, 12, 18, 18, 22, 18, 14, 14, 12, 12, 16, 26, 28, 20, 10, 20, 24, 30, 18, 16, 12
Offset: 1

Views

Author

Jeff Burch, Dec 11 1999

Keywords

Comments

Comments from Jonathan Vos Post, Jan 22 2006 (Start): This sequence is the k=3 case of the family of sequences a(k,n) = prime(n+k) - prime(n). See A001223 and A031131 for k = 1 and 2.
The records in this sequence give A115401. The minimal value, after the anomalous initial values (5, 8, 8), is 8 which occurs iff n is an element of A007530 (prime quadruples: numbers n such that n, n+2, n+6, n+8 are all prime). (End)

Examples

			a(1) = prime(4) - prime(1) = 7 - 2 = 5, which is the only odd element of this sequence.
a(2) = prime(5) - prime(2) = 11 - 3 = 8.
a(3) = prime(6) - prime(3) = 13 - 5 = 8.
a(4) = prime(7) - prime(4) = 17 - 7 = 10.
a(99) = prime(102) - prime(99) = 557 - 523 = 34. - _Jonathan Vos Post_, Jan 22 2006
		

Crossrefs

Programs

  • Haskell
    a031165 n = a031165_list !! (n-1)
    a031165_list = zipWith (-) (drop 3 a000040_list) a000040_list
    -- Reinhard Zumkeller, Aug 23 2015
  • Magma
    [NthPrime(n+3)-NthPrime(n): n in [1..100] ]; // Vincenzo Librandi, Apr 11 2011
    
  • Maple
    a:= n-> ithprime(n+3)-ithprime(n): seq (a(n), n=1..80);
  • Mathematica
    t = Array[Prime, 75]; Drop[t, 3] - Drop[t, -3] (* Robert G. Wilson v *)
    #[[4]]-#[[1]]&/@Partition[Prime[Range[80]],4,1] (* Harvey P. Dale, Nov 07 2021 *)
  • PARI
    p=2;q=3;r=5;forprime(s=7,1e3,print1(s-p", "); p=q;q=r;r=s) \\ Charles R Greathouse IV, Nov 07 2012
    

Formula

a(n) = prime(n+3) - prime(n). a(n) = A000040(n+3) - A000040(n). - Jonathan Vos Post, Jan 22 2006
a(n) = A034961(n+1) - A034961(n). - Zak Seidov, Nov 07 2012

Extensions

Edited by R. J. Mathar and N. J. A. Sloane, Aug 11 2008

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

A076304 Numbers k such that k^2 is a sum of three successive primes.

Original entry on oeis.org

7, 11, 29, 31, 43, 151, 157, 191, 209, 217, 221, 263, 311, 359, 367, 407, 493, 533, 563, 565, 637, 781, 815, 823, 841, 859, 881, 929, 959, 997, 1013, 1019, 1021, 1087, 1199, 1211, 1297, 1353, 1471, 1573, 1613, 1683, 1685, 1733, 1735, 1739, 1751, 1761, 1769
Offset: 1

Views

Author

Zak Seidov, Oct 05 2002

Keywords

Examples

			7 is in this sequence because 7^2 = 49 = p(6) + p(7) + p(8) = 13 + 17 + 19.
		

Crossrefs

Cf. A206279 (smallest of the 3 primes), A076305 (index of that prime), A080665 (squares = sums), A122560 (subsequence of primes).
Cf. A034961.

Programs

  • Mathematica
    Select[Table[Sqrt[Sum[Prime[k], {k, n, n + 2}]], {n, 100000}], IntegerQ] (* Ray Chandler, Sep 29 2006 *)
    Select[Sqrt[#]&/@(Total/@Partition[Prime[Range[90000]],3,1]),IntegerQ]  (* Harvey P. Dale, Feb 23 2011 *)
  • PARI
    is(n, p=precprime(n^2/3), q=nextprime(p+1), t=n^2-p-q)=isprime(t) && t==if(t>q,nextprime(q+1),precprime(p-1)) \\ Charles R Greathouse IV, May 26 2013; edited by M. F. Hasler, Jan 03 2020
    
  • PARI
    A76304=[7]; apply( A076304(n)={if(n>#A76304, my(i=#A76304, N=A76304[i]); A76304=concat(A76304, vector(n-i,i, until( is(N+=2),);N))); A76304[n]}, [1..99]) \\ M. F. Hasler, Jan 03 2020

Formula

a(n) = sqrt(prime(i) + prime(i+1) + prime(i+2)) where i = A076305(n). [Corrected by M. F. Hasler, Jan 03 2020]

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
Showing 1-10 of 53 results. Next