Primitive recursive functions are a class of total computable functions built from zero, successor, and projection functions using composition and primitive recursion (bounded loops). All standard arithmetic operations, exponentiation, and factorial are primitive recursive. However, the class does not capture all computable functions — the Ackermann function grows faster than any primitive recursive function and is a canonical example that lies strictly outside this class.
Define addition, multiplication, and exponentiation from scratch using only the base functions and the two operations. Then study the Ackermann function to develop intuition for why unbounded search (minimization) is needed to capture all computable functions.
From your study of mathematical induction, you know how to define something by referring to smaller cases: to show P(n) holds for all n, prove the base case and the inductive step. Primitive recursive functions formalize this same idea for *computation*. Instead of proving a property, you *compute a value* by specifying what the function returns at 0 and how to compute f(n+1) from f(n) (and possibly n itself). This is the primitive recursion scheme, and it is exactly a computational analogue of induction.
The class of primitive recursive functions starts from three elementary building blocks: the zero function Z(n) = 0, the successor function S(n) = n + 1, and projection functions P^k_i(x_1, …, x_k) = x_i. These are clearly computable. Two operations then build up the rest: composition (plug functions into functions) and primitive recursion (define f(0, x⃗) = g(x⃗) and f(n+1, x⃗) = h(n, f(n, x⃗), x⃗) for given g and h). Both operations preserve computability and totality, so everything built this way is a well-behaved total function.
Starting from these primitives, you can derive all of ordinary arithmetic. Addition is primitive recursive: add(0, y) = y and add(n+1, y) = S(add(n, y)). Multiplication follows from addition, exponentiation from multiplication, factorial from multiplication plus predecessor. Even more exotic functions — like the characteristic function of primality, or bounded search over a finite range — fall within the class. The term "primitive" is misleading: this class captures nearly every function you encounter in a first algorithms course.
But the class has a genuine limit. The Ackermann function A(m, n) grows faster than any primitive recursive function — for each primitive recursive f, there is some point beyond which A dominates f. The intuition is that primitive recursion only allows loops whose depth is fixed in advance (the recursion decreases a single argument). The Ackermann function requires nested recursion of unbounded depth, which escapes any fixed primitive recursion scheme. This is why primitive recursive functions are not all computable functions — there exist total computable functions outside the class, and capturing them requires the μ-operator (the subject of the next topic). Every primitive recursive function is computable, but not every computable function is primitive recursive.