# How many of the prime factors of an even number are 2?

I'm trying to concisely write an expression for a sequence which flips a switch $n$ times where $n$ is the number of times 2 divides evenly into $n$, so the first 24 values are:

01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
0  1  0  0  0  1  0  1  0  0  0  0  0  1  0  0  0  1  0  0  0  1  0  1


Is there a name for the "super-evenness" of something?

So far, the best I've been able to do is define the quantity $k$ such that $n = 2^{k}m$ with $n, k, m \in \mathbb{Z}$. You can technically evaluate this by solving the equation $\mathrm{log_{2}}(n) = k + \mathrm{log_{2}}(m)$, though this isn't a particularly useful algorithm.

I suppose this is OK, but it'd be much nicer if there were a simpler function which doesn't involve solving for integers from logarithms. Plus there's a disconnect between that equation, which precisely defines the sequence, and the algorithm people would use to find it (which is going to be 'divide by 2 until you hit an odd number').

-
In many places it is called $\mbox{ord}_2(n).$ In other places it is called $v_2(n),$ where the letter $v$ stands for "valuation." The reliable way to find it is to divide by 2 until the result is odd, having kept count of the number of times you did that. Oh, the name is the 2-adic valuation of $n.$ I guess you could make a name out of the word "order." –  Will Jagy Apr 3 '13 at 23:39
Perfect! This is basically all I needed. If you want to add this as an answer instead of a comment I can accept it. I had a hunch it was something to do with p-adic, but I'm not a mathematician, so I didn't really know how to find the answer. –  Paul Apr 3 '13 at 23:45
It is easier if you don't count multiplicity. Then the answer is one. :) –  Ross Millikan Apr 3 '13 at 23:46
@Ross: My first thought when I saw the title was "I should post a comment that simply says 'One.'" –  Cameron Buie Apr 4 '13 at 0:21

In many places it is called $\mbox{ord}_2(n).$ In other places it is called $v_2(n),$ where the letter $v$ stands for "valuation." The reliable way to find it is to divide by 2 until the result is odd, having kept count of the number of times you did that. Oh, the name is the 2-adic valuation of $n.$ I guess you could make a name out of the word "order."