OFFSET
0,3
COMMENTS
Leading zeros in the binary expansion of n are ignored.
The value a(0) = 1 corresponds to the empty concatenation.
See A301453 for similar sequences.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10000
FORMULA
EXAMPLE
For n = 14: the binary expansion of 14, "1110", can be split in 6 ways into substrings with Hamming weight at most 2:
- (11)(10),
- (11)(1)(0),
- (1)(110),
- (1)(11)(0),
- (1)(1)(10),
- (1)(1)(1)(0).
Hence a(14) = 6.
PROG
(PARI) a(n) = if (n==0, return (1), my (v=0, h=0); while (n, h += n%2; n\=2; if (h>2, break, v += a(n))); return (v))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 08 2018
STATUS
approved