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.

A352228 Number of length-n blocks in the Thue-Morse sequence with intertwining pattern ABBA ABBA ABBA... .

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32
Offset: 1

Views

Author

Jeffrey Shallit, Mar 08 2022

Keywords

Comments

Essentially a duplicate of A060973. This is 0 together with A060973.
The intertwining pattern is the list of consecutive occurrences of a block x and its binary complement x' in the Thue-Morse sequence A010060, where A codes an occurrence of x and B codes an occurrence of x'.

Examples

			For n = 4, the only block with intertwining sequence ABBA ABBA ... is 0011.
		

Crossrefs

Cf. A010060, A060973. Related to A352227.

Programs

  • Mathematica
    a[n_] := a[n] = Switch[n, 1|2, 0, 3, 1, n, If[Mod[n, 2] == 1, 2*a[(n+1)/2//Floor], a[n/2//Floor] + a[1+n/2//Floor]]];
    Table[a[n], {n, 1, 78}] (* Jean-François Alcover, Mar 25 2023 *)
  • Python
    # Recurrence from Henry Bottomley in A060973.
    from functools import cache
    @cache
    def a(n):
        match n:
            case 1 | 2: return 0
            case 3: return 1
            case n  if n % 2 == 1: return 2*a((n+1)//2)
            case _: return a(n//2) + a(1+n//2)
    print([a(n) for n in range(1, 73)])  # Peter Luschny, Mar 08 2022

Formula

a(n) = A060973(n-1) for n >= 1.