Too Primed

N N is the largest integer less than 1 0 6 10^6 which is a product of exactly two different primes and also divides the sum of the squares of all of its positive divisors. Find the sum of the (positive) prime divisors of N N .


The answer is 322.

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.

6 solutions

Shivang Jindal
May 20, 2014

Suppose N = p q N=pq where p p and q q are distinct primes . Now positive divisors of N N would be 1 , p , q , p q 1 , p , q, pq . So Sum of squares of positive divisors will be 1 + p 2 + q 2 + ( p q ) 2 1+p^2+q^2+(pq)^2

Since N 1 + p 2 + q 2 + ( p q ) 2 p q 1 + p 2 + q 2 + ( p q ) 2 N | 1+p^2+q^2+(pq)^2 \implies pq|1+p^2+q^2+(pq)^2 since p q pq divides ( p q ) 2 (pq)^2 so , p q 1 + p 2 + q 2 pq|1+p^2+q^2

LEMMA : If a b 1 + a 2 + b 2 ab|1+a^2+b^2 then a 2 + b 2 + 1 a b = 3 \frac{a^2+b^2+1}{ab}=3 , and also if ( x , y ) (x,y) is a solution , then next solution would be given by ( y , y 2 + 1 x ) (y,\frac{y^2+1}{x})

PROOF . Consider the ordered pair ( x , y ) (x,y) . We say that is the ordered pair with the minimum value of x + y . x+y. such that x 2 + y 2 + 1 x y = k . \frac{x^2+y^2+1}{xy}=k. , where k . k. is some integer other than 3. 3. . We can also assume without the loss of generality that x > y . x>y. , because if x = y . x=y . we quickly see that our only solution is ( 1 , 1 ) . (1,1). , but that yields 3. 3. . So x > y . x>y. when y > 1. y>1. Now simplifying x 2 + y 2 + 1 x y = k . \frac{x^2+y^2+1}{xy}=k. we get: x 2 k y x + y 2 + 1 = 0. x^2-kyx+y^2+1=0.

We see that we have a quadratic in x . x. . We can let one root of the quadratic be x and the other root be z . z. . Then by Vietas we have: x z = y 2 + 1 . z = y 2 + 1 x . xz=y^2+1 \implies .z=\frac{y^2+1}{x}.

So we see that if ( x , y ) . (x,y). is a solution, then ( y , z ) . (y,z). is a solution, and we know that ( y , z ) . (y,z). is equivalent to ( y , y 2 + 1 x ) (y,\frac{y^2+1}{x}) Now if we can prove that x + z < x + y , . x+z<x+y,. we will reach our desired contradiction as we assumed minimality for x + y . . x+y.. x + z < x + y z < y y 2 + 1 < x y y + 1 / y < x . x+z<x+y\\ z<y\\ y^2+1<xy\\ y+1/y<x .

Which is true by our initial assumption that y < x . y<x. when y > 1. y>1. Hence, there is no solution such that x 2 + y 2 + 1 x y = k . \frac{x^2+y^2+1}{xy}=k. , where k . k. is some integer other than 3. 3. . Furthermore, a solution when k = 3. k=3. is ( 1 , 1 ) . (1,1) . , and we have already shown that if we know one solution, we can generate an infinite number of solutions by letting the solution after ( x , y ) . (x,y) . be ( y , y 2 + 1 x ) . (y,\frac{y^2+1}{x}).

So the proof of lemma ends

so now we have ( 1 , 1 ) (1,1) as solution , now next will be ( 2 , 5 ) (2,5) then ( 5 , 13 ) ( 13 , 34 ) ( 34 , 89 ) ( 233 , 610 ) ( 610 , 1597 ) ( 1597 , 4181 ) (5,13)\\ (13,34)\\ (34,89)\\ (233,610)\\ (610,1597)\\ (1597,4181)

Note that 1597 4181 1597 \cdot 4181 exceed 1 0 6 10^6 and lower prime pairs are ( 89 , 233 ) (89,233) so , p + q = 89 + 233 = 322 p+q =89+233=\boxed{322}

Qi Huan Tan
May 20, 2014

Let N = p q N=pq , where p , q p,q are distinct primes with p < q p<q .

