# Function(al) Puzzle

Let $f(x)$ be a function such that

• $f(1111)=4$
• $f(1234)=3$
• $f(4567)=2$
• $f(1357)=4$
• $f(6518)=4$
• $f(3817)=6$
• $f(8008)=6$
• $f(1000)=4$

Then, $f(2014)=\,\,?$

(Hint: Each digit is valuable.)

$~~~f(2014)=2$
The digits $0,1,2,3,4,5,6,7,8$ respectively contribute $1,1,0,2,0,0,1,1,2$ to the function value; that is $f(0)=1$, $f(1)=1$, $f(2)=0$, $\ldots$, $f(8)=2$.
With this, $f(2014)=f(2)+f(0)+f(1)+f(4)=0+1+1+0=2$.