What is the math behind this trick?

There’s obviously a formula forthis.

It’s a variation of the multiples of 9 trick

http://www.snopes.com/humor/iftrue/psychic.htm

Thanks!