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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A136480 Number of trailing equal digits in binary representation of n. 16
1, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 4, 4, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 5, 5, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 4, 4, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 6, 6, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 4, 4, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 5, 5, 1, 1, 2, 2, 1, 1, 3, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

a(even) = number of trailing binary zeros;

a(odd) = number of trailing binary ones;

a(n) = A050603(n-1) for n>0;

a(2*n + n mod 2) = a(n) + 1.

For n>0, power of 2 associated with n^2 + n, e.g. n=4 gives 20, so a(4)=2. - Jon Perry, Sep 12 2014

LINKS

James Spahlinger, Table of n, a(n) for n = 0..10000

Index entries for sequences related to binary expansion of n

FORMULA

For n>0: a(n) = A007814(n + n mod 2).

MATHEMATICA

Length[Last[Split[IntegerDigits[#, 2]]]]&/@Range[0, 140]  (* Harvey P. Dale, Mar 31 2011 *)

PROG

(PARI) a(n)=if (n, valuation(n+n%2, 2), 1) \\ Charles R Greathouse IV, Oct 14 2013

(Haskell)

a136480 0 = 1

a136480 n = a007814 $ n + mod n 2  -- Reinhard Zumkeller, Jul 22 2014

(JavaScript)

for (n=1; n<120; n++) {

m=n*n+n;

c=0;

while (m%2==0) {m/=2; c++; }

document.write(c+", ");

}  - Jon Perry, Sep 12 2014

CROSSREFS

Cf. A050603, A094267, A163575, A001511.

Sequence in context: A064894 A003638 A094267 * A050603 A286554 A037162

Adjacent sequences:  A136477 A136478 A136479 * A136481 A136482 A136483

KEYWORD

nonn,base,easy

AUTHOR

Reinhard Zumkeller, Dec 31 2007

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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified February 22 23:32 EST 2018. Contains 299472 sequences. (Running on oeis4.)