# Successor function

In mathematics, the successor function or successor operation is a primitive recursive function defined by

$S(n)=n+1. \,$

We have S(1) = 1 + 1 = 2, S(S(1)) = 2 + 1 = 3, ...

The successor function is used in the Peano axioms which define the natural numbers. As such, it is not defined by addition, but rather is used to define all natural numbers beyond 0, as well as addition. For example, 1 is defined to be S(0), and addition on natural numbers is defined recursively by:

$m+0=m$
$m+S(n)=S(m)+n$

This yields 5 + 2 = 5 + S(1) = S(5) + 1 = 6 + 1 = 6 + S(0) = S(6) + 0 = 7 + 0 = 7

It is also one of the primitive functions used in the characterization of computability by recursive functions.