FOR a = 0 TO 9
FOR b = 0 TO 9
FOR d = 0 TO 9
s = a + b + d
IF s MOD 3 = 0 THEN ct = ct + 1
NEXT
NEXT
NEXT
PRINT ct
finds 334, disregarding c.
Any of the ten possible values of c will not affect the divisibility by 3 as the coefficient 6 ensures the entire term is divisible by 3.
The total number of ordered quadruplets meeting the criterion is 3340.
|
Posted by Charlie
on 2014-04-09 12:35:01 |