p q pq divides 1 2 + p 2 + q 2 + p 2 q 2 1^2+p^2+q^2+p^2q^2 , p q pq divides ( p 2 + 1 ) ( q 2 + 1 ) (p^2+1)(q^2+1) . Since p p is a prime, p p divides p 2 + 1 p^2+1 or p p divides q 2 + 1 q^2+1 . Since p 2 0 ( m o d p ) p^2\equiv0\pmod{p} , p 2 + 1 1 ( m o d p ) p^2+1\equiv1\pmod{p} , p 2 + 1 p^2+1 is not divisible by p p , p p divides q 2 + 1 q^2+1 . Similarly, q q divides p 2 + 1 p^2+1 . Let p 2 + 1 = k q p^2+1=kq for some natural numbers k k . q = p 2 + 1 k q=\frac{p^2+1}{k} , ( p 2 + 1 k ) 2 + 1 0 ( m o d p ) (\frac{p^2+1}{k})^2+1\equiv0\pmod{p} . As g c d ( p , k ) = 1 gcd(p,k)=1 , 1 k 2 + 1 0 ( m o d p ) \frac{1}{k^2}+1\equiv0\pmod{p} , k 2 + 1 0 ( m o d p ) k^2+1\equiv0\pmod{p} . By Vieta jumping, ( p , q ) (p,q) is a solution iff ( k , p ) (k,p) is a solution. Note that every solution is a deriavative of ( 1 , a ) (1,a) for some a a . [Temporarily ignore the fact that p p and q q are primes.]

When p = 1 p=1 , p 2 + 1 = 2 p^2+1=2 , since q > p = 1 q>p=1 , q = 2 q=2 , a = 2 a=2 . Start at ( 1 , 2 ) (1,2) and turn ( p , q ) (p,q) into ( q , q 2 + 1 p ) (q,\frac{q^2+1}{p}) continuously, we get pairs of solution ( 1 , 2 ) , ( 2 , 5 ) , ( 5 , 13 ) , ( 13 , 34 ) , ( 34 , 89 ) , ( 89 , 233 ) , ( 233 , 610 ) , . . . (1,2),(2,5),(5,13),(13,34),(34,89),(89,233),(233,610),... . Observe that 89 × 233 = 20737 < 1 0 6 89\times233=20737<10^6 and 233 × 610 = 142130 > 1 0 6 233\times610=142130>10^6 . Finally, check that p = 89 , q = 233 p=89, q=233 are both primes and satisfy all the conditions given in the problem. Therefore, the sum of the positive prime divisors of N N is p + q = 89 + 233 = 322 p+q=89+233=322 .

Anderson S
May 20, 2014

We need to see the nature of N first. N= n1n2 with n1 and n2 being primes. n1n2 | the sum of it's divisors squares = 1+ n1^2+ n2^2 + (n1n2)^2 So of course, n1n2 | n1^2 + n2^2 +1 From here, we get n1 | n2^2 +1 and n2 | n1^2 + 1 Assume n1>n2. We can say that n1 = (n2^2 +1) /k because n2 | n1^2+1 , n2 |((n2^2 +1) /k) ^2 +1 -> n2 | n2^4 +2 n2^2 + 1 + k2 --> n2 | k^2 +1 We already know that k | n2^2 +1 from it's definition. Because k=(n2^2+1)/n1 and n1 >=n2+1, we get k<=n. If we rename k as n3, we will get this statement: For every n1 and n2 such that n1<n2, n1|n2^2+1 and n2|n1^2+1, there will be n3 such that n3<=n2<n1, n3|n2^2+1, and n2|n3^2+1 If we repeat this step with n2 and n3, and again with n3 and n4, and again with n4 and n5, we will get n1>n2>=n3>=n4>=....>=nm>=.... Note that other than n1 and n2, others aren't necessarily prime. Note also that doing so doesn't alter the n1, and since n1 is finite, there must be time when this sequence stops decreasing, which is when nm=n(m+1) But it can only be reached when n(m+1)|nm^2+1 = n(m+1)^2+1 --> n(m+1)|1 From here, we know that n(m)=n(m+1)=1. So we know that somewhere in the sequence, 1 is involved. We can now use it to trace it back to n1. nm=1 and n(m-1) divides nm^2+1 = 2. From here, we know that the only non-1 n(m-1) possible is 2. n(m-2) can be generated from n(m-1) and nm with the formula we had earlier n(m-2) = (n(m-1)^2+1)/nm (we previously used k instead of nm, but this formula is used throughout the sequence.) We get n(m-2) = 5 Now, we can backtrace this sequence to n1, with the only possible sequence being 1 2 5 13 34 89 233 610 1597 ..... Note that if n2>1597 , n1n2>10^6. Therefore, the only possible primes in the sequence fitting as n1 and n2 are 233 and 89

