Ruler function
This article, Ruler function, has recently been created via the Articles for creation process. Please check to see if the reviewer has accidentally left this template after accepting the draft and take appropriate action as necessary.
Reviewer tools: Inform author |

In number theory, the ruler function of an integer can be either of two closely-related functions. One of these functions counts the number of times can be evenly divided by two, which for the numbers 0, 1, 2, ... is
Alternatively, the ruler function can be defined as the same numbers plus one, which for the numbers 0, 1, 2, ... produces the sequence
For either definition of the ruler function, the rising and falling patterns of the values of this function resemble the lengths of marks on rulers with traditional units such as inches.
In advanced mathematics, the 0-based ruler function is the 2-adic valuation of the number.
In the Tower of Hanoi puzzle, with the disks of the puzzle numbered in order by their size, the 1-based ruler function gives the number of the disk to move at each step in an optimal solution to the puzzle.