|
|
A136480
|
|
Number of trailing equal digits in binary representation of n.
|
|
20
|
|
|
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.
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
|
|
|
FORMULA
|
a(2*n + n mod 2) = a(n) + 1.
For n>0: a(n) = A007814(n + n mod 2).
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=0..m} a(k) = 2. - Amiram Eldar, Sep 15 2022
|
|
MAPLE
|
if n = 0 then
1;
else
end if;
end proc:
|
|
MATHEMATICA
|
Length[Last[Split[IntegerDigits[#, 2]]]]&/@Range[0, 140] (* Harvey P. Dale, Mar 31 2011 *)
|
|
PROG
|
(Haskell)
a136480 0 = 1
(JavaScript)
for (n=1; n<120; n++) {
m=n*n+n;
c=0;
while (m%2==0) {m/=2; c++; }
document.write(c+", ");
(Python)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|