Bojan Serafimov
May 20, 2014

p q 1 + p 2 + q 2 + ( p q ) 2 p q 1 + p 2 + q 2 k p q = 1 + p 2 + q 2 q 2 k p q + p 2 + 1 = 0 pq \mid 1 + p^2 + q^2 + (pq)^2 \\ \Leftrightarrow pq \mid 1 + p^2 + q^2 \\ \Leftrightarrow kpq = 1 + p^2 + q^2 \\ \Leftrightarrow q^2 - kpq + p^2 + 1 = 0
p p and q q can't be equal because p ∤ 2 p 2 + 1 p \not \mid 2p^2 + 1 . WLOG, q > p q > p .

The second solution for q q to the above quadratic equation is x 2 = k p q = p 2 + 1 q p 2 + 1 p + 1 = p 1 + 2 p + 1 x_2 = kp - q = \frac{p^2 + 1}{q} \leq \frac{p^2 + 1}{p + 1} = p - 1 + \frac{2}{p+1} .
x 2 x_2 is always an integer because x 2 = k p q x_2 = kp - q . x 2 x_2 is always positive because p 2 + 1 q \frac{p^2 + 1}{q} . x 2 x_2 is less than p p when p > 1 p > 1 . So, if ( p , q ) (p, q) is a solution with q > p > 1 q > p >1 , then ( p 2 + 1 q , p ) (\frac{p^2 + 1}{q}, p) is also a solution.

Reducing a solution like this, we will eventually get to the solution ( 1 , 1 ) (1, 1) [Do you know why? - Calvin], and because this operation is reversible, we can start from ( 1 , 1 ) (1, 1) , and generate all possible solutions. We get the following list: 2 , 5 , 13 , 34 , 89 , 233 , 610 , 1597 , 4181 , 10946 , 28657 , 75025 , 196418 , 514229 2, 5, 13, 34, 89, 233, 610, 1597, 4181, 10946, 28657, 75025, 196418, 514229 Every 2 consecutive numbers from this list is a solution to the equation, but since we need 2 primes, the biggest consecutive pair is ( 89 , 233 ) (89, 233) .

Note: We could have used the well known fact that a b a 2 + b 2 + 1 3 a b = a 2 + b 2 + 1 ab | a^2 + b^2 + 1 \Rightarrow 3ab = a^2 + b^2 + 1 , and solve the quadratic equation, but that would have been harder to do.

[LaTeX edits - Calvin]

The well-known problem listed at the end was part of the inspiration for this problem.

Calvin Lin Staff - 7 years ago
Pi Han Goh
Jul 29, 2013

This is not a complete explanation because I haven't mastered Vieta Jumping yet but I will try my best.

Since N = p q , p q N=pq, p \ne q , given sum of squares of divisors of N N is divisible by N N , then ( p 2 + q 2 + 1 ) m o d ( p q ) = 0 (p^2 + q^2 + 1) \bmod{(pq)} = 0

Refer to this link ,

We get p 2 + q 2 + 1 p q = 3 \frac {p^2 + q^2 + 1}{pq} = 3

Without the loss of generality, we have p < q p < q

Trial and error shows that ( p , q ) = ( 1 , 2 ) , ( 2 , 5 ) , ( 5 , 13 ) , ( 13 , 34 ) , ( 34 , 89 ) , (p,q) = (1,2), (2,5), (5,13),(13,34), (34,89), \ldots , I don't know how to elaborate on this.

And 1 , 2 , 5 , 13 , 34 , 89 , 1,2,5,13,34,89, \ldots follows the recurrence relation a 0 = 1 , a 1 = 2 , a n = 3 a n 1 a n 2 , n 2 a_0 = 1, a_1 = 2, a_n = 3 a_{n-1} - a_{n-2}, n \geq 2

