elroy said:
Whodunit explained it well. If you'll notice, the numbers are not chosen randomly. They are similar in some respect to the way the respective letter is written in Arabic - or at least they're the most similar (after all, we only have 10 characters to choose from!

).
Completely correct, but I want to explain it a bit further, since it is not easy to see how a 3 is equal to the letter ع, as I had the same problem at the beginning.
This may help for the beginning.
2 - أ, ء looks like a mirrored 2
3 - ع looks like a mirrored 3
5 - ح, خ look like very similar to a 5 (خ is mostly replaced by kh, ch, or x, and since 7 is used for ح, one doesn't use the number 5 that often)
6 - ط looks like a deformed 6
7 - ح looks like a mirrored 7