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.

A067882 Factorial expansion of log(2) = Sum_{n>=1} a(n)/n!.

Original entry on oeis.org

0, 1, 1, 0, 3, 1, 0, 3, 6, 2, 5, 4, 6, 11, 4, 11, 5, 12, 3, 5, 13, 2, 22, 6, 22, 13, 20, 7, 1, 0, 1, 20, 2, 6, 4, 1, 18, 14, 35, 2, 11, 31, 16, 19, 42, 36, 41, 0, 14, 31, 25, 43, 4, 13, 34, 53, 50, 57, 2, 30, 12, 25, 45, 24, 2, 39, 57, 51, 30, 41, 65, 15, 9, 55, 23, 4, 35, 18, 77, 43
Offset: 1

Views

Author

Benoit Cloitre, Mar 10 2002

Keywords

Examples

			log(2) = 0 + 1/2! + 1/3! + 0/4! + 3/5! + 1/6! + 0/7! + 3/8! + 6/9! + ...
		

Crossrefs

Cf. A002162 (decimal expansion), A016730 (continued fraction).
Cf. A322334 (log(3)), A322333 (log(5)), A068460 (log(7)), A068461 (log(11)).

Programs

  • Magma
    SetDefaultRealField(RealField(250)); [Floor(Log(2))] cat [Floor(Factorial(n)*Log(2)) - n*Floor(Factorial((n-1))*Log(2)) : n in [2..80]]; // G. C. Greubel, Nov 26 2018
    
  • Mathematica
    With[{b = Log[2]}, Table[If[n == 1, Floor[b], Floor[n!*b] - n*Floor[(n - 1)!*b]], {n, 1, 100}]] (* G. C. Greubel, Nov 26 2018 *)
  • PARI
    default(realprecision, 250); b = log(2); for(n=1, 80, print1(if(n==1, floor(b), floor(n!*b) - n*floor((n-1)!*b)), ", ")) \\ G. C. Greubel, Nov 26 2018
    
  • Sage
    def A067882(n):
        if (n==1): return floor(log(2))
        else: return expand(floor(factorial(n)*log(2)) - n*floor(factorial(n-1)*log(2)))
    [A067882(n) for n in (1..80)] # G. C. Greubel, Nov 26 2018

Formula

a(n) = floor(n!*log(2)) - n*floor((n-1)!*log(2)).