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.

A075874 Pi = Sum_{n >= 1} a(n)/n!, with largest possible a(n).

This page as a plain text file.
%I A075874 #50 Feb 16 2025 08:32:47
%S A075874 3,0,0,3,1,5,6,5,0,1,4,7,8,0,6,7,10,7,10,4,10,6,16,1,11,20,3,18,12,9,
%T A075874 13,18,21,14,34,27,11,27,33,36,18,5,18,5,23,39,1,10,42,28,17,20,51,8,
%U A075874 42,47,0,27,23,16,52,32,52,53,24,43,61,64,18,17,11,0,53,14,62
%N A075874 Pi = Sum_{n >= 1} a(n)/n!, with largest possible a(n).
%C A075874 What is meant is the expansion in the factorial number system, cf. links. The formula itself is not sufficient to define the terms uniquely: a(n) can be decreased by any amount x if x*(n+1) is added to a(n+1). - _M. F. Hasler_, Nov 26 2018
%H A075874 Hans Havermann, <a href="/A075874/b075874.txt">Table of n, a(n) for n = 1..10000</a>
%H A075874 D. E. Knuth, <a href="https://books.google.com/books?id=Zu-HAwAAQBAJ&amp;q=factorial#v=snippet">The Art of Computer Programming, Vol.2</a>, 3rd ed., Addison-Wesley, 2014, ISBN 978-0321635761, p.209.
%H A075874 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/HarmonicExpansion.html">Harmonic Expansion</a>
%H A075874 Wikipedia, <a href="https://en.wikipedia.org/wiki/Factorial_number_system">Factorial number system</a>
%F A075874 a(1)=3; for n >= 2, a(n) = floor(n!*Pi) - n*floor((n-1)!*Pi). - _Benoit Cloitre_, Mar 10 2002
%e A075874 Pi = 3/1! + 0/2! + 0/3! + 3/4! + 1/5! + ...
%p A075874 Digits := 120; M := proc(a,n) local i,b,c; b := a; c := [ floor(b) ]; for i from 1 to n-1 do b := b-c[ i ]/i!; c := [ op(c), floor(b*(i+1)!) ]; od; c; end: t1 := M(Pi,100); A075874 := n->t1[n+1];
%t A075874 p = N[Pi, 1000]; Do[k = Floor[p*n! ]; p = p - k/n!; Print[k], {n, 1, 75}]
%t A075874 With[{b = Pi}, Table[If[n == 1, Floor[b], Floor[n!*b] - n*Floor[(n - 1)!*b]], {n, 1, 100}]] (* _G. C. Greubel_, Nov 26 2018 *)
%o A075874 (PARI) x=Pi;vector(floor((y->y/log(y))(default(realprecision))),n,t=n!;k=floor(x*t);x-=k/t;k) \\ _Charles R Greathouse IV_, Jul 15 2011
%o A075874 (PARI) vector(30,n,if(n>1,t=t%1*n,t=Pi)\1) \\ Increase realprecision (e.g., \p500) to compute more terms. - _M. F. Hasler_, Nov 25 2018
%o A075874 (PARI) default(realprecision, 250); b = Pi; for(n=1, 80, print1(if(n==1, floor(b), floor(n!*b) - n*floor((n-1)!*b)), ", ")) \\ _G. C. Greubel_, Nov 26 2018
%o A075874 (Magma) SetDefaultRealField(RealField(250)); R:=RealField(); [Floor(Pi(R))] cat [Floor(Factorial(n)*Pi(R)) - n*Floor(Factorial((n-1))*Pi(R)) : n in [2..80]]; // _G. C. Greubel_, Nov 26 2018
%o A075874 (Sage)
%o A075874 def A075874(n):
%o A075874     if (n==1): return floor(pi)
%o A075874     else: return expand(floor(factorial(n)*pi) - n*floor(factorial(n-1)*pi))
%o A075874 [A075874(n) for n in (1..80)] # _G. C. Greubel_, Nov 26 2018
%Y A075874 Essentially same as A007514.
%Y A075874 Pi in base n: A004601 to A004608, A000796, A068436 to A068440, A062964.
%Y A075874 Cf. A068452-A068464.
%K A075874 nonn
%O A075874 1,1
%A A075874 _N. J. A. Sloane_, _Robert G. Wilson v_, Nov 02 2001 and Oct 20 2002