Instead of using division, could you use modulus? (The % operator) Which returns the Remainder.
So:
1 % 17 = 1
5 % 17 = 5
17 % 17 = 0
20 % 17 = 3
34 % 17 = 0
51 % 17 = 0
And that way, just check when i % 17 = 0 (meaning the i value is divisible by 17 with no remainder) and fire the event then?