Use the modulus operator, which, in simple terms, gets the remainder after division.
https://msdn.microsoft.com/en-us/library/0w4e0fzs.aspx
If the remainder is 0, then you know the number is divisible by 3:
if(waveCounter % 3 == 0)
{
//do something
}