22. A year is called a leap year if it is either divisible by 4 but not divisible by 100 , or divisible by 400 . Hence, the years 2000, 2004 and 2400 are leap years while the years 2006, 2100 and 2200 are not. Find the number of leap years between 2000 and 4000 inclusive.
22. Ans: 486

Let $S=\{x \in \mathbb{Z} \mid 2000 \leq x \leq 4000\}, A=\{x \in S \mid x$ is divisible by 4$\}, B=\{x \in S \mid$ $x$ is divisible by 100$\}, C=\{x \in S \mid x$ is divisible by 400$\}$. The required answer is
$$
|A|-|B|+|C|=\left(\frac{4000}{4}-\frac{2000}{4}+1\right)-\left(\frac{4000}{100}-\frac{2000}{100}+1\right)+\left(\frac{4000}{400}-\frac{2000}{400}+1\right)=486
$$