Note that for finite domains, finding an algebraic formula that gives the output for any input is often impossible. Of course we could use a piecewise defined function, like
This describes exactly the same function as above, but we can all agree is a ridiculous way of doing so.
in-context