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.
%I A352228 #27 Dec 25 2024 04:03:31 %S A352228 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, %T A352228 15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,18,19,20,21, %U A352228 22,23,24,25,26,27,28,29,30,31,32,32,32,32,32,32,32,32,32,32,32,32,32,32 %N A352228 Number of length-n blocks in the Thue-Morse sequence with intertwining pattern ABBA ABBA ABBA... . %C A352228 Essentially a duplicate of A060973. This is 0 together with A060973. %C A352228 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'. %H A352228 Jeffrey Shallit, <a href="https://arxiv.org/abs/2203.02917">Intertwining of Complementary Thue-Morse Factors</a>, arxiv preprint arXiv:2203.02917 [cs.FL], March 6 2022. %F A352228 a(n) = A060973(n-1) for n >= 1. %e A352228 For n = 4, the only block with intertwining sequence ABBA ABBA ... is 0011. %t A352228 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]]]; %t A352228 Table[a[n], {n, 1, 78}] (* _Jean-François Alcover_, Mar 25 2023 *) %o A352228 (Python) # Recurrence from _Henry Bottomley_ in A060973. %o A352228 from functools import cache %o A352228 @cache %o A352228 def a(n): %o A352228 match n: %o A352228 case 1 | 2: return 0 %o A352228 case 3: return 1 %o A352228 case n if n % 2 == 1: return 2*a((n+1)//2) %o A352228 case _: return a(n//2) + a(1+n//2) %o A352228 print([a(n) for n in range(1, 73)]) # _Peter Luschny_, Mar 08 2022 %Y A352228 Cf. A010060, A060973. Related to A352227. %K A352228 nonn %O A352228 1,5 %A A352228 _Jeffrey Shallit_, Mar 08 2022