OFFSET
0,1
COMMENTS
The primorial expansion a(n) of a real number x is defined as x = Sum_{i>=0} a(i) / prime(i)# where a(0) = floor(x) and 0 <= a(i) < prime(i) for all i > 0.
LINKS
FORMULA
x(0) = Pi; a(n) = floor(x(n)) where x(n + 1) = prime(n + 1) * (x(n) - a(n)) and prime(n) = A000040(n) is the n-th prime number. [corrected by Rémy Sigrist, Jan 06 2019]
EXAMPLE
Pi = 3/prime(0)# + 0/prime(1)# + 0/prime(2)# + 4/prime(3)# + 1/prime(4)# + 8/prime(5)# + ... where prime(n)# = A002110(n) is the n-th primorial number.
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[\[Pi], 100]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Albert Lau, Apr 05 2014
STATUS
approved