A pairing function is a computable bijection from to whose inverse coordinate functions are also computable. Iterating it gives computable encodings of every fixed finite tuple of nonnegative integers.
The bracket enumerates the positive integers not divisible by . Every positive integer has exactly one decomposition into a power of times such an integer, so this formula is a bijection from to . Subtracting one in the codomain includes zero without requiring a trailing-zero convention for its decimal representation. For the inverse, write with , then .

Articles by others on the same topic (1)

A pairing function is a mathematical function that uniquely maps pairs of natural numbers (or non-negative integers) to a single natural number. This concept is particularly useful in various areas of mathematics and computer science, especially in combinatorics and theoretical computer science. Pairing functions can be used to encode two-dimensional data into one-dimensional data, making it easier to work with.