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 A385393 #26 Jun 28 2025 13:44:14 %S A385393 1,1,2,2,2,2,3,2,2,2,3,3,3,3,3,2,2,2,3,3,3,3,4,3,3,3,4,3,3,3,3,2,2,2, %T A385393 3,3,3,3,4,3,3,3,4,4,4,4,4,3,3,3,4,3,4,4,4,3,3,3,4,3,3,3,3,2,2,2,3,3, %U A385393 3,3,4,3,3,3,4,4,4,4,4,3,3,3,4,4,4,4,5 %N A385393 a(n) = (Sum_{k=0..n} (binomial(n, k) mod 4)) / 2^bitcount(n). %C A385393 Apparently 2^bitcount(n) divides Sum_{k=0..n} (binomial(n, k) mod m) only if m is a power of 2. %F A385393 a(n) = A384715(n) / 2^A000120(n). %F A385393 a(n) = A384715(n) / A001316(n). %p A385393 a := n -> local j; add(modp(binomial(n, j), 4), j=0..n) / 2^add(convert(n, base, 2)): seq(a(n), n = 0..86); %t A385393 Table[Sum[Mod[Binomial[n, k], 4], {k, 0, n}]/2^DigitCount[n, 2, 1], {n, 0, 105}] (* _Michael De Vlieger_, Jun 27 2025 *) %t A385393 A385393[n_] := StringCount[#, "10"] + Boole[StringContainsQ[#, "11"]] + 1 & [IntegerString[n, 2]]; Array[A385393,100,0] (* _Paolo Xausa_, Jun 28 2025 *) %o A385393 (Python) %o A385393 def a(n: int) -> int: %o A385393 b = bin(n)[2:] %o A385393 return 1 + b.count("10") + int("11" in b) %o A385393 print([a(n) for n in range(75)]) %o A385393 (Python) %o A385393 def A385393(n): return (((m:=n>>1)&~n).bit_count()+bool(n&m)+1) # _Chai Wah Wu_, Jun 28 2025 %o A385393 (PARI) a(n) = sum(k=0, n, binomial(n, k) % 4) / 2^hammingweight(n); \\ _Michel Marcus_, Jun 28 2025 %Y A385393 Cf. A000120, A001316, A384715, A385394. %K A385393 nonn %O A385393 0,3 %A A385393 _Peter Luschny_, Jun 27 2025