editing
approved
Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
editing
approved
Table[SequenceCount[IntegerDigits[n, 2], {1, 0}], {n, 110}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 26 2017 *)
approved
editing
editing
approved
editing
proposed
a(n) = A087116(n) for n > 0 since strings of 0s alternate with strings of 1s, which end in (1,0). - Jonathan Sondow, Jan 17 2016
approved
editing
proposed
approved
editing
proposed
f:= proc(n) option remember; local k;
k:= n mod 4;
if k = 2 then procname((n-2)/4) + 1
elif k = 3 then procname((n-3)/4)
else procname((n-k)/2)
fi
end proc:
f(1):= 0: f(0):= q:
seq(f(i), i=1..100); # Robert Israel, Aug 31 2015
proposed
editing
editing
proposed