You are not even using the modulos operator, so I have no idea how you are even attempting to solve this.
What do you know if the number is a multiple of 3?
You know that if 81 is a multiple of 3, then 78, 75, 72, 69, 66, ..., 3 are all multiples of the number 3. What pattern is common in all those numbers?
The sum of all numbers 3 to N which are multiples of the number 3 is:
= 1 * 3 + 2 * 3 + 3 * 3 + 4 * 3 + ... + N
= 3 (1 + 2 + 3 + 4 + ... + N / 3)
We can now apply gauss's sum of series method to this to obtain the formula:
= (3 / 2) * (N / 3 * (N / 3 + 1))
sum of series http://mathcentral.uregina.ca/QQ/database/QQ.02.06/jo1.html
If you sub in 81 for N, you get 1134
You can now choose to re-curse until you find a number which is a multiple of 3, then apply the above formula