I think this will work well for cases where the divisor is fixed and hardcoded. For the dynamic case of a % b == 0 it's probably not a good idea because fetching numbers from the array in RAM is much much more expensive than doing mod.
I think this will work well for cases where the divisor is fixed and hardcoded. For the dynamic case of a % b == 0 it's probably not a good idea because fetching numbers from the array in RAM is much much more expensive than doing mod.