This is a little puzzle I heard a while back from one of my mathematically inclined friends- I get the sense that it's bounced around a little, so forgive me if you've heard it.
There is a sort of function that, given any positive whole number, will return another positive whole number. Interestingly, there is one number that will return itself- the number 4. There are no other loops of any size, so you can start at any other number and, by repeatedly plugging in the output of the function, you will eventually reach 4.
Given this diagram showing a few examples of those succession chains, determine the function.
(If anyone feels like they really need more information, you can post a number in the comments and I'll give you its chain. However, the givens are sufficient to find a solution.)