Analyzing the Setup
We are tasked with finding the number of integers n in the range 1000≤n≤9999 such that gcd(n,18)=3.
First, we perform the prime factorization of
18:
18=2×32
For gcd(n,18)=3 to hold, n must be a multiple of 3, but it must satisfy two specific constraints to prevent the GCD from being larger than 3:
1. n must not be divisible by 2 (it must be odd).
2. n must not be divisible by 9 (it must contain exactly one factor of 3).
Counting Odd Multiples of 3
We define the set of odd multiples of 3 in the range [1000,9999]. The first such number is 1005, and the last is 9999.
Since we require odd multiples, we skip even multiples of 3 (which are multiples of 6). Thus, the common difference d for this arithmetic progression is 6.
Using the formula for the
k-th term,
l=a+(k−1)d:
9999=1005+(k−1)6
8994=(k−1)6
1499=k−1
k=1500
Removing the Intruders
We must now subtract the multiples of 9 that are also odd, as these violate the condition gcd(n,18)=3. These are numbers of the form 9×(odd number).
The first such number is 9×113=1017, and the last is 9×1111=9999. The common difference for this sequence is 18.
Using the formula
l=a+(m−1)d:
9999=1017+(m−1)18
8982=(m−1)18
499=m−1
m=500
Final Calculation
The number of valid integers is the total count of odd multiples of
3 minus the count of odd multiples of
9:
Total=k−m
Total=1500−500
Total=1000
The number of such integers n is 1000.