Problem: find how many positive integers less than 10000 are there such thatthe sum of the digits of the no . is divisible by 3 ?
Rationale: if sum of the digits is divisible by 3 , the number is divisible by 3 . therefore , required number of non - negative integers is equal to count of numbers less than 10000 which are divisible by 3 . such numbers are ( 3 , 6 , 9 , . . . , 9999 ) ( arithmetic progression with first term = 3 , last term = 9999 , common difference = 3 ) . count of such numbers = 9999 3 = 3333 99993 = 3333 but zero is also divisible by 3 . this makes our total count 3334 d
annotated_formula: add(floor(divide(10000, 3)), const_1)