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-3 of 3 results.

A007467 Product of next n primes.

Original entry on oeis.org

2, 15, 1001, 215441, 95041567, 66238993967, 63009974049301, 87796770491685553, 173955570033393401009, 421385360593324054690769, 1172248885422611971256631487, 5253333091597988325086927419397, 21476254926032216698855019795863013
Offset: 1

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    terms=20;With[{prs=Prime[Range[(terms(terms+1))/2]]},Table[ Times@@ Take[prs,{(n(n-1))/2+1,(n(n+1))/2}],{n,terms}]] (* Harvey P. Dale, Aug 06 2013 *)
    With[{nn=40},Times@@@TakeList[Prime[Range[(nn(nn+1))/2]],Range[nn]]] (* Requires Mathematica version 11 or later *) (* Harvey P. Dale, Jan 15 2020 *)
  • PARI
    a(n)=my(s=1);forprime(p=prime(n*(n-1)/2+1),prime(n*(n+1)/2),s*=p);s \\ Charles R Greathouse IV, Aug 06 2013
    
  • Python
    from math import prod
    from sympy import prime
    def a(n): return prod(prime(i) for i in range((n-1)*n//2+1, n*(n+1)//2+1))
    print([a(n) for n in range(1, 14)]) # Michael S. Branicky, Feb 15 2021

Formula

From Amiram Eldar, Nov 15 2020: (Start)
Sum_{n>=1} 1/a(n) = A139395.
Sum_{n>=1} (-1)^(n+1)/a(n) = A238234 = 1 - A139396. (End)

Extensions

Corrected and extended by Harvey P. Dale, Aug 06 2013

A139395 Decimal expansion of the sum 1/p(1) + 1/(p(2)*p(3)) + 1/(p(4)*p(5)*p(6)) + ..., where p(n) is the n-th prime.

Original entry on oeis.org

5, 6, 7, 6, 7, 0, 3, 1, 9, 8, 4, 4, 5, 1, 9, 7, 2, 0, 8, 4, 0, 6, 9, 8, 2, 4, 2, 2, 9, 4, 2, 3, 2, 6, 7, 2, 5, 5, 8, 1, 1, 4, 8, 1, 3, 7, 3, 4, 6, 7, 3, 7, 8, 6, 3, 8, 3, 4, 2, 4, 9, 4, 7, 0, 5, 4, 8, 5, 8, 5, 1, 8, 7, 8, 5, 8, 7, 8, 4, 5, 9, 7, 3, 8, 2, 4, 3, 4, 1, 1, 9, 8, 1, 2, 1, 4, 3, 8, 3, 7
Offset: 0

Views

Author

Keywords

Comments

Absolute difference between this number and A139396 is about 0.002.

Examples

			0.56767031984451972084069824229423267255811481373467378638342..
		

Crossrefs

Cf. A139396.

Programs

  • Maple
    P:=proc(n) local a,b,i,j,k; a:=0.5; k:=1; for i from 2 by 1 to n do b:=1; for j from k by 1 to k+i-1 do b:=b*1/ithprime(j+1); od; k:=j; a:=evalf(a+b,105); od; print(a); end: P(100);
  • Mathematica
    With[{nn=100},RealDigits[Total[1/Times@@@TakeList[Prime[Range[(nn(nn+1))/2]],Range[nn]]],10,120][[1]]] (* Harvey P. Dale, Dec 20 2024 *)

A238234 Decimal expansion of the alternating sum 1/p(1) - 1/(p(2)*p(3)) + 1/(p(4)*p(5)*p(6)) - 1/(p(7)*p(8)*p(9)*p(10)) + ..., where p(n) is the n-th prime.

Original entry on oeis.org

4, 3, 4, 3, 2, 7, 7, 0, 3, 1, 9, 6, 9, 3, 8, 1, 0, 2, 2, 9, 6, 1, 5, 7, 5, 1, 3, 0, 2, 4, 8, 3, 7, 2, 3, 6, 7, 4, 2, 7, 9, 1, 3, 8, 9, 2, 7, 7, 1, 9, 6, 7, 7, 9, 3, 8, 5, 5, 2, 6, 0, 1, 4, 1, 4, 4, 2, 1, 1, 5, 0, 5, 4, 1, 6, 0, 9, 4, 6, 8, 0, 4, 0, 7, 3, 8, 9, 6, 1, 9, 8, 6, 8, 6, 1, 4, 2, 9, 1, 5, 2, 7, 8, 5, 7
Offset: 0

Views

Author

Paolo P. Lava, Feb 27 2014 - following a suggestion of Jean-François Alcover

Keywords

Comments

Absolute difference between this number and A139395 is about 0.1333426...

Examples

			0.4343277031969381022961575130248372367427913892771967793855...
		

Crossrefs

Programs

  • Maple
    P:=proc(n) local a, b, i, j, k; a:=0.5; k:=1; for i from 2 by 1 to n do b:=1; for j from k by 1 to k+i-1 do b:=b*1/ithprime(j+1); od; k:=j; a:=evalf(a+b*(-1)^(i-1), 105); od; print(a); end: P(100);
  • Mathematica
    digits = 105; n0 = 10; dn = 10; t[n_] := n*(n + 1)/2; Clear[p]; p[n_] := p[n] = Sum[(-1)^(k + 1)/Product[Prime[j], {j, t[k] - k + 1, t[k]}], {k, 1, n}] // N[#, digits] &; p[n0]; p[n = n0 + dn]; While[RealDigits[p[n]] != RealDigits[p[n - dn]], Print["n = ", n]; n = n + dn]; RealDigits[p[n], 10, digits] // First (* Jean-François Alcover, Aug 12 2014, adapted from PARI *)
  • PARI
    default(realprecision, 120);
    T(n) = n*(n + 1)/2; \\ T(n) = A000217(n).
    sum(k = 1, 100, (-1.)^(k-1)/prod(j = T(k) - k + 1, T(k), prime(j))) \\ Rick L. Shepherd, Mar 07 2014

Extensions

More terms from and offset corrected by Rick L. Shepherd, Mar 07 2014
Showing 1-3 of 3 results.