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

A051065 a(n) = A004128(n) mod 2.

Original entry on oeis.org

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

Views

Author

Keywords

References

  • Letter from Gary W. Adamson concerning Prouhet-Thue-Morse sequence, Nov. 11, 1999.

Crossrefs

Programs

  • Mathematica
    Join[{0}, Mod[Accumulate[Table[IntegerExponent[3*n, 3], {n, 1, 100}]], 2]] (* Amiram Eldar, Jun 02 2025 *)
  • PARI
    a(n)=if(n<1,0,(a(n\3)+n)%2) \\ Benoit Cloitre, Nov 21 2013
  • Python
    TOP = 1000
    a = [0]*TOP
    for n in range(1, TOP):
        print(a[n-1], end=',')
        a[n] = (n + a[n//3]) % 2
    # Alex Ratushnyak, Aug 17 2012
    
  • Python
    def A051065(n):
        c, m, a = 1, 3*n, 0
        for k in range(1,n+1):
            c *= 3
            if c > m:
                break
            a ^= m//c&1
        return a # Chai Wah Wu, Sep 02 2025
    

Formula

a(0)=0, a(n) = (n + a(floor(n/3))) mod 2. - Alex Ratushnyak, Aug 17 2012

Extensions

More terms from James Sellers, Dec 11 1999

A051068 Partial sums of A014578.

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 4, 5, 6, 7, 8, 9, 9, 10, 11, 11, 12, 13, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 26, 27, 28, 29, 29, 30, 31, 31, 32, 33, 34, 35, 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43, 44, 44, 45, 46, 47, 48, 49, 49
Offset: 0

Views

Author

Keywords

Comments

Duplicate of A050294? [Joerg Arndt, Apr 27 2013]
From Michel Dekking, Feb 10 2019: (Start)
The answer to Joerg Arndt's question is: yes (modulo an offset). To see this, it suffices to prove that the two sequences of first differences Da and Db of a= A051068 and b:=A050294 are equal. Clearly the sequence Da of first differences of a is the sequence A014578. According to Philippe Deleham (2004), Da equals 0x = 0110110111110..., where x is the fixed point of the morphism 0->111, 1->110.
From Vladimir Shevelev (2011) we know a formula for b=A050294: b(n) = n-b(floor(n/3)). This gives that the sequence of first differences Db:=(b(n+1)-b(n)) of b satisfies
Db(3m+1) = Db(3m+2) = 1, and Db(3m+3) = 1 - Db(m).
This implies that Db = x, the fixed point of 0->111, 1->110.
(End)

Crossrefs

Formula

a(3^n) = A015518(n+1) = -(-1)^n*A014983(n+1). - Philippe Deléham, Mar 31 2004

A092400 Fixed point of the morphism 1 -> 1121211, 2 -> 1121212121211, starting from a(1) = 1.

Original entry on oeis.org

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

Views

Author

Philippe Deléham, Mar 21 2004

Keywords

Comments

Length of n-th run of identical symbols in A051069.

Crossrefs

Programs

  • Mathematica
    Nest[ Function[ l, {Flatten[(l /. {1 -> {1, 1, 2, 1, 2, 1, 1}, 2 -> {1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1}})]}], {1}, 3] (* Robert G. Wilson v, Feb 26 2005 *)
  • Python
    from sympy import integer_log
    def A007417(n):
        def f(x): return n+x-sum(((m:=x//9**i)-2)//3+(m-1)//3+2 for i in range(integer_log(x,9)[0]+1))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m
    def A092400(n): return A007417(n)-A007417(n-1) if n>1 else 1 # Chai Wah Wu, Feb 16 2025

Formula

Sum_{k=1..n} a(k) = A007417(n).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 4/3. - Amiram Eldar, Apr 11 2025

Extensions

More terms from Robert G. Wilson v, Feb 26 2005
Showing 1-3 of 3 results.