login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A037834 Sum{|d(i)-d(i-1)|: i=1,...,m}, where Sum{d(i)*2^i: i=0,1,...,m} is base 2 representation of n. 20
0, 1, 0, 1, 2, 1, 0, 1, 2, 3, 2, 1, 2, 1, 0, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 1, 2, 1, 0, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 1, 2, 1, 0, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2, 3, 4, 5, 4, 5, 6, 5, 4, 3, 4, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,5

COMMENTS

Number of i such that |d(i)-d(i-1)|=1, where Sum{d(i)*2^i: i=0,1,...,m} is base 2 representation of n.

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

Index entries for sequences related to binary expansion of n

MAPLE

A037834 := proc(n)

    local dgs ;

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

    add( abs(op(i, dgs)-op(i-1, dgs)), i=2..nops(dgs)) ;

end proc: # R. J. Mathar, Oct 16 2015

MATHEMATICA

Table[Total@ Flatten@ Map[Abs@ Differences@ # &, Partition[ IntegerDigits[n, 2], 2, 1]], {n, 90}] (* Michael De Vlieger, May 09 2017 *)

PROG

(Haskell)

a037834 n = sum $ map fromEnum $ zipWith (/=) (tail bs) bs

            where bs = a030308_row n

-- Reinhard Zumkeller, Feb 20 2014

CROSSREFS

A005811(n)-1.

Cf. A030308.

Sequence in context: A196199 A053615 A002819 * A212496 A179765 A004074

Adjacent sequences:  A037831 A037832 A037833 * A037835 A037836 A037837

KEYWORD

nonn,base

AUTHOR

Clark Kimberling

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 21 22:12 EDT 2019. Contains 322328 sequences. (Running on oeis4.)