OFFSET
0,1
COMMENTS
The primorial expansion a(n) of a real number x is defined as x = a(0) + sum(i>0, a(i) / prime(i)# ) where a(0) = floor(x) and 0 <= a(i) < prime(i) for all i > 0.
FORMULA
x(0) = e;
a(n) = floor(x(n));
x(n + 1) = prime(n) * (x(n) - a(n));
where prime(n) = A000040(n) is the n-th prime number.
a(n) gives the primorial expansion of x(0) = e.
EXAMPLE
e = 2 + 1/prime(1)# + 1/prime(2)# + 1/prime(3)# + 3/prime(4)# + 9/prime(5)# + ...
where prime(n)# = A002110(n) is the n-th primorial.
MATHEMATICA
pe = Block[{x = #, $MaxExtraPrecision = \[Infinity]},
Do[x = Prime[i] (x - Sow[x // Floor]) // Expand, {i, #2 - 1}];
x // Floor // Sow] // Reap // Last // Last // Function;
pe[E, 100]
CROSSREFS
KEYWORD
nonn
AUTHOR
Albert Lau, Apr 06 2014
STATUS
approved