Function Repository Resource:

FromNumberExpansion

Source Notebook

Rational approximation of a real number using different kinds of commonly known series expansions

Contributed by: Swastik Banerjee

ResourceFunction["FromNumberExpansion"][list,"t"]

reconstructs a number from the list of its series expansion terms for the chosen expansion type t.

Details and Options

"Engel", "Pierce", "Sylvester", "Cantor", "CantorProduct", "Lüroth" and "Oppenheim" are supported as the last argument to specify the type of expansion.
"Lüroth" can also be written as "Lueroth" when passed as an argument.
ResourceFunction["FromNumberExpansion"][{a1,a2,a3,},"Engel"] returns 1/a1+1/a1a2+1/a1a2a3+.
ResourceFunction["FromNumberExpansion"][{a1,a2,a3,},"Pierce"] returns 1/a1-1/a1a2+1/a1a2a3-.
ResourceFunction["FromNumberExpansion"][{a1,a2,a3,},"Sylvester"] returns 1/a1+1/a2+1/a3+.
ResourceFunction["FromNumberExpansion"][{a1,a2,a3,},"Cantor"] returns a1*1!+a2*2!+a3*3!+.
ResourceFunction["FromNumberExpansion"][{a1,a2,a3,},"CantorProduct"] returns (1+1/a1)(1+1/a2)(1+1/a3).
ResourceFunction["FromNumberExpansion"][{a1,a2,a3,},"Lüroth"] returns 1/a1 + 1/a1(a1-1)a2 + 1/a1(a1-1)a2(a2-1)a3+.
ResourceFunction["FromNumberExpansion"][{d1,d2,d3,},r,s,p,q,"Oppenheim"] returns 1/d1+(a1/b1)(1/d2)+(a1a2/b1b2)(1/d2)+, where ai=r+s*di and bi=p+q*di for i=1,2,.,n.
ResourceFunction["FromNumberExpansion"][{p,{a1,a2,a3,,ap}},"Lüroth"] returns an approximation of the rational number whose Lüroth expansion is an infinite periodic series with periodicity p.
ResourceFunction["FromNumberExpansion"] acts as the inverse of the resource function NumberExpansion.

Examples

Basic Examples (1) 

Rational approximation of the number π using FromNumberExpansion when the series expansion of the number is known:

In[1]:=
ResourceFunction["NumberExpansion"][Pi, 10, "Engel"]
Out[1]=
In[2]:=
ResourceFunction["FromNumberExpansion"][%, "Engel"]
Out[2]=
In[3]:=
N[%]
Out[3]=

Scope (2) 

Approximation of a Real number whose Lüroth series has infinite periodic expansion:

In[4]:=
ResourceFunction["NumberExpansion"][5/13, "Lueroth"]
Out[4]=
In[5]:=
ResourceFunction["FromNumberExpansion"][{3, {3, 4, 2}}, "Lueroth"]
Out[5]=
In[6]:=
N[%]
Out[6]=
In[7]:=
N[5/13]
Out[7]=

Symbolic form:

In[8]:=
ResourceFunction[
 "FromNumberExpansion"][{Subscript[a, 1], Subscript[a, 2], Subscript[
  a, 3], Subscript[a, 4]}, "Engel"]
Out[8]=

Applications (2) 

Rational approximation of an irrational number through different kinds of series expansion representations:

In[9]:=
ResourceFunction["FromNumberExpansion"][
 ResourceFunction["NumberExpansion"][E, 10, "Engel"], "Engel"]
Out[9]=
In[10]:=
N[%]
Out[10]=

Rational approximation of an infinite series:

In[11]:=
ResourceFunction["FromNumberExpansion"][{2, {4, 5, 6}}, "Lueroth"]
Out[11]=

Publisher

Wolfram Summer School

Version History

  • 1.0.0 – 14 September 2020

Source Metadata

Related Resources

License Information