Official solution
S = {1, 2, 3, .......... 2022}
HCF (n, 2022) = 1
\[\Rightarrow\] n and 2022 have no common factor
Total elements = 2022
2022 = 2 \[\times\] 3 \[\times\] 337
M : numbers divisible by 2.
{2, 4, 6, ........, 2022}\[\,\,\,\,\] n(M) = 1011
N : numbers divisible by 3.
{3, 6, 9, ........, 2022}\[\,\,\,\,\] n(N) = 674
L : numbers divisible by 6.
{6, 12, 18, ........, 2022}\[\,\,\,\,\] n(L) = 337
n(M \[\cup\] N) = n(M) + n(N) - n(L)
= 1011 + 674 - 337
= 1348
0 = Number divisible by 337 but not in M \[\cup\] N
{337, 1685}
Number divisible by 2, 3 or 337
= 1348 + 2 = 1350
Required probability \[ = {{2022 - 1350} \over {2022}}\]
\[ = {{672} \over {2022}}\]
\[ = {{112} \over {337}}\]