@Mat'sMug i'd be tempted to close. they say, "I didn't really understand the third argument of the pow function it took here, and I still don't." -- a quick google gives
this page "
pow(x, y[, z])
Return x to the power y; if z is present, return x to the power y, modulo z (computed more efficiently than pow(x, y) % z)"