Function Repository Resource:

TranscendentalRange

Source Notebook

Generate ranges of transcendental numbers

Contributed by: Daniele Gregori

ResourceFunction["TranscendentalRange"][x]

gives all transcendental numbers of the forms t=b a with 1<=t<=x and a,b algebraics in Range[x].

ResourceFunction["TranscendentalRange"][x,y]

gives all transcendental numbers of the forms t=b a, with x<=t<=y and a,b algebraics in Range[x,y].

ResourceFunction["TranscendentalRange"][x,y,s]

gives all transcendental numbers of the forms t=b a, with x<=t<=y,s>0 and a,b algebraics in Range[x,y,s].

ResourceFunction["TranscendentalRange"][x,y,s,d]

require a lower bound on the steps d.

Details and Options

TranscendentalRange can systematically generate various types of transcendental numbers.
Transcendental numbers are irrational numbers for which it has been mathematically proven that they cannot be expressed as solutions of any polynomial equation with integer coefficients (that is, they are not Root objects at the exact level).
As for the basic function Range, the first two arguments of TranscendentalRange are the numeric bounds x, y of the range. In other words, all the range elements satisfy x<=ti<=y.
By default, the range elements are generated according to the Lindemann-Weierstrass theorem, that is linear combinations of exponentials ti= b a, for all algebraic arguments and coefficients a, b that are members of Range[x,y], or possibly Range[x,y,s] using also a step parameter s as third argument.
This transcendental range definition appears rather natural mathematically, but requires careful implementation as a customized version of Outer, so to avoid producing unnecessary expressions which will be eventually discarded since beyond the bounds.
As it happens for resource function "AlgebraicRange", also the definition of ResourceFunction["TranscendentalRange"] allows the user to specify a fourth argument d, to require a minimum absolute value difference between successive transcendentals and thus avoid the tendency to produce very irregular distributions of numeric values.
ResourceFunction["TranscendentalRange"] has been designed especially in view of its application to the resource function "FindClosedForm" for exhaustively searching possible closed forms for raw numbers in terms of arbitrary mathematical functions with transcendental arguments.
TranscendentalRange accepts the following options:
MethodExpchange function for generating transcendental numbers
"GeneratorsDomain"Rationalschange type of algebraic arguments for the generating function
"FareyRange"Falseset the step denominators as in the FareySequence
"FormulaComplexity"Infinitylimit the complexity of the expressions
WorkingPrecisionMachinePrecisionset the precision for all the internal numerical evaluations
The option Method can be used to specify other types of transcendental functions for generating transcendental numbers and these include:
Expexponential forms b ⅇa
Loglogarithmic forms bLog[a]
Powerpower forms ab, only for irrational b
Sin, Cos, Tan, any of the trigonometric forms b Sin[a],bCos[a],bTan[a],
ArcSin, ArcCos, ArcTan, any of the inverse trig. forms b ArcSin[a],bArcCos[a],bArcTan[a],
Sinh, Cosh, Tanh, any of the hyperbolic forms b Sinh[a],bCosh[a],bTanh[a],
ArcSinh, ArcCosh, ArcTanh, any of the inverse hyp. forms bArcSinh[a],bArcCosh[a],bArcTanh[a],
{type1,type2,… }a list of the above types
Allall of the above types
For all these transcendental types, the generated exact numbers have been mathematically proven to be transcendental through the theorems of Lindemann-Weierstrass, Gelfond-Schneider and Baker (cf. Baker, 1975).
The option "GeneratorsDomain" can be used to specify whether a, b (function argument and coefficient) should belong to the Rationals or to the Algebraics, as generated by Range and the resource function "AlgebraicRange", respectively. These are also restricted to be elements of the Reals and no complex number can be generated.
For the method Power, only algebraic irrational generators in the exponent b can produce transcendental numbers.
Another way to restrict the output of ResourceFunction["TranscendentalRange"] is by setting a threshold for the complexity of the numeric expressions involved through the option "FormulaComplexity". The corresponding numerical values are not much relevant in practice and are assigned through a merely heuristic recipe.
A user interested in precise computations of the underlying homonymous function may use the paclet "DanieleGregori/GeneralizedRange".

Examples

Basic Examples (3) 

A range of positive transcendental numbers:

In[1]:=
ResourceFunction["TranscendentalRange"][10]
Out[1]=

Negative and positive transcendental numbers:

In[2]:=
ResourceFunction["TranscendentalRange"][-2, 2]
Out[2]=

A transcendental range with non-unit step:

