%I #10 Feb 16 2025 08:33:20
%S 4,3,6,12,51,146,280,482,687,3825,5646,30904,120121,1344923,2340376,
%T 4456271,194324055,219784933,976224357,11584437417,26402463827,
%U 34635051144,85031207055,95014277980,257962314442
%N A generalized Engel expansion of 1/Pi.
%C For a description of two kinds of generalized Engel expansion of a real number see A232327. Compare with A006283 and A014012.
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PierceExpansion.html">Pierce Expansion</a>
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Engel_expansion">Engel Expansion</a>
%F 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.
%F 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) - - + +.
%p #A232328
%p #Define the n-th iterate of the map f(x) = x/b*ceiling(b/x) - 1
%p map_iterate := proc(n,b,x) option remember;
%p if n = 0 then
%p x
%p else
%p -1 + 1/b*thisproc(n-1,b,x)*ceil(b/thisproc(n-1,b,x))
%p end if
%p end proc:
%p #Define the terms of the expansion of x to the base b
%p a := n -> ceil(evalf(b/map_iterate(n,b,x))):
%p Digits:= 500:
%p #Choose values for x and b
%p x := -1/Pi: b:= -1:
%p seq(abs(a(n)), n = 0..24);
%Y Cf. A006283, A014012, A232327.
%K nonn,easy,changed
%O 0,1
%A _Peter Bala_, Nov 27 2013