A 1 : A 2 : 2 , 3 , 9 , 1 2 , 1 6 , … , 2 1 , … , 2 + ( 1 0 0 0 − 1 ) × 7 3 + ( 1 0 0 0 − 1 ) × 9 ?
How many integers appear in both of the following arithmetic progressions above?
Details and assumptions
Since 2 appears in A 1 but not in A 2 , it does not appear in both of the arithmetic progressions.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
did the same!
General term of A 1 = 7 n − 5
A 2 = 9 m − 6
Thus 7 n − 5 = 9 m − 6
1 + 7 n ≡ 0 ( m o d 9 )
n is of the form 5 + 9 k
There are 1 1 1 such whole number k < 1 0 0 0
Since, A 2 can always achieve the same terms with lesser term indicators, thus the answer is 1 1 1
A 1 has integers equivalent to 2 ( m o d 7 ) and A 2 has integers equivalent to 3 ( m o d 9 ) . We look for all numbers in A 1 that are equivalent to 3 ( m o d 9 ) which is the same as looking for numbers in A 2 equivalent to 2 ( m o d 7 ) . Checking the first few terms of A 1 we see that 3 0 ≡ 3 ( m o d 9 ) and this repeats every 9 terms. Thus the numbers of the form 3 0 + 6 3 ( k − 1 ) will appear in both arithmetic progressions as long as 2 ≤ 3 0 + 6 3 ( k − 1 ) ≤ 2 + ( 1 0 0 0 − 1 ) × 7 ⇒ 1 ≤ k ≤ 1 1 1 . Thus 1 1 1 integers appear in both arithmetic progressions.
Since the first common term is 30 the other common terms will be the L.C.M of A1 & A2 i.e 63.
So the series of common terms is 30, 93, 156,..., nth term
now Tn= a + (n-1)d
= 30+ (n-1)63
now this equation should be less than (1000-1)*7 + 2 as the common terms would not exceed it
Thus, 30 + (n-1)63 ≤ 6995 →
(n-1)63 ≤6965 →
(n-1) ≤ 6965/63 →
(n-1) ≤110.5 →
n ≤ 111.5 which is approx. 111
Hence the answer is 111.
series A 1 = 2 , 9 , 1 6 , 2 3 , 3 0 , 3 7 , 4 4 , 5 1 , 5 8 , 6 5 , 7 2 , 7 9 , 8 6 , 9 3 , 1 0 0 … , 6 9 9 5 series A 2 = 3 , 1 2 , 2 1 , 3 0 , 3 9 , 4 8 , 5 7 , 6 6 , 7 5 , 8 4 , 9 3 , 1 0 2 , … 8 9 9 4 . If you clearly observe both series, the 5 , 1 4 , … terms in the series 1 are matching with the 4 , 1 1 , … terms in the series 2. Since the LCM for 7 and 9 is 63 (7 and 9 are the common differnces for both series),so integers in both series match after every 63 from 30.(like 93,156,219.....). This corresponds to the 5 , 1 4 , 2 3 , 3 2 , 4 1 , … terms of series 1. Since total terms in series 1 is 1000, the terms that match are 5 , 1 4 , 2 3 . 3 2 , 4 1 . 5 0 , … 9 9 5 , we will get 111 terms.
Relevant wiki: Bezout's Identity
I referred to Bezout's identity, noticing :
7 and 9 are coprimes, and
2 + k × 7 = 3 + l × 9 can be written k × 7 − l × 9 = 1 .
We know that if we find a solution ( k , l ) , the solutions will be the couples ( k + 9 n ; l + 7 n ) .
A particular solution can be easily found : ( 4 , 3 ) since 4 × 7 − 3 × 9 = 1 . Then the solutions are the couples ( 4 + 9 n ; 3 + 7 n ) .
As 4 + 9 n ≤ 9 9 9 , then n ≤ 1 1 0 . Thus there are 1 1 1 solutions.
I did it this way, I think is very fast and easy to compute.
5th ,14th , 23rd... terms match from A1 . Numbers of terms in A1 are 1000 except 1st term all terms match after 9 terms . so total terms that match are (1000-5)/9 = 110 (not taking remainder) + 1 term which we left in start=111
class MyClass {
public static void main(String[ ] args) {
int sum=0;
for(int a=1;a<=1000;a++)
{
for(int b=1;b<=1000;b++){
if(7*a-5==9*b-6){
sum+=1;
}
}
}
System.out.println(""+sum);
}
}
OUTPUT=111
Problem Loading...
Note Loading...
Set Loading...
We note that numbers in A 1 are of the form 7 k + 2 and numbers in A − 2 are of the form 9 k + 3 . Using the Chinese Remainder Theorem, We know that the common numbers must be of the form 6 3 k + 3 0 .
Considering the range of the sequences, we must have 2 ≤ 6 3 k + 3 0 ≤ ( 1 0 0 0 − 1 ) × 7 + 2 . This gives that 0 ≤ k ≤ 1 1 0 . Thus, the total number of common numbers is 1 1 0 − 0 + 1 = 1 1 1 .