You must be referring to the quick way to determine whether a given integer is divisible by 3; that is, 3 divides an integer

whenever the digits of

sum to a multiple of 3.
Suppose

has

digits. We can expand it as a sum of the numbers in any given digits place by the corresponding power of 10. For example, if

, we can write

More generally, if

(where

denotes the numeral in the

-th's place), then we have the expansion

Notice that for any integer

, we have

which is clearly divisible by 3. So from each power of 10 in the expansion of

, we can add and subtract 1, then rearrange the terms of the sum:



We know

is divisible by 3, which means the remainder upon dividing

by 3 is just the sum of the digits of

. If this remainder is divisible by 3, then so must be the original number,

.
Back to our previous example: if

, then we have the expansion



Dividing through by 3, we get a remainder of

, which is divisible by 3, and so 2148 must also be a multiple of 3.
In case for some reason you're not convinced 15 is a multiple of 3, you can apply the same trick:


Dividing through by 3 leaves a remainder of

, which is also a multiple of 3, so that 15 must be, too.