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 A356352 #14 Oct 17 2022 08:37:45 %S A356352 0,1,1,2,1,1,1,3,1,1,1,1,2,1,1,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,1,1, %T A356352 1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,2,1,1,1,1,3,1,1,1,2,1,1,6,1,1,1,1, %U A356352 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 %N A356352 a(n) = GCD of run lengths in binary expansion of n. %C A356352 a(0) = 0 as the GCD of an empty list (we consider here that the binary expansion of 0 has no runs). %H A356352 Michael De Vlieger, <a href="/A356352/b356352.txt">Table of n, a(n) for n = 0..16384</a> %H A356352 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A356352 a(A001196(n)) = 2*a(n). %F A356352 a(2^k-1) = k for any k >= 0. %t A356352 {0}~Join~Array[GCD @@ Map[Length, Split@ IntegerDigits[#, 2]] &, 104] (* _Michael De Vlieger_, Oct 17 2022 *) %o A356352 (PARI) a(n) = { my (r=[]); while (n, my (v=valuation(n+n%2, 2)); n\=2^v; r=concat(v, r)); gcd(r) } %o A356352 (Python) %o A356352 from math import gcd %o A356352 from itertools import groupby %o A356352 def a(n): %o A356352 if n == 0: return 0 # by convention %o A356352 return gcd(*(len(list(g)) for k, g in groupby(bin(n)[2:]))) %o A356352 print([a(n) for n in range(87)]) # _Michael S. Branicky_, Oct 15 2022 %Y A356352 Cf. A001196, A005811, A101211, A284559 (LCM). %K A356352 nonn,base %O A356352 0,4 %A A356352 _Rémy Sigrist_, Oct 15 2022