cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A240455 Primorial expansion of Pi.

Original entry on oeis.org

3, 0, 0, 4, 1, 8, 1, 0, 8, 19, 13, 10, 28, 29, 23, 30, 9, 32, 4, 26, 12, 27, 75, 28, 45, 30, 47, 65, 91, 83, 9, 92, 123, 44, 73, 32, 140, 102, 28, 75, 108, 30, 139, 4, 127, 88, 57, 182, 207, 172, 80, 126, 150, 232, 227, 19, 256, 238, 195, 44, 56, 58, 131, 160, 243, 222, 22, 47, 30, 226, 312, 130, 161, 68, 358, 52, 250, 152, 15, 38, 120, 195, 120, 263, 412, 115, 412, 427, 284, 361, 121, 413, 355, 75, 473, 355, 10, 177, 101, 71
Offset: 0

Views

Author

Albert Lau, Apr 05 2014

Keywords

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.

Examples

			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.
		

Crossrefs

Cf. A000796 (decimal expansion), A075874 (factorial number system expansion).

Programs

  • 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]

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]