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

A127345 a(n) = pq + pr + qr with p = prime(n), q = prime(n+1), and r = prime(n+2).

Original entry on oeis.org

31, 71, 167, 311, 551, 791, 1151, 1655, 2279, 3119, 3935, 4871, 5711, 6791, 8391, 9959, 11639, 13175, 14831, 16559, 18383, 20975, 24071, 27419, 30191, 32231, 33911, 36071, 40511, 45791, 51983, 55199, 60167, 64199, 69599, 73911, 79031, 84311
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

a(n) = coefficient of x^1 of the polynomial Product_{j=0..2} (x-prime(n+j)) of degree 3; the roots of this polynomial are prime(n), ..., prime(n+2); cf. Vieta's formulas.
Arithmetic derivative (see A003415) of prime(n)*prime(n+1)*prime(n+2). [Giorgio Balzarotti, May 26 2011]

Crossrefs

Programs

  • Mathematica
    Table[Prime[n]*Prime[n+1] + Prime[n]*Prime[n+2] + Prime[n+1]*Prime[n+2], {n, 100}]
    Total[Times@@@Subsets[#,{2}]]&/@Partition[Prime[Range[40]],3,1] (* Harvey P. Dale, Sep 11 2017 *)
  • PARI
    {m=38;k=2;for(n=1,m,print1(sum(i=n,n+k-1,sum(j=i+1,n+k,prime(i)*prime(j))),","))} \\ Klaus Brockhaus, Jan 21 2007
    
  • PARI
    {m=38;k=2;for(n=1,m,print1(polcoeff(prod(j=0,k,(x-prime(n+j))),1),","))} \\ Klaus Brockhaus, Jan 21 2007
    
  • PARI
    p=2;q=3;forprime(r=5,1e3,print1(p*q+p*r+q*r", ");p=q;q=r) \\ Charles R Greathouse IV, Jan 13 2012

Extensions

Edited by Klaus Brockhaus, Jan 21 2007

A127346 Primes in A127345.

Original entry on oeis.org

31, 71, 167, 311, 1151, 3119, 4871, 5711, 6791, 14831, 24071, 33911, 60167, 79031, 101159, 106367, 115631, 158231, 235751, 259751, 366791, 402551, 455471, 565919, 635711, 644951, 1124831, 1347971, 1510799, 1547927, 1743419, 1851671, 2048471
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

Primes of the form prime(k)*prime(k+1) + prime(k)*prime(k+2) + prime(k+1)*prime(k+2).
A prime number n is in the sequence if for some k it is the coefficient of x^1 of the polynomial Product_{j=0..2} (x-prime(k+j)); the roots of this polynomial are prime(k), ..., prime(k+2).

Crossrefs

Programs

  • Mathematica
    b = {}; a = {}; Do[If[PrimeQ[Prime[x] Prime[x + 1] + Prime[x] Prime[x + 2] + Prime[x + 1] Prime[x + 2]], AppendTo[a, Prime[x] Prime[x + 1] + Prime[x] Prime[x + 2] + Prime[x + 1] Prime[x + 2]], AppendTo[b, Prime[x] Prime[x + 1] + Prime[x] Prime[x + 2] + Prime[x + 1] Prime[x + 2]]], {x, 1, 100}]; Print[a] (* Artur Jasinski, Jan 11 2007 *)
    s[li_] := li[[1]]*(li[[2]]+li[[3]])+li[[2]]*li[[3]]; Select[(s[#]&/@Partition[Prime[Range[100]], 3, 1]), PrimeQ] (* Zak Seidov, Jan 13 2012 *)
  • PARI
    {m=143;k=2;for(n=1,m,a=sum(i=n,n+k-1,sum(j=i+1,n+k,prime(i)*prime(j)));if(isprime(a),print1(a,",")))} \\ Klaus Brockhaus, Jan 21 2007
    
  • PARI
    {m=143;k=2;for(n=1,m,a=polcoeff(prod(j=0,k,(x-prime(n+j))),1);if(isprime(a),print1(a,",")))} \\ Klaus Brockhaus, Jan 21 2007
    
  • PARI
    p=2; q=3; forprime(r=5, 1e3, if(isprime(t=p*q+p*r+q*r), print1(t", ")); p=q; q=r) \\ Charles R Greathouse IV, Jan 13 2012

Formula

a(n) = A127345(A204231(n)). - Zak Seidov, Jan 13 2012

Extensions

Edited and extended by Klaus Brockhaus, Jan 21 2007

A127351 Prime numbers n such that A127350(k) = 2*n for some k.

Original entry on oeis.org

2003, 7883, 31151, 35363, 394739, 434939, 541007, 564983, 837929, 865979, 2453999, 2680493, 3479303, 3536219, 4145717, 4367267, 4706311, 5414159, 6541103, 6856019, 8804231, 9109223, 10227323, 10296059, 10701683, 10795507
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

Primes of the form (Sum_{i=k..k+3}Sum_{j=i+1..k+4}prime(i)*prime(j))/2.
Primes of the form a/2 where a is the coefficient of x^3 of the polynomial Prod_{j=0,4}(x-prime(k+j)) for some k.

Crossrefs

Programs

  • Mathematica
    a = {}; Do[If[PrimeQ[(Prime[x] Prime[x + 1] + Prime[x] Prime[x + 2] + Prime[x] Prime[x + 3] + Prime[x] Prime[x + 4] + Prime[x + 1] Prime[x + 2] + Prime[x + 1] Prime[x + 3] + Prime[x + 1] Prime[x + 4] + Prime[x + 2] Prime[x + 3] + Prime[x + 2] Prime[x + 4] + Prime[x + 3] Prime[x + 4])/2], AppendTo[a, (Prime[x] Prime[x + 1] + Prime[x] Prime[x + 2] + Prime[x] Prime[x + 3] + Prime[x] Prime[x + 4] + Prime[x + 1] Prime[x + 2] + Prime[x + 1] Prime[x + 3] + Prime[x + 1] Prime[x + 4] + Prime[x + 2] Prime[x + 3] + Prime[x + 2] Prime[x + 4] + Prime[x + 3] Prime[x + 4])/2]], {x, 1, 1000}]; a
  • PARI
    {m=235;k=4;for(n=1,m,a=sum(i=n,n+k-1,sum(j=i+1,n+k,prime(i)*prime(j)));if(isprime(b=a/2),print1(b,",")))} \\ Klaus Brockhaus, Jan 21 2007
    
  • PARI
    {m=235;k=4;for(n=1,m,a=polcoeff(prod(j=0,k,(x-prime(n+j))),3);if(isprime(b=a/2),print1(b,",")))} \\ Klaus Brockhaus, Jan 21 2007

Extensions

Edited by Klaus Brockhaus, Jan 21 2007

A127349 a(n) = Sum_{i=n..n+1} Sum_{j=i+1..n+2} Sum_{k=j+1..n+3} prime(i)*prime(j)*prime(k).

Original entry on oeis.org

247, 886, 2556, 6288, 12900, 22392, 40808, 63978, 105000, 161142, 216232, 294168, 385544, 507782, 658820, 858000, 1067502, 1251952, 1518910, 1783854, 2114748, 2618148, 3147710, 3696090, 4239528, 4626300, 5033232, 5898936, 6871200
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

a(n) = absolute value of the coefficient of x^1 of the polynomial Product_{j=0..3} (x - prime(n+j)) of degree 4; the roots of this polynomial are prime(n), ..., prime(n+3); cf. Vieta's formulas.
All terms with exception of the first one are even.
Arithmetic derivative (see A003415) of prime(n)*prime(n+1)*prime(n+2)*prime(n+3). - Giorgio Balzarotti, May 26 2011

Crossrefs

Programs

  • Magma
    [NthPrime(n)*NthPrime(n+1)*NthPrime(n+2) + NthPrime(n)*NthPrime(n+2)*NthPrime(n+3) + NthPrime(n)*NthPrime(n+1)* NthPrime(n+3) + NthPrime(n+1)*NthPrime(n+2)*NthPrime(n+3): n in [1..30]]; // Vincenzo Librandi, Feb 12 2018
  • Maple
    P := select(isprime, [2, seq(i, i = 1 .. 1000, 2)]):
    f := L) -> convert(L, `*`)*add(1/t, t = L):
    seq(f(P[i..i+3]),i=1..nops(P)-3); # Robert Israel, Feb 11 2018
  • Mathematica
    Table[Prime[n] Prime[n+1] Prime[n+2] + Prime[n] Prime[n+2] Prime[n+3] + Prime[n] Prime[n+1] Prime[n+3] + Prime[n+1] Prime[n+2] Prime[n+3], {n, 100}]
  • PARI
    {m=29;h=3;for(n=1,m,print1(sum(i=n,n+h-2,sum(j=i+1,n+h-1,sum(k=j+1,n+h,prime(i)*prime(j)*prime(k)))),","))} \\ Klaus Brockhaus, Jan 21 2007
    
  • PARI
    {m=29;k=3;for(n=1,m,print1(abs(polcoeff(prod(j=0,k,(x-prime(n+j))),1)),","))} \\ Klaus Brockhaus, Jan 21 2007
    

Formula

a(n) = A046302(n)*Sum_{i=n..n+3} 1/prime(i). - Robert Israel, Feb 11 2018

Extensions

Edited by Klaus Brockhaus, Jan 21 2007

A127348 Coefficient of x^2 in the polynomial (x-p(n))*(x-p(n+1))*(x-p(n+2))*(x-p(n+3)), where p(k) is the k-th prime.

Original entry on oeis.org

101, 236, 466, 838, 1330, 1918, 2862, 3856, 5350, 7096, 8622, 10558, 12654, 15228, 18090, 21550, 24916, 27702, 31500, 35068, 39298, 45322, 51240, 56980, 62398, 66130, 69958, 77854, 86230, 96618, 106888, 115842, 124342, 133122, 144090, 152568, 163282, 174348
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Examples

			a(1)=101 because (x-2)*(x-3)*(x-5)*(x-7) = x^4 - 17x^3 + 101x^2 - 247x + 210.
		

Crossrefs

Programs

  • Maple
    a:=n->coeff(expand((x-ithprime(n))*(x-ithprime(n+1))*(x-ithprime(n+2))*(x-ithprime(n+3))),x,2): seq(a(n),n=1..45); # Emeric Deutsch, Jan 20 2007
  • Mathematica
    Table[Prime[x] Prime[x + 1] + Prime[x] Prime[x + 2] + Prime[x] Prime[x + 3] + Prime[x + 1] Prime[x + 2] + Prime[x + 1] Prime[x + 3] + Prime[x + 2] Prime[x + 3], {x, 1, 100}]
    Total[Times@@@Subsets[#,{2}]]&/@Partition[Prime[Range[40]],4,1] (* Harvey P. Dale, Apr 15 2019 *)
  • PARI
    {m=35;k=3;for(n=1,m,print1(sum(i=n,n+k-1,sum(j=i+1,n+k,prime(i)*prime(j))),","))} \\ Klaus Brockhaus, Jan 21 2007
    
  • PARI
    {m=35;k=3;for(n=1,m,print1(abs(polcoeff(prod(j=0,k,(x-prime(n+j))),2)),","))} \\ Klaus Brockhaus, Jan 21 2007

Formula

a(n) = p(n)*p(n+1) + p(n)*p(n+2) + p(n)*p(n+3) + p(n+1)*p(n+2) + p(n+1)*p(n+3) + p(n+2)*p(n+3), where p(k) is the k-th prime (by Viete's formula relating the zeros and the coefficients of a polynomial). - Emeric Deutsch, Jan 20 2007

Extensions

Edited by Emeric Deutsch and Klaus Brockhaus, Jan 20 2007

A082244 Smallest odd prime that is the sum of 2n+1 consecutive primes.

Original entry on oeis.org

3, 23, 53, 197, 127, 233, 691, 379, 499, 857, 953, 1151, 1259, 1583, 2099, 2399, 2417, 2579, 2909, 3803, 3821, 4217, 4651, 5107, 5813, 6829, 6079, 6599, 14153, 10091, 8273, 10163, 9521, 12281, 13043, 11597, 12713, 13099, 16763, 15527, 16823, 22741
Offset: 0

Views

Author

Cino Hilliard, May 09 2003

Keywords

Examples

			For n = 2,
2+3+5+7+11=28
3+5+7+11+13=39
5+7+11+13+17=53
so 53 is the first prime that is the sum of 5 consecutive primes
		

Crossrefs

See A070934 for another version.

Programs

  • Maple
    P:= select(isprime, [seq(i,i=3..3000,2)]):
    S:= [0,op(ListTools:-PartialSums(P))]: nS:= nops(S):
    R:= NULL:
    for n from 1 do
      found:= false;
      for j from 1 to nS - 2*n + 1 while not found do
        v:= S[j+2*n-1]-S[j];
        if isprime(v) then R:= R,v; found:= true fi
      od;
      if not found then break fi;
    od:
    R; # Robert Israel, Jan 09 2025
  • Mathematica
    Join[{3},Table[SelectFirst[Total/@Partition[Prime[Range[1000]],2n+1,1],PrimeQ],{n,50}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 15 2016 *)
  • PARI
    \\ First prime that the sum of an odd number of consecutive primes
    psumprm(n) = { sr=0; forstep(i=1,n,2, s=0; for(j=1,i, s+=prime(j); ); for(x=1,n, s = s - prime(x)+ prime(x+i); if(isprime(s),sr+=1.0/s; print1(s" "); break); ); ); print(); print(sr) }

Formula

The sum of the reciprocals = 0.4304...

A089793 a(n) = the first prime in the earliest chain of 2n+1 consecutive primes whose sum is prime.

Original entry on oeis.org

2, 5, 5, 17, 3, 5, 29, 3, 3, 11, 7, 7, 5, 7, 13, 13, 7, 5, 5, 13, 7, 7, 7, 7, 11, 17, 3, 3, 97, 29, 3, 13, 3, 19, 19, 3, 5, 3, 23, 7, 11, 53, 31, 89, 53, 19, 11, 3, 17, 23, 83, 11, 5, 47, 37, 5, 17, 3, 3, 29, 23, 5, 5, 5, 59, 7, 7, 31, 3, 67, 3, 3, 89, 71, 31
Offset: 0

Views

Author

Joseph L. Pe, Jan 09 2004

Keywords

Comments

In general (except possibly when it begins with 2), the sum of an even number of consecutive primes is even - hence the restriction to odd chain lengths.

Examples

			17 is the first prime in the chain 17, 19, 23, 29, 31, 37, 41, which is the earliest chain of 2 * 3 + 1 = 7 consecutive primes whose sum, 197, is prime. Hence a(3) = 17.
		

Crossrefs

Programs

  • Mathematica
    With[{prs=Prime[Range[1000]]},First[#]&/@Flatten[Table[Select[ Partition[ prs,2n+1,1],PrimeQ[Total[#]]&,1],{n,0,80}],1]] (* Harvey P. Dale, Jun 21 2013 *)

A127350 a(n) = Sum_{i=n..n+3} Sum_{j=i+1..n+4} prime(i)*prime(j).

Original entry on oeis.org

288, 574, 1078, 1750, 2710, 4006, 5590, 7630, 10270, 13030, 15766, 19462, 23510, 27550, 32830, 38590, 43750, 49190, 55570, 62302, 70726, 80470, 89350, 98710, 106870, 113590, 124822, 137590, 151990, 167230, 186454, 199798, 214774, 230270, 247630, 262942, 281422
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

a(n) = absolute value of the coefficient of x^3 of the polynomial Prod_{j=0,4}(x-prime(n+j)) of degree 5; the roots of this polynomial are prime(n), ..., prime(n+4); cf. Vieta's formulas.
All terms are even.

Crossrefs

Programs

  • Mathematica
    Table[Prime[x] Prime[x + 1] + Prime[x] Prime[x + 2] + Prime[x] Prime[x + 3] + Prime[x] Prime[x + 4] + Prime[x + 1] Prime[x + 2] + Prime[x + 1] Prime[x + 3] + Prime[x + 1] Prime[x + 4] + Prime[x + 2] Prime[x + 3] + Prime[x + 2] Prime[x + 4] + Prime[x + 3] Prime[x + 4], {x, 1, 100}]
  • PARI
    {m=34;k=4;for(n=1,m,print1(sum(i=n,n+k-1,sum(j=i+1,n+k,prime(i)*prime(j))),","))} \\ Klaus Brockhaus, Jan 21 2007
    
  • PARI
    {m=34;k=4;for(n=1,m,print1(abs(polcoeff(prod(j=0,k,(x-prime(n+j))),3)),","))} \\ Klaus Brockhaus, Jan 21 2007

Extensions

Edited by Klaus Brockhaus, Jan 21 2007

A122706 Smallest prime p such that p^n is equal to the sum of 3 consecutive primes.

Original entry on oeis.org

23, 7, 11, 29, 79, 29, 509, 53, 467, 1571, 61, 7, 1553, 31, 1097, 11, 397, 11, 163, 677, 23, 103, 1723, 11, 1759, 67, 433, 149, 919, 2879, 293, 9907, 1103, 1153, 179, 6199, 2683, 1877, 4373, 4679, 953, 2341, 8069, 3779, 3691, 28463, 991, 1061, 2447, 5471
Offset: 1

Views

Author

Alexander Adamchuk, Sep 24 2006

Keywords

Comments

Corresponding numbers k such that a(n)^n = p(k) + p(k+1) + p(k+2) are given by A157197.
It is not known if a(n) exists for all n.

Examples

			a(1) = 23 because A070934(1) = p(3) + p(4) + p(5) = 5 + 7 + 11 = 23 is prime, but p(1) + p(2) + p(3) = 2 + 3 + 5 = 10 is composite and p(2) + p(3) + p(4) = 3 + 5 + 7 = 15 is composite.
a(2) = 7 because A122654(1) = 7 is prime and p(6) + p(7) + p(8) = 13 + 17 + 19 = 49 = 7^2, but p(k) + p(k+1) + p(k+2) are not squares for 0 < k < 6.
		

Crossrefs

Programs

  • Mathematica
    PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; f[n_] := Block[{p = If[n < 2, 5, 3]}, While[r = PrevPrim@ Floor[p^n/3]; q = PrevPrim@r; s = NextPrim@r; t = NextPrim@s; p^n != q + r + s && p^n != r + s + t, p = NextPrim@p]; p]; Array[f, 50] (* Robert G. Wilson v *)

Formula

For m = (p^n)/3 (not an integer), if q,r are largest primes and s,t are smallest primes such that q < r < m < s < t, then p^n must equal either q+r+s or r+s+t. - Robert G. Wilson v

Extensions

a(5)-a(50) from Robert G. Wilson v, Sep 26 2006

A215235 Least number k such that the sum of the 2n+1 consecutive primes starting with prime(k) is prime.

Original entry on oeis.org

1, 3, 3, 7, 2, 3, 10, 2, 2, 5, 4, 4, 3, 4, 6, 6, 4, 3, 3, 6, 4, 4, 4, 4, 5, 7, 2, 2, 25, 10, 2, 6, 2, 8, 8, 2, 3, 2, 9, 4, 5, 16, 11, 24, 16, 8, 5, 2, 7, 9, 23, 5, 3, 15, 12, 3, 7, 2, 2, 10, 9, 3, 3, 3, 17, 4, 4, 11, 2, 19, 2, 2, 24, 20, 11, 13, 10, 2, 7, 5, 4
Offset: 0

Views

Author

T. D. Noe, Aug 29 2012

Keywords

Comments

The sums are in A070934. The initial primes are in A089793.

Crossrefs

Showing 1-10 of 17 results. Next