Need gcd(n,107)=103, with 1≤n≤107.
Since 103 divides n, write n=103⋅m for some positive integer m.
From n≤107:
m≤104
Also, gcd(103⋅m,107)=103⋅gcd(m,104).
For this to equal 103, we need:
gcd(m,104)=1
Since 104=24⋅54, this just means m is coprime to 10.
Count integers m in [1,104] coprime to 10. The fraction of such integers is:
(1−21)(1−51)=21⋅54=52
Required count =104⋅52=4000
Answer =4000