For every positive integer n , let d ( n ) be the number of positive divisors of n . Find the sum of all positive integers n such that n + d ( n ) = ( d ( n ) ) 2 .
I'm looking for brilliant solutions. Solutions using programming are also welcome.
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.
So we have to only check twice of triangular numbers of the form T(sub)2n till n=4589
Here's a C++ code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
The output comes out to be:
2
56
132
1260
Hence, the sum is 1 4 5 0
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Output
1 2 3 4 5 6 |
|
Answer: 1 4 5 0
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Not sure if theres infinite n's or not, so added an except so I can exit out of program and view current sum which turns out to be correct, only 4 numbers, (2,56,132,1260) work.
Great :D, I actually did the same solution but in JavaScript, and yes, there are only 4 values of n , but how can we prove it?
Log in to reply
I'm actually curious, are you certain that there are no other n's that satisfy the condition? Or in other words, is 1450 r e a l l y the answer?
Log in to reply
Yes, I'm sure because the official solution says that there are only four solutions. But I don't know how to prove that,
Log in to reply
@Alan Enrique Ontiveros Salazar – That's reassuring. Thanks! and I guess someone already got the right proof? :)
L e t : x = a 1 b 1 a 2 b 2 a 3 b 3 … a n b n we have d ( x ) = ( b 1 + 1 ) ( b 2 + 1 ) ( b 3 + 1 ) … ( b n + 1 ) we also prove that max of x = 2 5 3 3 5 . 7 . there are 6 . 4 . 2 . 2 = 9 6 way possible to try. we find that x = 2 ; 5 6 ; 1 3 2 ; 1 2 6 0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
Gave 1 4 5 0 . (Luckily!)
Can anyone help me out with large integers?
A solution that checks for the number of divisors of a very large number can also be easily implemented using some Computer Science algorithms. The divisor function σ ( n ) can be defined by the mathematical equation,
σ ( n ) = ∏ i = 1 r ( a i + 1 ) represents the number of occurrences of the i t h prime factor of n and r denotes the number of distinct prime factors of n .
Therefore by using this mathematical equation and simple primality testing algorithms , one can easily find the number of divisors of any number quite efficiently.
Problem Loading...
Note Loading...
Set Loading...
Solutions to this equation have d ( n ) > n , so they should be "small." There are some upper bounds on d ( n ) . One I found here
Link
was d ( n ) ≤ n lo g lo g n 1 . 5 3 7 9 lo g 2 and that exponent is less than 1 / 2 if n ≥ 4 5 9 0 . So you should only have to check for n up to 4 5 8 9 .