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

A154956 Pierce expansion of 2/Pi.

Original entry on oeis.org

1, 2, 3, 5, 10, 71, 868, 1788, 7455, 44266, 54626, 74153, 224166, 390471, 1489304, 3737961, 22277163, 37201631, 113275744, 165029426, 2642368758, 3362202939, 5191046363, 8438525012, 36226438506, 40174126779, 125336047846, 531802867080, 599020778171
Offset: 0

Views

Author

Jaume Oliver Lafont, Jan 18 2009

Keywords

Examples

			1 - 1/2(1 - 1/3(1 - 1/5(1 - 1/10(1 - 1/71)))) = 2/(355/113).
		

Crossrefs

Cf. A006283 (1/Pi), A061233 (4 - Pi).
Cf. A060294 (decimal expansion of 2/Pi). - R. J. Mathar, Jan 21 2009

Programs

  • Maple
    Digits := 300: Pierce := proc(x) local resid,a,i,an ; resid := x ; a := [] ; for i from 1 do an := floor(1./resid) ; a := [op(a),an] ; resid := evalf(1.-an*resid) ; if ilog10( mul(i,i=a)) > 0.7*Digits then break ; fi ; od: RETURN(a) ; end: a060294 := evalf(2/Pi) ; Pierce(a060294) ; # R. J. Mathar, Jan 21 2009
  • Mathematica
    PierceExp[A_, n_] := Join[Array[1 &, Floor[A]], First@Transpose@ NestList[{Floor[1/Expand[1 - #[[1]] #[[2]]]], Expand[1 - #[[1]] #[[2]]]} &, {Floor[1/(A - Floor[A])], A - Floor[A]}, n - 1]]; PierceExp[N[2/Pi, 7!], 50] (* G. C. Greubel, Nov 13 2016 *)
  • PARI
    A154956(N=99)={localprec(N); my(c=2/Pi, d=c+c/10^N, a=[1\c]); while(a[#a]==1\d&&c=1-c*a[#a], d=1-d*a[#a]; a=concat(a, 1\c)); a[^-1]}  \\ The optional argument is the precision used, approx. equal to the total number of digits in the result. - M. F. Hasler, Jul 04 2016

Extensions

More terms from R. J. Mathar, Jan 21 2009
Offset in b-file corrected by N. J. A. Sloane, Aug 31 2009

A232327 A generalized Engel expansion of 1/Pi.

Original entry on oeis.org

3, 23, 27, 89, 137, 9190, 25731, 80457, 125859, 270815, 609977, 959612, 1034186, 1491489, 2975032, 264484387, 1092196976, 1194228023, 1424193547, 4523998315, 13583506006, 380693793416, 1097951708621, 1486580651232
Offset: 0

Views

Author

Peter Bala, Nov 27 2013

Keywords

Comments

The Engel expansion of 1/Pi is given in A014012 and the Pierce (or alternating Engel) expansion of 1/Pi is found in A006283.
We can unify the algorithms for finding the Engel and Pierce expansions of a real number as follows.
Define the map f:[-1,1]\{0} -> (-1/2,1) by f(x) = x*ceiling(1/x) - 1 and let f^(n)(x) denote the n-th iterate of f, with the convention that f^(0)(x) = x. Let r be a real number such that 0 < r < 1.
Then the sequence of positive integers e(n) := ceiling(1/f^(n)(r)) is the Engel expansion of r. The associated Engel series representation is r = 1/e(0) + 1/(e(0)*e(1)) + 1/(e(0)*e(1)*e(2)) + ....
The sequence of positive integers p(n) := |ceiling(1/f^(n)(-r))| is the Pierce expansion of r. The associated Pierce series representation is r = 1/p(0) - 1/(p(0)*p(1)) + 1/(p(0)*p(1)*p(2)) - ....
By working with a modification of the map f we can find two generalized Engel-type expansions for the real number r (still assuming 0 < r < 1). To this end, we define the map g:[-1,1]\{0} -> (-1/2,1) by g(x) = -x*ceiling(-1/x) - 1 and let g^(n)(x) denote the n-th iterate of g, with the convention that g^(0)(x) = x.
A)
Our first generalized expansion of r is the integer sequence a(n) := |ceiling(1/g^(n)(r))| for n >= 0 and until g^n(r) = 0. It can be shown that we have a generalized Engel-type representation for r by means of the (possibly infinite) series r = 1/a(0) - 1/(a(0)*a(1)) - 1/(a(0)*a(1)*a(2)) + 1/(a(0)*a(1)*a(2)*a(3)) + 1/(a(0)*a(1)*a(2)*a(3)*a(4)) - - + + ..., where the pattern of signs of the terms is as indicated.
The series will be finite if and only if r is rational.
The present sequence is an example of this first type of generalized Engel expansion for the real number r := 1/Pi.
B)
The second generalized Engel expansion of r is defined as the sequence of integers b(n) := |ceiling(1/g^(n)(-r))| for n >= 0 and until g^(n)(-r) = 0.
It can be shown that we now have a generalized Engel-type representation for r of the form r = 1/b(0) + 1/(b(0)*b(1)) - 1/(b(0)*b(1)*b(2)) - 1/(b(0)*b(1)*b(2)*b(3)) + + - - ....
Again, the series terminates when r is rational, otherwise it is infinite.
See A232328 for the generalized Engel expansion of 1/Pi of the second kind.
We can generalize the Engel and Pierce expansions of a real number even further by considering series expansions to a base b. See A232325 for a definition and details. The usual Engel and Pierce expansions occur when the base b = 1 and the two generalized Engel expansions described above arise when the base b = -1.

Examples

			Comparison of the Engel, alternating Engel and generalized Engel series expansions for 1/Pi.
A014012: Engel series expansion
1/Pi = 1/4 + 1/(4*4) + 1/(4*4*11) + 1/(4*4*11*45) + 1/(4*4*11*45*70) + ...
A006283: Alternating Engel series expansion
1/Pi = 1/3 - 1/(3*22) + 1/(3*22*118) - 1/(3*22*118*383) + 1/(3*22*118*83*571) - ...
A232327: Generalized Engel series expansion of the first kind
1/Pi = 1/3 - 1/(3*23) - 1/(3*23*27) + 1/(3*23*27*89) + 1/(3*23*27*89*137) - - + + ....
A232328: Generalized Engel series expansion of the second kind
1/Pi = 1/4 + 1/(4*3) - 1/(4*3*6) - 1/(4*3*6*12) + 1/(4*3*6*12*51) + 1/(4*3*6*12*51*146) - - + + ...
		

Crossrefs

Programs

  • Maple
    #A232327
    #Define the n-th iterate of the map f(x) = x/b*ceiling(b/x) - 1
    map_iterate := proc(n,b,x) option remember;
    if n = 0 then
       x
    else
       -1 + 1/b*thisproc(n-1,b,x)*ceil(b/thisproc(n-1,b,x))
    end if
    end proc:
    #Define the terms of the expansion of x to the base b
    a := n -> ceil(evalf(b/map_iterate(n,b,x))):
    Digits := 500:
    #Choose values for x and b
    x := 1/Pi: b:= -1:
    seq(abs(a(n)), n = 0..25);

Formula

a(n) = ceiling(1/g^(n)(1/Pi)), where g(x) = -x*ceiling(-1/x) - 1.
Generalized Engel series expansion:
1/Pi = 1/3 - 1/(3*23) - 1/(3*23*27) + 1/(3*23*27*89) + 1/(3*23*27*89*137) - - + +.

A232328 A generalized Engel expansion of 1/Pi.

Original entry on oeis.org

4, 3, 6, 12, 51, 146, 280, 482, 687, 3825, 5646, 30904, 120121, 1344923, 2340376, 4456271, 194324055, 219784933, 976224357, 11584437417, 26402463827, 34635051144, 85031207055, 95014277980, 257962314442
Offset: 0

Views

Author

Peter Bala, Nov 27 2013

Keywords

Comments

For a description of two kinds of generalized Engel expansion of a real number see A232327. Compare with A006283 and A014012.

Crossrefs

Programs

  • Maple
    #A232328
    #Define the n-th iterate of the map f(x) = x/b*ceiling(b/x) - 1
    map_iterate := proc(n,b,x) option remember;
    if n = 0 then
       x
    else
       -1 + 1/b*thisproc(n-1,b,x)*ceil(b/thisproc(n-1,b,x))
    end if
    end proc:
    #Define the terms of the expansion of x to the base b
    a := n -> ceil(evalf(b/map_iterate(n,b,x))):
    Digits:= 500:
    #Choose values for x and b
    x := -1/Pi: b:= -1:
    seq(abs(a(n)), n = 0..24);

Formula

Define the map g(x) by g(x) = -x*ceiling(-1/x) - 1 and let g^n(x) denote the n-th iterate of g, with the convention that g^0(x) = x. Then a(n) = |ceiling(1/g^n(-1/Pi))| for n >= 0.
Generalized Engel series expansion: 1/Pi = 1/4 + 1/(4*3) - 1/(4*3*6) - 1/(4*3*6*12) + 1/(4*3*6*12*51) + 1/(4*3*6*12*51*146) - - + +.

A006284 Pierce expansion for Euler's constant.

Original entry on oeis.org

1, 2, 6, 13, 21, 24, 225, 615, 17450, 23228, 57774, 221361, 522377, 793040, 1706305, 8664354, 19037086, 51965160, 56870701, 124645388, 784244500, 792809072, 3675221276, 42108268014, 53633289500, 56827261536, 67080647365
Offset: 0

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
    PierceExp[A_, n_] := Join[Array[1 &, Floor[A]], First@Transpose@ NestList[{Floor[1/Expand[1 - #[[1]] #[[2]]]], Expand[1 - #[[1]] #[[2]]]} &, {Floor[1/(A - Floor[A])], A - Floor[A]}, n - 1]]; PierceExp[N[EulerGamma, 7!], 25] (* G. C. Greubel, Nov 14 2016 *)
  • PARI
    r=1/Euler;for(n=1,30,r=r/(r-floor(r));print1(floor(r),","))

Formula

If u(0) = exp(1/m), where m is an integer >=1, and u(n+1) = u(n)/frac(u(n)) then floor(u(n)) = m*n. Let u(0)=1/gamma and u(n+1) = u(n)/frac(u(n)) where frac(x) is the fractional part of x, then a(n) = floor(u(n)) - Benoit Cloitre, Mar 09 2004

A091831 Pierce expansion of 1/sqrt(2).

Original entry on oeis.org

1, 3, 8, 33, 35, 39201, 39203, 60245508192801, 60245508192803, 218662352649181293830957829984632156775201, 218662352649181293830957829984632156775203
Offset: 0

Views

Author

Benoit Cloitre, Mar 09 2004

Keywords

Comments

If u(0)=exp(1/m) m integer>1 and u(n+1)=u(n)/frac(u(n)) then floor(u(n))=m*n.

Crossrefs

Cf. A006784 (Pierce expansion definition), A028254

Programs

  • Mathematica
    PierceExp[A_, n_] := Join[Array[1 &, Floor[A]], First@Transpose@ NestList[{Floor[1/Expand[1 - #[[1]] #[[2]]]], Expand[1 - #[[1]] #[[2]]]} &, {Floor[1/(A - Floor[A])], A - Floor[A]}, n - 1]]; PierceExp[N[2^(-1/2), 7!], 17] (* G. C. Greubel, Nov 13 2016 *)
  • PARI
    r=sqrt(2);for(n=1,10,r=r/(r-floor(r));print1(floor(r),","))

Formula

Let u(0)=sqrt(2) and u(n+1)=u(n)/frac(u(n)) where frac(x) is the fractional part of x, then a(n)=floor(u(n)).
1/sqrt(2)= 1/a(1) - 1/a(1)/a(2) + 1/a(1)/a(2)/a(3) - 1/a(1)/a(2)/a(3)/a(4)...
limit n -> infinity a(n)^(1/n) = e.

A091832 Pierce expansion of 1/e^2.

Original entry on oeis.org

7, 18, 19, 136, 349, 357, 1354, 6996, 7135, 9531, 11558, 15996, 17432, 52118, 151048, 427802, 821834, 877819, 972918, 1046690, 1540789, 3653077, 8200738, 9628573, 164153335, 5607624822, 86457467082, 141885251873, 151882622551
Offset: 1

Views

Author

Benoit Cloitre, Mar 09 2004

Keywords

Comments

If u(0) = exp(1/m) with m an integer >= 1 and u(n+1) = u(n)/frac(u(n)) then floor(u(n)) = m*n.

Crossrefs

Cf. A006784 (Pierce expansion definition), A059194.

Programs

  • Mathematica
    PierceExp[A_, n_] := Join[Array[1 &, Floor[A]], First@Transpose@ NestList[{Floor[1/Expand[1 - #[[1]] #[[2]]]], Expand[1 - #[[1]] #[[2]]]} &, {Floor[1/(A - Floor[A])], A - Floor[A]}, n - 1]]; PierceExp[N[1/E^2, 7!], 15] (* G. C. Greubel, Nov 14 2016 *)
  • PARI
    default(realprecision, 100000); r=exp(2); for(n=1, 100, s=(r/(r-floor(r))); print1(floor(r), ", "); r=s) \\ Benoit Cloitre [amended by Georg Fischer, Nov 20 2020]

Formula

Let u(0) = exp(2) and u(n+1) = u(n)/frac(u(n)) where frac(x) is the fractional part of x, then a(n) = floor(u(n)).
1/e^2 = 1/a(1) - 1/(a(1)*a(2)) + 1/(a(1)*a(2)*a(3)) - 1/(a(1)*a(2)*a(3)*a(4)) ...
Limit_{n->oo} a(n)^(1/n) = e.

Extensions

a(1)=7 inserted by Georg Fischer, Nov 20 2020

A091833 Pierce expansion of 1/zeta(2).

Original entry on oeis.org

1, 2, 4, 7, 22, 29, 51, 173, 210, 262, 417, 746, 12341, 207220, 498538, 1286415, 2351289, 3702952, 7664494, 54693034, 75971438, 269954954, 6674693008, 13449203581, 59799655308, 98912303039, 948887634688, 3557757020909, 5898230078743
Offset: 1

Views

Author

Benoit Cloitre, Mar 09 2004

Keywords

Comments

If u(0) = exp(1/m), m integer >= 1, and u(n+1) = u(n)/frac(u(n)) then floor(u(n)) = m*n.

Crossrefs

Cf. A006784 (Pierce expansion definition), A059186.

Programs

  • Mathematica
    PierceExp[A_, n_] := Join[Array[1 &, Floor[A]], First@Transpose@ NestList[{Floor[1/Expand[1 - #[[1]] #[[2]]]], Expand[1 - #[[1]] #[[2]]]} &, {Floor[1/(A - Floor[A])], A - Floor[A]}, n - 1]]; PierceExp[N[1/Zeta[2], 7!], 25] (* G. C. Greubel, Nov 14 2016 *)
  • PARI
    default(realprecision, 100000); r=zeta(2); for(n=1, 100, s=(r/(r-floor(r))); print1(floor(r), ", "); r=s) \\ Benoit Cloitre [amended by Georg Fischer, Nov 20 2020]

Formula

Let u(0) = Pi^2/6 and u(n+1) = u(n)/frac(u(n)) where frac(x) is the fractional part of x; then a(n) = floor(u(n)).
1/zeta(2) = 1/a(1) - 1/(a(1)*a(2)) + 1/(a(1)*a(2)*a(3)) - 1/(a(1)*a(2)*a(3)*a(4)) ...
Limit_{n->oo} a(n)^(1/n) = e.

Extensions

a(1)=1 inserted by Georg Fischer, Nov 20 2020

A091846 Pierce expansion of log(2).

Original entry on oeis.org

1, 3, 12, 21, 51, 57, 73, 85, 96, 1388, 4117, 5268, 9842, 11850, 16192, 19667, 29713, 76283, 460550, 1333597, 1462506, 9400189, 13097390, 30254851, 190193800, 201892756, 431766247, 942050077, 6204785761, 16684400052, 23762490104
Offset: 1

Views

Author

Benoit Cloitre, Mar 09 2004

Keywords

Comments

If u(0)=exp(1/m) m integer>=1 and u(n+1)=u(n)/frac(u(n)) then floor(u(n))=m*n.

Crossrefs

Cf. A006784 (Pierce expansion definition), A059180.

Programs

  • Mathematica
    PierceExp[A_, n_] := Join[Array[1 &, Floor[A]], First@Transpose@ NestList[{Floor[1/Expand[1 - #[[1]] #[[2]]]], Expand[1 - #[[1]] #[[2]]]} &, {Floor[1/(A - Floor[A])], A - Floor[A]}, n - 1]]; PierceExp[N[Log[2], 7!], 25] (* G. C. Greubel, Nov 14 2016 *)
  • PARI
    r=1/log(2);for(n=1,30,r=r/(r-floor(r));print1(floor(r),","))

Formula

Let u(0)=1/log(2) and u(n+1)=u(n)/frac(u(n)) where frac(x) is the fractional part of x, then a(n)=floor(u(n)).
log(2) = 1/a(1) - 1/(a(1)*a(2)) + 1/(a(1)*a(2)*a(3)) - 1/(a(1)*a(2)*a(3)*a(4)) +- ...
limit n-->infinity a(n)^(1/n) = e.

A140076 Pierce expansion of the cube root of 1/2.

Original entry on oeis.org

1, 4, 5, 7, 8, 18, 384, 7958, 14304, 16623, 18610, 20685, 72923, 883177, 1516692, 2493788, 2504069, 22881179, 110219466, 2241255405, 34982468090, 64356019489, 110512265214, 1142808349967, 3550630472116, 5238523454726, 7129035664265
Offset: 1

Views

Author

Gerard P. Michon, Jun 01 2008

Keywords

Comments

2^(-1/3) = 1-1/4(1-1/5(1-1/7(1-1/8(1-1/18(1-1/384(...))))))

Examples

			a(1) is 1 because the floor of 2^(1/3) is 1.
a(2)=4 because 1/(1-2^(-1/3)) is 4.8473221...
		

Crossrefs

Programs

  • Mathematica
    $MaxExtraPrecision = 80; x[1] = 2^(-1/3); a[n_] := a[n] = Floor[1/x[n]]; x[n_] := x[n] = 1 - a[n-1]*x[n-1]; Table[a[n], {n, 1, 27}] (* Jean-François Alcover, Dec 12 2011 *)
    PierceExp[A_, n_] := Join[Array[1 &, Floor[A]], First@Transpose@ NestList[{Floor[1/Expand[1 - #[[1]] #[[2]]]], Expand[1 - #[[1]] #[[2]]]} &, {Floor[1/(A - Floor[A])], A - Floor[A]}, n - 1]]; PierceExp[N[2^(-1/3), 7!], 25] (* G. C. Greubel, Nov 14 2016 *)

Formula

Starting with x(1)=2^(-1/3), a(n) = floor(1/x(n)) and x(n+1) = 1-a(n)x(n).
Showing 1-9 of 9 results.