Continue on with the list gives 1 , 2 , 5 , 13 , 34 , 89 , 233 , 610 , 1597 , 1,2,5,13,34,89,233,610,1597, \ldots

For p p and q q prime with p q < 1 0 6 pq < 10^6 , we select two consecutive numbers in the list (which are also primes) such that they are largest.

We get p = 89 , q = 233 p + q = 322 p=89,q=233 \Rightarrow p+q=322

Moderator note:

Good ideas here. You should review how to use Vieta Jumping to approach this problem, and there is no need to use trial and error to guess the solutions.

Note that the URL is unique to you, and others will not be able to see it. Hence, I've replaced it with the suggested link.

The fact that p 2 + q 2 + 1 p q = 3 \frac {p^2 + q^2 + 1} {pq} = 3 is proven here .

Joe Ill - 7 years, 10 months ago

i think i get it. i think....

set a = 1 a = 1 , solve for 3 a b = a 2 + b 2 + 1 3ab = a^2 + b^2 + 1 gives b = 2

then set a = 2 a = 2 , solve for 3 a b = a 2 + b 2 + 1 3ab = a^2 + b^2 + 1 gives b = 5

then set a = 5 a = 5 , solve for 3 a b = a 2 + b 2 + 1 3ab = a^2 + b^2 + 1 gives b = 13

and so on... and we get the list above. am i right?

Pi Han Goh - 7 years, 10 months ago

Log in to reply

I think there is a more exact way of finding the primes other than simply just using the b value as the a value. You wouldn't have known to do that if you didn't already know what the answer was, right?

Michael Tong - 7 years, 10 months ago

Log in to reply

you got me

Pi Han Goh - 7 years, 10 months ago

The problem conditions fall out to finding a simultaneous solution for p q 2 + 1 p \mid q^{2}+1 and q p 2 + 1 q \mid p^{2}+1 .

My approach was to write: r = q p r = q - p . Then it follows that p q r 2 + 1 pq \mid r^{2} + 1 .

I felt that this meant that we had to have p q = r 2 + 1 pq = r^{2} + 1 , and I also felt that infinite descent ought to be able to prove it, but I couldn't make progress on that. (I had actually used the technique of infinite descent plus assuming existence of a minimum solution before, on IMO problems, but didn't know it was called Vieta jumping).

