Prime Pickle

Find the number of positive integers m 100 m\leq 100 such that for at least 500 500 values of positive integers n , n, 1 n 1000 , 1\leq n \leq 1000, there exist a prime p p and integers a a and b b such that { a n a m b ( m o d p ) b n a ( m o d p ) ( a 2 a ) ( b 2 b ) ≢ 0 ( m o d p ) \begin{cases} a^n\equiv a^m\equiv b \pmod p\\ b^n\equiv a \pmod p\\ (a^2-a)(b^2-b) \not \equiv 0 \pmod p \end{cases}


The answer is 57.

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.

2 solutions

Claim If a , b , c , n a,b,c,n are four natural numbers such that a b a c 1 ( m o d n ) a^b \equiv a^c \equiv 1 \pmod{n} , then a gcd ( b , c ) 1 ( m o d n ) a^{\gcd(b,c)} \equiv 1 \pmod{n} .

Proof Let G = gcd ( b , c ) G= \gcd(b,c) . By Bezouts's lemma, we can find two integers u u and v v such that b u + c v = G bu+cv= G . Then, note that a G a b u + c v ( a b ) u × ( b c ) v 1 ( m o d n ) a^G \equiv a^{bu+cv} \equiv \left ( a^b \right ) ^u \times \left ( b^c \right ) ^v \equiv 1 \pmod{n} This proves our desired result. QED

Claim If p p is a prime and q q is a prime divisor of p 1 p-1 , then we can find a positive integer a ≢ 1 ( m o d p ) a \not \equiv 1 \pmod{p} such that a q 1 ( m o d p ) a^q \equiv 1 \pmod{p} .

Proof Let f ( x ) = x p 1 q 1 f(x)= x^{\frac{p-1}{q}}-1 . Consider the residues of f ( x ) ( m o d p ) f(x) \pmod{p} . Since the degree of f ( x ) f(x) is p 1 q \dfrac{p-1}{q} , it can have at most p 1 q \dfrac{p-1}{q} roots. Again, note that p 1 q < p 1 \dfrac{p-1}{q} < p-1 . Then, there must exist an integer r r such that p ∤ r p \not \mid r , and r p 1 q ≢ 1 ( m o d p ) r^{\frac{p-1}{q}} \not \equiv 1 \pmod{p} . Take a = r p 1 q a= r^{\frac{p-1}{q}} . Then, note that a q r p 1 1 ( m o d p ) a^q \equiv r^{p-1} \equiv 1 \pmod{p} where the last step follows from Fermat's little theorem. This proves our desired result. QED We now go back to the main problem. Note that ( a 2 a ) ( b 2 b ) = a b ( a 1 ) ( b 1 ) (a^2-a)(b^2-b)= ab(a-1)(b-1) Then, ( a 2 a ) ( b 2 b ) ≢ 0 ( m o d p ) (a^2-a)(b^2-b) \not \equiv 0 \pmod{p} simply means p p divides neither of a , b , a 1 , b 1 a, b, a-1, b-1 . Since p ∤ a p \not \mid a , gcd ( p , a ) = 1 \gcd (p, a)= 1 . The first congruence yields: a n m 1 ( m o d p ) a^{n-m} \equiv 1 \pmod{p} Note that b n m ( a m ) n m ( a n m ) m 1 ( m o d p ) b^{n-m} \equiv \left ( a^m \right ) ^{n-m} \equiv \left ( a^{n-m} \right ) ^{m} \equiv 1 \pmod{p} Note that b n = b n m × b m b^{n}= b^{n-m} \times b^m . The second congruence yields: b n m × b m a ( m o d p ) b^{n-m} \times b^m \equiv a \pmod{p} 1 × ( a m ) m a ( m o d p ) \implies 1 \times \left ( a^m \right ) ^m \equiv a \pmod{p} a m 2 a ( m o d p ) \implies a^{m^2} \equiv a \pmod{p} Again, since gcd ( a , p ) = 1 \gcd (a, p)= 1 , we can divide both sides by a a to obtain: a m 2 1 1 ( m o d p ) a^{m^2-1} \equiv 1 \pmod{p} Now, note that if gcd ( n m , m 2 1 ) = 1 \gcd (n-m, m^2-1)= 1 , the first claim alongside the congruencies a n m 1 ( m o d p ) a^{n-m} \equiv 1 \pmod{p} and a m 2 1 1 ( m o d p ) a^{m^2-1} \equiv 1 \pmod{p} yields: a 1 1 ( m o d p ) a^1 \equiv 1 \pmod{p} This is a contradiction, since the third condition states that p ∤ a 1 p \not \mid a-1 .
So far, we have been able to prove that a necessary condition for the existence of such a ( a , b ) (a,b) is gcd ( n m , m 2 1 ) > 1 \gcd (n-m, m^2-1) > 1 . We shall now prove that this is the sufficient condition.

Let q q be a prime divisor of m 2 1 m^2-1 . Dirichlet's theorem states that there exists a prime p p such that q p 1 q \mid p-1 . From the second claim, we can find a positive integer a a such that a ≢ 1 ( m o d p ) a \not \equiv 1 \pmod{p} and a q 1 ( m o d p ) a^q \equiv 1 \pmod{p} . Take b = a m b= a^m . Note that if q m 1 q \mid m-1 , b a m a m 1 × a ( a q ) m 1 q × a a ( m o d p ) b \equiv a^m \equiv a^{m-1} \times a \equiv \left ( a^{q} \right ) ^{\frac{m-1}{q}} \times a \equiv a \pmod{p} Again, if q m + 1 q \mid m+1 , we have: b a m a m + 1 a ( a q ) m + 1 q a 1 a ( m o d p ) b \equiv a^m \equiv \frac{a^{m+1}}{a} \equiv \frac{\left ( a^q \right ) ^\frac{m+1}{q}}{a} \equiv \frac{1}{a} \pmod{p} It is now obvious that a a and b b satisfy the mentioned conditions.

Conclusion
For each m m , the number n n satisfies the mentioned conditions iff m 2 1 m^2-1 and m n m-n share a common prime factor. We then have to find the number of positive integers m 100 m \leq 100 such that there are strictly more than 499 499 values of n n such that m n m-n and m 2 1 m^2-1 share a common prime factor.
Case 1 1 : m 1 ( m o d 2 ) m \equiv 1 \pmod{2}
Then, note that 2 m 2 1 2 \mid m^2 - 1 . Take any odd n n . Then, note that 2 m n 2 \mid m-n . So, for any odd n n , the conditions will be satisfied. Since there are 500 500 odd integers from 1 1 to 100 100 , each odd choice of m m will count in atleast 500 500 solutions for n n . Since there are 50 50 even integers from 1 1 to 100 100 , this case produces 50 50 solutions.

Case 2 2 : m 0 ( m o d 2 ) m \equiv 0 \pmod{2}
Then, note that 2 m 2 1 2 \nmid m^2 - 1 . Let q 1 q_1 , q 2 q_2 , \cdots , q k q_k be the odd prime divisors of m 2 1 m^2-1 .First, note that for all q i q_i , the number of multiples of q i q_i in the range [ 1 , 1000 ] [1, 1000] is given by 1000 q i 1000 q i \left \lfloor \frac{1000}{q_i} \right \rfloor \leq \frac{1000}{q_i}

The number of positive integers 1000 \leq 1000 divisible by q 1 q 2 q k q_1q_2\cdots q_k is less than i = 1 k 1000 q i 1000 × ( i = 1 k 1 q i ) \sum \limits_{i=1}^{k} \left \lfloor \frac{1000}{q_i} \right \rfloor \leq 1000 \times \left ( \sum \limits_{i=1}^{k} \frac{1}{q_i} \right )

It then follows that if i = 1 k 1 q i < 1 2 \sum \limits_{i=1}^{k} \frac{1}{q_i} < \frac{1}{2} , then the number of solutions for n < 1000 n<1000 will be < 500 <500 .

Now, suppose 2 , 3 2, 3 and some other prime 37 \geq 37 is in the set { q 1 , q 2 , , q k } \{q_1, q_2, \cdots , q_k \} . The number of multiples of either 2 2 or 3 3 in the range [ 1 , 1000 ] [1, 1000] is given by (by PIE): 1000 2 + 1000 3 1000 15 = 467 \left \lfloor \frac{1000}{2} \right \rfloor + \left \lfloor \frac{1000}{3} \right \rfloor - \left \lfloor \frac{1000}{15} \right \rfloor = 467 Since the other prime is 37 \geq 37 , the largest number of multiples it can have in the range [ 1 , 1000 ] [1, 1000] is 1000 37 = 30 \left \lfloor \frac{1000}{37} \right \rfloor = 30 Note that 467 + 30 = 497 < 500 467+30= 497 < 500 . This shows that if 2 , 3 2, 3 , and some other prime 37 \geq 37 is in the prime factorization of m 2 1 m^2-1 , the number of solutions for n n will be strictly less than 500 500 .

Since we are considering only even m m , we can let m = 2 k m=2k , where k k ranges through all integers from 1 1 to 50 50 . From the first two observations, we can rule out all k k except 6 , 9 , 17 , 28 , 32 , 38 , 43 , 47 6, 9, 17, 28, 32, 38, 43, 47 . We can now manually go through these 7 7 numbers. However, note that the number of multiples of either 3 3 , 5 5 , or 7 7 is given by : 1000 3 + 1000 5 + 1000 7 1000 15 1000 35 1000 21 + 1000 21 = 543 > 500 \left \lfloor \frac{1000}{3} \right \rfloor + \left \lfloor \frac{1000}{5} \right \rfloor + \left \lfloor \frac{1000}{7} \right \rfloor - \left \lfloor \frac{1000}{15} \right \rfloor - \left \lfloor \frac{1000}{35} \right \rfloor - \left \lfloor \frac{1000}{21} \right \rfloor + \left \lfloor \frac{1000}{21} \right \rfloor= 543 > 500 This shows that k = 17 , 32 k= 17, 32 , and 38 38 works. We similarly calculate the number of multiples for the remaining four possibilities of k k . Doing this, we can show that it is greater than 500 500 for k = 6 , 28 k= 6, 28 and 43 43 , but < 500 <500 for 47 47 and 9 9 . Thus, this case produces 3 + 3 = 6 3+3= 6 solutions in all.
Summing them up, the total number of possibilities for m m is 50 + 6 = 56 50+6= \boxed{56} .

A tiny typo you have somewhere at the end, it should be: 467 + 30 = 497 < 500 467+30 = 497<500

Zhang Lulu - 7 years, 7 months ago

Log in to reply

Yes, sorry for that.

Sreejato Bhattacharya - 7 years, 7 months ago

Actually m can be 14, 34, 56, 64, 76, 86 and 94. So the correct answer is 57.

Si Yu How - 7 years, 7 months ago

Log in to reply

Whoa! Missed it. :( In fact your claim is right (I wrote a python code to check it), the answer is indeed 57 57 . I'll launch a dispute to the Brilliant staff now. :)

Sreejato Bhattacharya - 7 years, 7 months ago

Log in to reply

I have already done that.

Si Yu How - 7 years, 7 months ago

Log in to reply

@Si Yu How I've fixed this.

Si Yu, I do not see a dispute generated from you. Can you check if you are able to send a dispute for this problem?

Calvin Lin Staff - 7 years, 7 months ago

Log in to reply

@Calvin Lin I didn't see the dispute button so I sent an email to support@brilliant.org.

Si Yu How - 7 years, 7 months ago
Patrick Corn
Dec 23, 2013

The conditions imply that a m n 1 a^{mn-1} and a m n a^{m-n} are both congruent to 1 1 mod p p . Let x x be the order of a a mod p p . So x x divides gcd ( m n 1 , m n ) (mn-1,m-n) . Note that this equals gcd ( m 2 1 , m n ) (m^2-1,m-n) . Conversely, if gcd ( m 2 1 , m n ) = x > 1 (m^2-1,m-n) = x > 1 , we can find p , a , b p,a,b satisfying the conditions; just take p 1 p \equiv 1 mod x x and let a a be an element of multiplicative order x x , and b a m b \equiv a^m .

So we must find all values of m m such that the size of the set { n Z : 1 n 1000 , g c d ( m 2 1 , m n ) > 1 } \{ n \in {\mathbb Z} : 1 \le n \le 1000, {\rm gcd}(m^2-1,m-n) > 1 \} is at least 500.

If m m is odd, then this set is always big enough since all odd n n are in it. If m m is even, then a computer search seems to be the easiest way to proceed; I get { 14 , 34 , 56 , 64 , 76 , 86 , 94 } \{ 14, 34, 56, 64, 76, 86, 94 \} as the admissible even values. So the total number is 57 \fbox{57} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...