Get a current version of TikZ TikZ and use \pgfmathmod!
Get a current version of TikZ and use \pgfmathmod!