How to use this calculator
Count how many factors of two divide a nonzero integer exactly.
- Enter Nonzero integer. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
How Power-of-two factor count calculator works
Count how many factors of two divide a nonzero integer exactly.
Inputs and units
- Nonzero integer: Enter a nonzero safe integer; its sign does not affect the number of factors of two.
Formula and method
v₂(n)=k when 2ᵏ divides n but 2ᵏ⁺¹ does not. Equivalently, n=2ᵏq for odd q.
Worked example
40=2³·5, so v₂(40)=3.
Interpreting the result
The output counts repeated divisions by two before the quotient becomes odd.
Assumptions and limits
Zero is excluded because every power of two divides zero, so it has no finite 2-adic valuation. Inputs must be exactly represented safe integers. The tool reports an integer valuation, not the power-of-two factor itself.
Sources and method
- For nonzero integers, v₂(n) is the exponent of 2 in the prime factorization; v₂(0) is infinite. Encyclopedia of Mathematics: p-adic valuation
Frequently asked questions
What is v₂(−40)?
It is 3, because the sign does not change divisibility by two.
Why is zero invalid?
There is no largest finite exponent k for which 2ᵏ divides zero.
How do I use the Power-of-two factor count calculator?
Enter Nonzero integer. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Power-of-two factor count?
40=2³·5, so v₂(40)=3.
What does the Power-of-two factor count calculator calculate?
Count how many factors of two divide a nonzero integer exactly.