|
|
A033265
|
|
Number of i such that d(i) >= d(i-1), where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n.
|
|
9
|
|
|
0, 1, 1, 2, 1, 2, 2, 3, 2, 2, 2, 3, 2, 3, 3, 4, 3, 3, 3, 3, 2, 3, 3, 4, 3, 3, 3, 4, 3, 4, 4, 5, 4, 4, 4, 4, 3, 4, 4, 4, 3, 3, 3, 4, 3, 4, 4, 5, 4, 4, 4, 4, 3, 4, 4, 5, 4, 4, 4, 5, 4, 5, 5, 6, 5, 5, 5, 5, 4, 5, 5, 5, 4, 4, 4, 5, 4, 5, 5, 5, 4, 4, 4, 4, 3, 4, 4, 5, 4, 4
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
LINKS
|
|
|
FORMULA
|
a(0) = 0, a(2n) = a(n) + 1, a(2n+1) = a(n) + [n odd].
G.f. 1/(1-x) * Sum_{k>=0} (t^2 + t^3 + t^4)/((1+t)*(1+t^2)), t=x^2^k). (End)
|
|
EXAMPLE
|
The base-2 representation of n=4 is 100 with d(0)=0, d(1)=0, d(2)=1. There are two rise-or-equal, one from d(0) to d(1) and one from d(1) to d(2), so a(4)=2. - R. J. Mathar, Oct 16 2015
|
|
MAPLE
|
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 ;
|
|
PROG
|
(PARI) A033265(n) = { my(i=0); while(n>1, if((n%4)!=1, i++); n >>= 1); (i); }; \\ Antti Karttunen, Aug 06 2023
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|