OFFSET
0,4
COMMENTS
All terms are even. Used by the "number-of-runs beanstalk" sequence A255056 and many of its associated sequences.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..8192
MAPLE
A236840 := proc(n) local i, b; if n=0 then 0 else b := convert(n, base, 2); select(i -> (b[i-1]<>b[i]), [$2..nops(b)]); n-1-nops(%) fi end: seq(A236840(i), i=0..69); # Peter Luschny, Apr 19 2014
MATHEMATICA
a[n_] := n - Length@ Split[IntegerDigits[n, 2]]; a[0] = 0; Array[a, 100, 0] (* Amiram Eldar, Jul 16 2023 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Apr 18 2014
STATUS
approved