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 A302436 #11 Apr 15 2018 15:03:20 %S A302436 1,1,2,1,4,3,2,1,8,7,6,3,4,3,2,1,16,15,14,7,12,9,6,3,8,7,6,3,4,3,2,1, %T A302436 32,31,30,15,28,21,14,7,24,21,18,9,12,9,6,3,16,15,14,7,12,9,6,3,8,7,6, %U A302436 3,4,3,2,1,64,63,62,31,60,45,30,15,56,49,42,21 %N A302436 a(n) is the number of ways of writing the binary expansion of n as a concatenation of nonempty substrings with Hamming weight at most 1. %C A302436 Leading zeros in the binary expansion of n are ignored. %C A302436 The value a(0) = 1 corresponds to the empty concatenation. %C A302436 See A301453 for similar sequences. %H A302436 Rémy Sigrist, <a href="/A302436/b302436.txt">Table of n, a(n) for n = 0..10000</a> %F A302436 a(2^n - 1) = 1 for any n >= 0. %F A302436 a(2^n) = 2^n for any n >= 0. %F A302436 a(2*n) = 2*a(n) for any n > 0. %e A302436 For n = 9: the binary expansion of 9, "1001", can be split in 7 ways into nonempty substrings with Hamming weight at most 1: %e A302436 - (100)(1), %e A302436 - (10)(01), %e A302436 - (10)(0)(1), %e A302436 - (1)(001), %e A302436 - (1)(00)(1), %e A302436 - (1)(0)(01), %e A302436 - (1)(0)(0)(1). %e A302436 Hence a(9) = 7. %o A302436 (PARI) a(n) = if (n==0, return (1), my (v=0, h=0); while (n, h += n%2; n\=2; if (h>1, break, v+=a(n))); return (v)) %Y A302436 Cf. A301453. %K A302436 nonn,base %O A302436 0,3 %A A302436 _Rémy Sigrist_, Apr 08 2018