OFFSET
1,3
COMMENTS
There are A103295(k) terms with k binary digits (ignoring leading zeros).
LINKS
EXAMPLE
The binary expansion of 35 is "100011", the corresponding run lengths are (1, 3, 2); the sums 1, 2, 3, 1+3, 3+2, 1+3+2 cover the positive integers between 1 and 6, hence 35 is a term.
PROG
(PARI) toruns(n) = { my (r = []); while (n, my (v = valuation(n+n%2, 2)); n \= 2^v; r = concat(v, r)); r }
is(n) = { my (r = toruns(n)); #setbinop((i, j) -> vecsum(r[i..j]), [1..#r])==vecsum(r); }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Sep 22 2024
STATUS
approved