|
|
A352228
|
|
Number of length-n blocks in the Thue-Morse sequence with intertwining pattern ABBA ABBA ABBA... .
|
|
1
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,5
|
|
COMMENTS
|
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'.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
For n = 4, the only block with intertwining sequence ABBA ABBA ... is 0011.
|
|
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]]];
|
|
PROG
|
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)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|