This was a question from a test. There's a set $A$ with elements $\{1,2,3,4,5\}$ and another set $B$ with elements $\{0,1,2,3,4,5\}$. Now $f$ is a function from $A$ to $B$ such that $f(1)$ is not equal to $0$ or $1$ and $f(i)$ is not equal to $i$ (for $i=2,3,4,5$). Then how many such one to one functions are possible?
It looks like an application of the derangement formula, but it's getting way too complex when I apply it. Can anyone help me out in this?