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.

Showing 1-1 of 1 results.

A386384 Continued fraction expansion of Sum_{k>=0} (-1)^k/(k!)!.

Original entry on oeis.org

0, 2, 179, 1, 1, 1196852626800230399, 2, 179, 1, 1, 17377308326435956818596067989554034737368967210468674554156131654360754429984573360106123813424835044026977477398690421454067571097599999999999999999999, 2, 179, 2, 1196852626800230399, 1, 1, 179, 2
Offset: 0

Views

Author

Daniel Hoyt, Aug 17 2025

Keywords

Comments

The peak terms have the form P(k) = ((k+1)!)! / ((k!)!)^2 - 1. The sequence is an interleaving between the n-th runs of '2' and '1,1' in A386385, and P(A001511(n)+1).

Crossrefs

Cf. A387268 (decimal expansion).

Programs

  • Mathematica
    ContinuedFraction[Sum[(-1)^k/(k!)!, {k, 0, 6}], 21]
  • Python
    import sys #for printing huge factorials
    sys.set_int_max_str_digits(0)  # otherwise sys not needed.
    def a386384(n):
        import math
        if n==0: return 0
        t=n-1; M=0x18199818
        s=[1,1]; h=2; p=0; r=0
        def g(u):
            nonlocal s,h
            while len(s)>(r&31))&1) else ('A' if xb=='B' else 'B')
            L = 2 if yb=='A' else 1
            if t < L: return 1 if yb=='A' else 2
            t -= L
            if t==0:
                rr=r+1
                K=((rr & -rr).bit_length()-1)+2
                A=math.factorial(math.factorial(K+1))
                B=math.factorial(math.factorial(K))
                return A//(B*B)-1
            t-=1; r+=1
Showing 1-1 of 1 results.