If perfect means as few collisions as possible, you can just do $f(n)=(n \pmod N)/10$ where the divide is integer division. You have to have $10$ of each number in the range $[1,N]$ mapped to each hash value, which this does.
Often we also ask that hash functions be such that one cannot reasonably predict the hash from the number to be hashed, nor invert it to find a number that will match a given hash. If you want that as well, just take any current cryptographic hash function (which will presumably return a number much larger than $\frac N{10}$), then take the output $\bmod \frac N{10}$