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 A365076 #20 Aug 05 2024 01:56:47 %S A365076 2,4,8,12,22,22,44,44,62,64,112,78,158,130,148,172,274,184,344,232, %T A365076 302,334,508,302,522,472,548,474,814,442,932,684,778,820,904,672,1334, %U A365076 1030,1100,904,1642,904,1808,1222,1282,1522,2164,1198,2102,1564,1912,1728 %N A365076 Number of length-n binary words x such that the infinite word xxxx... is balanced. %C A365076 A binary word w is "balanced" if for all lengths and all blocks b of the same length appearing in it, the number of 1's in b can take only two different values. For example, 00111 is not balanced because 00 has no 1's, 01 has one, and 11 has two. %H A365076 Laurent Vuillon, <a href="https://doi.org/10.36045/bbms/1074791332">Balanced words</a>, Bull. Belg. Math. Soc. Simon Stevin 10(5): 787-805 (December 2003). %F A365076 a(n) = 2*A057661(n). %F A365076 a(n) = A057660(n) + 1. %e A365076 For n = 4, the 12 such words are 0000, 0001, 0010, 0100, 0101, 0111 and their bitwise binary complements. %o A365076 (Python) %o A365076 from math import gcd %o A365076 def A365076(n): return sum(n//gcd(n,k) for k in range(1,n+1))+1 # _Chai Wah Wu_, Aug 24 2023 %o A365076 (Python) %o A365076 from math import prod %o A365076 from sympy import factorint %o A365076 def A365076(n): return 1+prod((p**((e<<1)+1)+1)//(p+1) for p,e in factorint(n).items()) # _Chai Wah Wu_, Aug 05 2024 %Y A365076 Cf. A057660, A057661. %K A365076 nonn %O A365076 1,1 %A A365076 _Jeffrey Shallit_, Aug 20 2023