HOME

TheInfoList



OR:

In
number theory Number theory (or arithmetic or higher arithmetic in older usage) is a branch of pure mathematics devoted primarily to the study of the integers and arithmetic function, integer-valued functions. German mathematician Carl Friedrich Gauss (1777� ...
, the ruler function of an integer n can be either of two closely-related functions. One of these functions counts the number of times n can be evenly divided by two, which for the numbers 1, 2, 3, ... is Alternatively, the ruler function can be defined as the same numbers plus one, which for the numbers 1, 2, 3, ... produces the sequence As well as being related by adding one, these two sequences are related in a different way: the second one can be formed from the first one by removing all the zeros, and the first one can be formed from the second one by adding zeros at the start and between every pair of numbers. For either definition of the ruler function, the rising and falling patterns of the values of this function resemble the lengths of marks on
ruler A ruler, sometimes called a rule, line gauge, or scale, is a device used in geometry and technical drawing, as well as the engineering and construction industries, to measure distances or draw straight lines. Variants Rulers have long ...
s with traditional units such as
inch Measuring tape with inches The inch (symbol: in or ″) is a unit of length in the British imperial and the United States customary systems of measurement. It is equal to yard or of a foot. Derived from the Roman uncia ("twelfth") ...
es. These functions should be distinguished from
Thomae's function Thomae's function is a real-valued function of a real variable that can be defined as: f(x) = \begin \frac &\textx = \tfrac\quad (x \text p \in \mathbb Z \text q \in \mathbb N \text\\ 0 &\textx \text \end It is named after Carl Jo ...
, a function on
real number In mathematics, a real number is a number that can be used to measure a ''continuous'' one-dimensional quantity such as a distance, duration or temperature. Here, ''continuous'' means that values can have arbitrarily small variations. Every real ...
s which behaves similarly to the ruler function when restricted to the
dyadic rational number In mathematics, a dyadic rational or binary rational is a number that can be expressed as a fraction whose denominator is a power of two. For example, 1/2, 3/2, and 3/8 are dyadic rationals, but 1/3 is not. These numbers are important in computer ...
s. In advanced mathematics, the 0-based ruler function is the 2-adic valuation of the number, and the lexicographically earliest infinite square-free word over the natural numbers. It also gives the position of the bit that changes at each step of the
Gray code The reflected binary code (RBC), also known as reflected binary (RB) or Gray code after Frank Gray, is an ordering of the binary numeral system such that two successive values differ in only one bit (binary digit). For example, the representati ...
. In the
Tower of Hanoi The Tower of Hanoi (also called The problem of Benares Temple or Tower of Brahma or Lucas' Tower and sometimes pluralized as Towers, or simply pyramid puzzle) is a mathematical game or puzzle consisting of three rods and a number of disks of va ...
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. A simulation of the puzzle, in conjunction with other methods for generating its optimal sequence of moves, can be used in an algorithm for generating the sequence of values of the ruler function in
constant time In computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations performed by ...
per value.


References


External links

* {{MathWorld, id=RulerFunction Calculus Special functions Number theory