So I considered the equality case anyway (figuring I'd solve that and then I might discover in the solution that it proved this was the only case).

Also, looking through a list of primes under 1000, 89 89 and 233 233 caught my eye as being Fibonacci numbers. That gave me this idea:

p q = r 2 + 1 pq = r^{2} + 1 implies that p r r q \frac{p}{r} \simeq \frac{r}{q} . Or if we give this ratio a name γ \gamma , then q p γ 2 q \simeq p {\gamma}^{2} , and p q p 2 γ 2 = r 2 pq \simeq p^{2} {\gamma}^{2} = r^{2} .

But since r = q p r = q - p , we get γ 2 p p = γ p {\gamma}^{2}p - p = \gamma p , i.e. γ 2 1 = γ {\gamma}^{2} - 1 = \gamma , so γ = ϕ \gamma = \phi .

I was able to prove from the closed-form solution of Fibonacci numbers that: F n 1 F n + 1 = F n 2 + 1 F_{n-1} F_{n+1} = F_{n}^{2} + 1

so this gives a class of solutions, although we would have to brute force test Fibonacci numbers for primality.

I think my above argument establishes that there are no other solutions. For if there were another solution, it would have to establish a sequence of integers whose common ratio approaches ϕ \phi . (No other ratio works, because although there may be other answers to p q = r 2 + 1 pq = r^{2} + 1 , they won't satisfy r = q p r = q - p if the ratio is not ϕ \phi as demonstrated above).

And I don't think there can be any other sequence besides the Fibonacci that has a common ratio of ϕ \phi because then that entire sequence would just be the Fibonacci sequence multiplied by some constant , which couldn't line up with integers.

Matt McNabb - 7 years, 10 months ago

Your solution is similar to mine. And my hunch was right (according to the challenge master), trial and error is not required. Though I don't know how to do it.

Michael Tong - 7 years, 10 months ago
Michael Tong
Aug 3, 2013

The sum of the positive prime divisors of N N is p 2 q 2 + p 2 + q 2 + 1 p^2q^2 + p^2 + q^2 + 1 , thus p 2 q 2 + p 2 + q 2 + 1 p q \frac {p^2q^2 + p^2 + q^2 + 1}{pq} is an integer. While it may seem tempting to factor the numerator and split it into two cases, this is not the easiest way (in my eyes). Instead, since we know p 2 q 2 p q \frac {p^2q^2}{pq} will be an integer, we will then have to find values of ( p , q ) (p, q) such that p 2 + q 2 + 1 p^2 + q^2 + 1 is divisible by p q pq . If you didn't know it already, a useful theorem to know is that if p q pq divides p 2 + q 2 + 1 p^2 + q^2 + 1 , the quotient is 3 3 . So we get p 2 3 p q + q 2 + 1 = 0 p^2 - 3pq + q^2 + 1 = 0 , which is a quadratic with respect to p p . Using the quadratic formula on the previous equation, we get p = 3 q + / 5 q 2 4 2 p = \frac {3q +/- \sqrt {5q^2 - 4}}{2} .

First, we start with the base case, where q = 2 q = 2 . We get ( p , q ) = ( 5 , 2 ) (p, q) = (5, 2) as an answer. Trying higher primes for q q , we get ( 5 , 13 ) , ( 13 , 34 ) , ( 34 , 89 ) (5, 13), (13, 34), (34, 89) etc. This follows the recursion p 0 = 2 , p 1 = 5 , p n = 3 p n 1 p n 2 p_0 = 2, p_1 = 5, p_n = 3p_{n-1} - p_{n-2} for p 2 p \geq 2 .

ALTERNATIVE METHOD

Odd squares can be written in the form 8 T + 1 8T + 1 , where T = ( a ) ( a + 1 ) 2 T = \frac {(a)(a+1)}{2} is a triangle number. When q > 2 , 5 q 2 4 q > 2, 5q^2 - 4 must also be an odd square. So 5 q 2 = 4 a 2 + 4 a + 5 5q^2 = 4a^2 + 4a + 5 . Completing the square on the RHS we get 5 q 2 = ( 2 a + 1 ) 2 + 4 = ( 2 a + 1 ) 2 5 q 2 = 4 5q^2 = (2a + 1)^2 + 4 = (2a + 1)^2 - 5q^2 = -4 . Let x = 2 a + 1 x = 2a + 1 . Then there is one obvious solution to this, namely ( 1 , 1 ) (1, 1) . Solving the Diophantine equation, if ( 1 , 1 ) (1, 1) is a solution then all other solutions x , q x, q are given by ( x + q 5 ) 2 = ( ( 3 + 5 2 ) r ( 1 + 5 2 \frac {(x + q \sqrt{5})}{2} = ((\frac {3 + \sqrt{5}}{2})^r (\frac {1 + \sqrt{5}}{2}

We find solutions such that a a and q q are prime. These are consecutive pairs 2 , 5 , 13 , 34 , 89 , 223... 2, 5, 13, 34, 89, 223 ... as found before.

In this recursion, the two largest consecutive terms such that they are both prime and their product is less than 1 0 6 10^6 are q = 89 q = 89 and p = 233 p + q = 322 p = 233 \rightarrow p + q = 322

I am sure there is a more elegant solution to this that does not involve trial and error, but I at the moment this is the best I can do.

In addition, this can be found using Markov numbers.

Markov numbers are the solutions to the equation x 2 + y 2 + z 2 = 3 x y z x^2 + y^2 + z^2 = 3xyz . Setting z equal to 1, this is just as the equation we had. The first few markov numbers are the same as we found: 2, 5, 13, 34, 89, 223, etc.

Michael Tong - 7 years, 10 months ago

Log in to reply

You beat me to it.

Set z = 1 z=1 , we get ( p , q ) = ( F 2 n 1 , F 2 n + 1 ) (p,q) = ( F_{2n-1}, F_{2n+1})

So we just need to find a maximum value of n n such that F 2 n 1 F_{2n-1} and F 2 n + 1 F_{2n+1} are both primes, and their product is less than 1 0 6 10^6 . In this case n = 6 F 2 n 1 = 89 , F 2 n + 1 = 233 n=6 \Rightarrow F_{2n-1} = 89, F_{2n+1} = 233

Pi Han Goh - 7 years, 10 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...