Let A= set of all four digit integers divisible by 7.
and B= set of all four digit integers divisible by 3.
Total number of 4 digits numbers =9×10×10×10=9000
Let n(A)=x
1001+(x−1)7=9996
⇒x=1286
Let n(B)=y
1002+(y−1)3=9999
⇒y=3000
Let n(A∩B)=z
1008+(z−1)21=9996
⇒z=429
n(A∪B)=n(A)+n(B)−n(A∩B) =1286+3000−429=3857
⇒n(¯¯¯¯¯¯¯¯¯¯¯¯¯¯A∪B)=9000−3857=5143