login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A037809 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. 2

%I #19 Apr 14 2021 05:23:16

%S 0,0,1,1,1,1,2,2,2,1,2,2,2,2,3,3,3,2,3,2,2,2,3,3,3,2,3,3,3,3,4,4,4,3,

%T 4,3,3,3,4,3,3,2,3,3,3,3,4,4,4,3,4,3,3,3,4,4,4,3,4,4,4,4,5,5,5,4,5,4,

%U 4,4,5,4,4,3,4,4,4,4,5,4,4,3,4,3,3,3,4,4,4,3

%N 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.

%H Ralf Stephan, <a href="/somedcgf.html">Some divide-and-conquer sequences ...</a>

%H Ralf Stephan, <a href="/A079944/a079944.ps">Table of generating functions</a>

%F From _Ralf Stephan_, Oct 05 2003: (Start)

%F 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).

%F a(n) = A056973(n) + A000120(n) - 1.

%F a(n) = b(n) - 1, with b(0)=0, b(2n) = b(n) + [n even], b(2n+1) = b(n) + 1. (End)

%e 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

%p A037809 := proc(n)

%p a := 0 ;

%p dgs := convert(n,base,2);

%p for i from 2 to nops(dgs) do

%p if op(i,dgs)<=op(i-1,dgs) then

%p a := a+1 ;

%p end if;

%p end do:

%p a ;

%p end proc: # _R. J. Mathar_, Oct 16 2015

%Y Cf. A033265.

%K nonn,base

%O 1,7

%A _Clark Kimberling_

%E Sign in Name corrected by _R. J. Mathar_, Oct 16 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 29 22:36 EDT 2024. Contains 374734 sequences. (Running on oeis4.)