Engel Expansion

Author

Eric W. Weisstein
April 23, 2006

This notebook downloaded from http://mathworld.wolfram.com/notebooks/NumberTheory/EngelExpansion.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/EngelExpansion.html.

©2006 Wolfram Research, Inc. except for portions noted otherwise

Code

EngelExpansion[x_,n_]:=Module[{a,aa,k},
a[k_]:=a[k]=Ceiling[1/(x-Plus@@(1/Rest[FoldList[Times,1,aa=Array[a,k-1]]]))/Times@@aa];
Array[a,n]
]
FromEngelExpansion[a_List]:=Plus@@(1/Times//@Rest[FoldList[Times,1,a]])

Alternate code by Michel Trott

EngelAList[c_,o_]:=Prepend[First/@NestList[{Floor[#+1],Together[#]}&[#[[2]]/(#[[1]]-#[[2]])]&,{Floor[1/(c-IntegerPart[c])+1],1/(c-IntegerPart[c])},o-1],Floor[c]]

EngelPartialSumList[as_]:=FoldList[Plus,as[[1]],1/Rest[FoldList[Times,1,Rest[as]]]]

Pi

EngelExpansion[Pi,5]

EngelAList[Pi,5]

FromEngelExpansion[{1,1,1,8,8,17,19,300}]

EngelPartialSumList[{3,8,8,17,19,300}]

Table

cons={Sqrt[2],Sqrt[3],Catalan,E,1/E,EulerGamma,Pi,1/Pi,GoldenRatio,Cosh[1],Sinh[1],Tanh[1],Log[2]};

TableForm[{#,EngelExpansion[#,10]}&/@cons,TableDepth->2]//TraditionalForm

Exact

1/E

EngelExpansion[1/E,20]

Table[2(2n+1)(n-1),{n,20}]

V5

Sum[(1/((2n)!))-(1/((2n+1)!)),{n,∞}]

FullSimplify[%]

V7

Sum[(1/((2n)!))-(1/((2n+1)!)),{n,∞}]

FullSimplify[%]

sinh(1)

Table[2(n-1)(2n-1),{n,20}]

EngelExpansion[Sinh[1],20]

cosh(1)

Table[2(n-1)(2n-3),{n,20}]

EngelExpansion[Cosh[1],20]