number theoRY!!!
posted by please..anyone help!! on .
How many integers appear in both of the following arithmetic progressions:
A1: 2, 9, 16,.....2+(10001)*7
A2: 3, 12, 21,.....3+(10001)*9
Since 2 appears in A1 but not in A2, it does not appear in both of the arithmetic progressions.

A1_n= 2+(n1)*7=7n5
A2_k= 3+(k1)*9=9k6
Put A1_n=A2_k => so 9k7n=1 and solve the Diophantine equation for n,k u can see that gcd(9,7)=1 so the solutions you want come from applying the euclidean algorithm and your numbers n,k must be less than or equal to 1000. 
Calculating GCD(9,7) gives:
7 = 0*9 + 7
9 = 1*7 + 2
7 = 3*2 + 1
2 = 2*1 + 0
Then applying the Extended Euclidean Algorithm:
1 = (1 * 7) + (3 * 2)
= (3 * 9) + (4 * 7)
= (4 * 7) + (3 * 9)
A particular solution is:
x0 = 3
y0 = 4
The complete solution is:
x = 3 + 7n
y = 4  9n