In[3]:=
ResourceFunction["TranscendentalRange"][0, 4, 1/2]
Out[3]=

Scope (4) 

A symmetric transcendental range with step:

In[4]:=
symRange = ResourceFunction["TranscendentalRange"][-2, 2, 1/2]
Out[4]=
In[5]:=
NumberLinePlot[symRange]
Out[5]=

A transcendental range with negative step:

In[6]:=
negStepRange = ResourceFunction["TranscendentalRange"][100, 1, -1]
Out[6]=
In[7]:=
NumberLinePlot[negStepRange]
Out[7]=

Require a lower bound on the steps:

In[8]:=
boundedRange = ResourceFunction["TranscendentalRange"][-2, 2, 1/4, 1/8]
Out[8]=
In[9]:=
NumberLinePlot[boundedRange]
Out[9]=

A very large transcendental range generated efficiently:

In[10]:=
largeRange = ResourceFunction["TranscendentalRange"][-100, 100, 1/2] // EchoTiming
2.338204`
Out[10]=
In[11]:=
Length[largeRange]
Out[11]=

Options (17) 

Method (8) 

A range in terms of logarithms:

In[12]:=
logRange = ResourceFunction["TranscendentalRange"][10, Method -> Log]
Out[12]=
In[13]:=
NumberLinePlot[logRange]
Out[13]=

Ranges in terms of hyperbolic transcendental functions:

In[14]:=
ResourceFunction["TranscendentalRange"][-10, 10, Method -> Sinh]
Out[14]=
In[15]:=
ResourceFunction["TranscendentalRange"][3, 7, Method -> Tanh]
Out[15]=

Ranges in terms of inverse hyperbolic functions:

In[16]:=
ResourceFunction["TranscendentalRange"][-2, 2, Method -> ArcSinh]
Out[16]=
In[17]:=
ResourceFunction["TranscendentalRange"][-2, 2, 1/2, Method -> ArcTanh]
Out[17]=

Ranges in terms of trigonometric functions:

In[18]:=
ResourceFunction["TranscendentalRange"][-2, 2, Method -> Sin]
Out[18]=
In[19]:=
ResourceFunction["TranscendentalRange"][-2, 2, Method -> Csc]
Out[19]=

Ranges in terms of inverse trigonometric functions:

In[20]:=
ResourceFunction["TranscendentalRange"][-2, 2, Method -> ArcTan]
Out[20]=
In[21]:=
ResourceFunction["TranscendentalRange"][-2, 2, Method -> ArcCsc]
Out[21]=

Ranges in terms of Power (this requires the setting "GeneratorsDomain"Algebraics to get non-trivial results):

In[22]:=
ResourceFunction["TranscendentalRange"][-3, 3, Method -> Power, "GeneratorsDomain" -> Algebraics]
Out[22]=

A range in terms of a list of different types:

In[23]:=
ResourceFunction["TranscendentalRange"][-3, 3, Method -> {ArcTan, ArcSinh}]
Out[23]=

A range in terms of all previous types combined:

In[24]:=
completeRange = ResourceFunction["TranscendentalRange"][3, Method -> All]
Out[24]=
In[25]:=
NumberLinePlot[completeRange]
Out[25]=

GeneratorsDomain (2) 

A transcendental range generated by non rationals Algebraics:

In[26]:=
algRange = ResourceFunction["TranscendentalRange"][8, "GeneratorsDomain" -> Algebraics]
Out[26]=

Compare with the corresponding default range in terms of the default Rationals:

In[27]:=
ratRange = ResourceFunction["TranscendentalRange"][8, "GeneratorsDomain" -> Rationals]
Out[27]=
In[28]:=
SubsetQ[algRange, ratRange]
Out[28]=

FareyRange (2) 

Generate steps according to the FareySequence:

In[29]:=
farRange = ResourceFunction["TranscendentalRange"][1, 10, 1/3, "FareyRange" -> True]
Out[29]=

Compare with the default transcendental range of step 1/2:

In[30]:=
range1over2 = ResourceFunction["TranscendentalRange"][1, 10, 1/2, "FareyRange" -> False]
Out[30]=

Also the default transcendental range of step 1/3:

In[31]:=
range1over3 = ResourceFunction["TranscendentalRange"][1, 10, 1/3, "FareyRange" -> False]
Out[31]=

It turns out that the transcendental Farey range does not correspond to simply combining ordinary ranges with more steps, but to a superset of it:

In[32]:=
range1over2over3 = SortBy[DeleteDuplicatesBy[Join[range1over2, range1over3], N], N]
Out[32]=
In[33]:=
SubsetQ[farRange, range1over2over3]
Out[33]=

Create a transcendental Farey range including root arguments:

In[34]:=
algFareyRange = ResourceFunction["TranscendentalRange"][0, 3/2, 1/3, "FareyRange" -> True, "GeneratorsDomain" -> Algebraics]
Out[34]=
In[35]:=
NumberLinePlot[algFareyRange]
Out[35]=

FormulaComplexity (3) 

Reduce the output range by setting a threshold on the complexity:

In[36]:=
ResourceFunction["TranscendentalRange"][0, 8, 1/2, "GeneratorsDomain" -> Algebraics, "FormulaComplexity" -> 5]
Out[36]=

Compare with the default range with no complexity threshold:

In[37]:=
ResourceFunction["TranscendentalRange"][0, 8, 1/2, "GeneratorsDomain" -> Algebraics, "FormulaComplexity" -> Infinity] // Length
Out[37]=

Compare with the same range restricted by the fourth argument (lower bound on steps):

In[38]:=
ResourceFunction["TranscendentalRange"][0, 8, 1/2, 2/3, "GeneratorsDomain" -> Algebraics, "FormulaComplexity" -> Infinity]
Out[38]=

WorkingPrecision (2) 

In certain cases the generated symbolic expressions may be found to collide in terms of their N numerical values:

In[39]:=
machPrecRange = ResourceFunction["TranscendentalRange"][20, 25, Method -> Tanh]
Out[39]=
In[40]:=
N[machPrecRange, $MachinePrecision]
Out[40]=

To distinguish them, WorkingPrecision may be optionally set to a higher value:

In[41]:=
highPrecRange = ResourceFunction["TranscendentalRange"][20, 25, Method -> Tanh, WorkingPrecision -> 30]
Out[41]=
In[42]:=
N[highPrecRange, 30]
Out[42]=

Applications (4) 

Search and find closed forms in terms of exponentials:

In[43]:=
ResourceFunction["FindClosedForm"][
 1.922115514, Identity,
 "SearchRange" -> Function[Range[#]~Join~ResourceFunction["TranscendentalRange"][#]]]
Out[43]=
In[44]:=
N[%, 10]
Out[44]=

Find closed forms in terms of all elementary transcendental functions:

In[45]:=
ResourceFunction["FindClosedForm"][
 1.162002218, Identity,
 "SearchRange" -> Function[
   Range[#]~Join~
    ResourceFunction["TranscendentalRange"][1, #, 1/#, Method -> All]],
 "MonitorSearch" -> True]
Out[45]=
In[46]:=
N[%, 10]
Out[46]=

Find closed forms in terms of common mathematical functions composed to exponentials:

In[47]:=
ResourceFunction["FindClosedForm"][
 9.095468039,
 "SearchRange" -> Function[Range[#]~Join~ResourceFunction["TranscendentalRange"][#]],
 "MonitorSearch" -> True,
 "FormulaComplexity" -> 50]
Out[47]=
In[48]:=
N[%, 10]
Out[48]=

Search and find closed forms in terms of common functions composed to any of the available transcendental functions:

In[49]:=
ResourceFunction["FindClosedForm"][
 -0.01020330726,
 "SearchRange" -> Function[
   Range[-#, #]~Join~
    ResourceFunction["TranscendentalRange"][-#, #, Method -> All]],
 "MonitorSearch" -> True]
Out[49]=

Properties and Relations (2) 

TranscendentalRange[x,y,z] can be simply generated through the Outer product of the function #1 Exp[#2]&, with both arguments running over Range[x,y,z], suitably restricted to the elements within the bounds x, y, not belonging to the Algebraics and sorted, as follows:

In[50]:=
outerTranscRange[x_, y_, z_] /; z > 0 :=
 SortBy[DeleteDuplicatesBy[
   Select[
    Outer[# Exp[#2] &, Range[x, y, z], Range[x, y, z]] // Flatten,
    x <= # <= y && ! Element[#, Algebraics] &], N], N]
In[51]:=
outerRange = outerTranscRange[-2, 2, 1/2]
Out[51]=
In[52]:=
transcRange = ResourceFunction["TranscendentalRange"][-2, 2, 1/2]
Out[52]=
In[53]:=
outerRange == transcRange
Out[53]=

The actual implementation of TranscendentalRange[x,y,z] is much more efficient than Outer over large exponentially increasing ranges:

In[54]:=
outerRange = outerTranscRange[1, 1000, 1]; // AbsoluteTiming
Out[54]=
In[55]:=
transcRange = ResourceFunction["TranscendentalRange"][1000]; // AbsoluteTiming
Out[55]=
In[56]:=
outerRange == transcRange
Out[56]=

Possible Issues (2) 

By definition, the arguments must be all algebraic numbers:

In[57]:=
ResourceFunction["TranscendentalRange"][0, E, 1/3]
Out[57]=

Bypassed this limitation by increasing the arguments:

In[58]:=
ResourceFunction["TranscendentalRange"][0, Ceiling[E], 1/3]
Out[58]=

Neat Examples (2) 

Generate a mixed large transcendental range with all the methods available:

In[59]:=
mixedRange = ResourceFunction["TranscendentalRange"][-2, 2, 1/3, Method -> All, "FareyRange" -> True, "GeneratorsDomain" -> Algebraics];
In[60]:=
Length[mixedRange]
Out[60]=
In[61]:=
RandomSample[mixedRange, 10]
Out[61]=

Pick a random element of it and verify experimentally the property of being transcendental, that is that its RootApproximant expressions do not converge at any given precision:

In[62]:=
randTransc = RandomChoice[mixedRange]
Out[62]=
In[63]:=
Table[
  {prec, Magnify[InputForm@RootApproximant@N[randTransc, prec], 0.7]}, {prec, PowerRange[16, 512, 2]}] // Grid@Prepend[#, {"Precision", "RootApproximant"}] &
Out[63]=

It is interesting to do the same computation on algebraic numbers. Install this paclet to generate more general algebraic numbers:

In[64]:=
PacletInstall["DanieleGregori/GeneralizedRange"]
Out[64]=
In[65]:=
Get["DanieleGregori`GeneralizedRange`"]

Generate a large algebraic range and pick a random algebraic number in it:

In[66]:=
largeAlgebraicRange = PacletSymbol[
   "DanieleGregori/GeneralizedRange", "DanieleGregori`GeneralizedRange`AlgebraicRange"][-3, 3, 1/2, "RootOrder" -> 3, Method -> All];
In[67]:=
Length[largeAlgebraicRange]
Out[67]=
In[68]:=
randAlg = RandomChoice@largeAlgebraicRange
Out[68]=

We find for this a quite rapid convergence beyond 64 approximation digits:

In[69]:=
Table[
   {prec, Magnify[InputForm@RootApproximant@N[randAlg, prec], 0.7]}, {prec, PowerRange[16, 512, 2]}]~
  Prepend~{"Precision", "RootApproximant"} // Grid
Out[69]=

Take also the (nested) algebraic of this range which is

Find the most complex in terms of LeafCount:

In[70]:=
complexAlg = TakeLargestBy[largeAlgebraicRange, LeafCount, 1] // First
Out[70]=

The convergence of RootApproximant is slower but necessarily happens after about 512 approximation digits:

In[71]:=
Table[
   {prec, Magnify[InputForm@RootApproximant@N[complexAlg, prec], 0.7]}, {prec, PowerRange[16, 1024, 2]}]~
  Prepend~{"Precision", "RootApproximant"} // Grid
Out[71]=

Note this agrees with the minimal polynomial:

In[72]:=
MinimalPolynomial[Sqrt[(3 3^(1/3))/2^(2/3) + Sqrt[3/2] 7^(1/6)]]
Out[72]=

Notice the function Element can confirm the algebraic character but not always the transcendental one:

In[73]:=
Element[{randAlg, complexAlg}, Algebraics]
Out[73]=
In[74]:=
Element[randTransc, Algebraics]
Out[74]=

It should be emphasized though that while these are easy computational investigations within the Wolfram Language, a proper rigorous mathematical proof is necessary to establish the transcendence character of a number (that is equivalent to evaluating it at infinite precision).

Publisher

Daniele Gregori

Requirements

Wolfram Language 12.0 (April 2019) or above

Version History

  • 1.0.0 – 02 March 2026

Source Metadata

Related Resources

Author Notes

For all the methods implemented in TranscendentalRange[x,y,z,MethodAll], the transcendental character of the generated expressions is formally established as corollary to the theorems of Lindemann-Weierstrass and Baker (cf. Alan Baker, 1975, "Transcendental Number Theory", Cambridge University Press).

Actually, this first version implements only a minimal subset of all possible expressions which these theorems prove to be transcendental numbers. I hope to implement also more general possibilities and a more efficient algorithm in later versions.

License Information