Given: X={first 2018 terms of 1,6,11,…}
Y={first 2018 terms of 9,16,23,…}
To find: ∣X∪Y∣
Plan:1. write general terms of both APs
2. form the congruence for a common term
3. count them→∣X∪Y∣=∣X∣+∣Y∣−∣X∩Y∣
X: a=1, d=6−1=5
Y: a=9, d=16−9=7
xn=1+(n−1)⋅5=5n−4
yn=9+(n−1)⋅7=7n+2
Common term n must satisfy:
n≡1(mod5),n≡2(mod7)
n=1+5t(so n≡1(mod5))
1+5t≡2(mod7)⇒5t≡1(mod7)
Inverse of 5(mod7) is 3(5⋅3=15≡1)
t≡3(mod7)
t=3+7k(k∈Z)
n=1+5(3+7k)=16+35k
x2018=1+2017⋅5=10086
y2018=9+2017⋅7=14128
16+35k≤10086
35k≤10070⇒k≤287.71
k=287: 16+35⋅287=10061≤10086 ✓
k=288: 16+35⋅288=10096>10086 ×
k=0,1,2,…,287
Number of common terms=288
∣X∪Y∣=∣X∣+∣Y∣−∣X∩Y∣
=2018+2018−288
=4036−288
∣X∪Y∣=3748