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-2 of 2 results.

A386385 Period-32 block rewriting of A157196 (blocks 11 and 2): for block index i, keep if i mod 32 in {3,4,11,12,15,16,19,20,27,28}, else swap 11<->2.

Original entry on oeis.org

2, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1
Offset: 0

Views

Author

Daniel Hoyt, Aug 17 2025

Keywords

Comments

The runs of '2', and '1,1' are interleaved in the continued fraction expansion of Sum_{k>=0} (-1)^k/(k!)! (A386384).
Parse A157196 into blocks A = 11 and B = 2, and index the blocks i = 0,1,2,.... For each block i, keep it when i mod 32 in {3, 4, 11, 12, 15, 16, 19, 20, 27, 28}; otherwise swap A <-> B (i.e, swap 1,1 <-> 2) at all other i. Finally expand blocks by A -> 1,1 and B -> 2.
We index the blocks starting at i=0. "Keep" residues are {3,4,11,12,15,16,19,20,27,28} (mod 32); at all other residues we swap (11) <-> (2). After that, expand by (11)->1,1 and (2)->2.
Each block is handled independently by its own i mod 32.

Examples

			Starting from A157196 parsed as (11)(2)(11)(11)(2)(11)(2)... = ABAABAB...
i=0: (11), residue 0 not in keep set -> swap to (2)  -> output 2.
i=1: (2),  residue 1 not in keep set -> swap to (11) -> output 1, 1.
i=2: (11), residue 2 not in keep set -> swap to (2)  -> output 2.
i=3: (11), residue 3 is in keep set  -> keep (11)    -> output 1, 1.
i=4: (2),  residue 4 is in keep set  -> keep (2)     -> output 2.
i=5: (11), residue 5 not in keep set -> swap to (2)  -> output 2.
i=6: (2),  residue 6 not in keep set -> swap to (11) -> output 1, 1.
Concatenating: 2, 1, 1, 2, 1, 1, 2, 2, 1, 1, ...
		

Crossrefs

Programs

  • Python
    def a386385(n):
        m=n+1
        if m<=0: raise ValueError("n>=0")
        M=0x18199818
        def run(N,mode):
            s=[1,1];h=2;p=0;k=0;c=0;y='B'
            def g(u):
                nonlocal s,h
                while len(s)>(k&31))&1) else ('A' if xb=='B' else 'B')
                c += 2 if y=='A' else 1; k+=1
            return c if mode==0 else y
        lo,hi=0,m
        while lo=m: hi=md
            else: lo=md+1
        return 2 if run(lo,1)=='B' else 1

A387268 Decimal expansion of Sum_{k>=0} (-1)^k/(k!)!.

Original entry on oeis.org

4, 9, 8, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 7, 2, 2, 8, 4, 8, 6, 8, 2, 2, 0, 7, 2, 2, 9, 4, 6, 0, 1, 5, 9, 8, 2, 4, 4, 1, 5, 9, 1, 2, 2, 8, 2, 9, 1, 2, 4, 3, 5, 8, 3, 7, 2, 1, 3, 7, 1, 8, 3, 3, 9, 0, 8, 4, 6, 4, 0, 4, 0, 1, 1, 4, 2, 1, 2, 1, 5, 6, 1, 6, 5, 9, 6, 3, 7, 9
Offset: 0

Views

Author

Daniel Hoyt, Aug 24 2025

Keywords

Comments

This constant has an interesting simple continued fraction representation.
359/720 approximates this constant to 19 significant digits.

Examples

			0.498611111111111111127228486822072294...
		

Crossrefs

Cf. A386384 (continued fraction expansion).

Programs

  • Mathematica
    RealDigits[Sum[(-1)^k/(k!)!, {k, 0, 6}], 10, 100][[1]]
  • PARI
    suminf(k=0, (-1)^k/(k!)!)
Showing 1-2 of 2 results.