OFFSET
1,7
LINKS
Ralf Stephan, Some divide-and-conquer sequences ...
Ralf Stephan, Table of generating functions
FORMULA
From Ralf Stephan, Oct 05 2003: (Start)
G.f.: -1/(1-x) + 1/(1-x) * Sum_{k>=0} (t + t^3 + t^4)/(1 + t + t^2 + t^3), t=x^2^k).
a(n) = b(n) - 1, with b(0)=0, b(2n) = b(n) + [n even], b(2n+1) = b(n) + 1. (End)
EXAMPLE
The base-2 representation of n=4 is 100 with d(0)=0, d(1)=0, d(2)=1. There is one fall-or-equal from d(0) to d(1), so a(4)=1. - R. J. Mathar, Oct 16 2015
MAPLE
A037809 := proc(n)
a := 0 ;
dgs := convert(n, base, 2);
for i from 2 to nops(dgs) do
if op(i, dgs)<=op(i-1, dgs) then
a := a+1 ;
end if;
end do:
a ;
end proc: # R. J. Mathar, Oct 16 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Sign in Name corrected by R. J. Mathar, Oct 16 2015
STATUS
approved