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.

A067395 First differences of A067368.

Original entry on oeis.org

4, 4, 4, 2, 2, 4, 4, 4, 4, 4, 4, 4, 2, 2, 4, 4, 4, 4, 4, 4, 4, 2, 2, 4, 4, 4, 4, 4, 4, 4, 2, 2, 4, 4, 4, 2, 2, 4, 4, 4, 2, 2, 4, 4, 4, 4, 4, 4, 4, 2, 2, 4, 4, 4, 4, 4, 4, 4, 2, 2, 4, 4, 4, 4, 4, 4, 4, 2, 2, 4, 4, 4, 4, 4, 4, 4, 2, 2, 4, 4, 4, 4, 4, 4, 4, 2, 2, 4, 4, 4, 4, 4, 4, 4, 2, 2, 4, 4, 4, 4, 4, 4, 4, 2, 2
Offset: 1

Views

Author

John W. Layman, Jan 22 2002

Keywords

Comments

See A067396 for the locations of the four consecutive terms {...,4,2,2,4,...} in this sequence.
The asymptotic density of the occurrences of k = 2 and 4 is 1/4 and 3/4, respectively. The asymptotic mean of this sequence is 7/2. - Amiram Eldar, May 31 2024

Crossrefs

Programs

  • Python
    def A067395(n):
        def iterfun(f,n=0):
            m, k = n, f(n)
            while m != k: m, k = k, f(k)
            return m
        def f(x): return x-sum(((x>>i)-1>>1)+1 for i in range(0,x.bit_length(),3))
        return iterfun(lambda x:f(x)+n+1,n+1)-iterfun(lambda x:f(x)+n,n)<<1 # Chai Wah Wu, Feb 17 2025