Consider the expression 6 ( n + 1 ) ( 2 n + 1 ) .
For some whole numbers n , the expression is also a whole number. Let the three smallest such whole numbers be a 1 , a 2 , a 3 . Find the value of ∑ i = 1 3 a i .
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.
The numbers are 1, 337 and 65521. The first number is easy to check manually. However, for the next two you need to write a computer program which evaluates the expression for every whole number successively. You can use an infinite loop and in C++, you can use std::modf function to check whether the double number (that has been evaluated using the expression) is an integer or not. I really believe there must be a non-brute force approach to this problem. I will be happy to see if someone can provide that.
this is a NUMBER THEORY question.Not CS!!
Log in to reply
Please re-read the last line in my solution.
Log in to reply
Yeah. What about it?
Log in to reply
@Adarsh Kumar – You are level 5 in number theory, why aren't you writing a solution then ?
Problem Loading...
Note Loading...
Set Loading...
Express the numerator of the radicand as (n + 1)(2n + 1) = 2n^2 + 3n + 1 = 6k^2. Then express it in the form: 2(n^2 + 3n/2 + 1/2) = 6k^2 and n^2 + 3n/2 + 1/2 = 3k^2. Performing the completing the square, this gives (n + 3/4)^2 - 1/16 = 3k^2 or (4n + 3)^2 / 16 - 1/16 = 3k^2 or (4n + 3)^2 - 1 = 48k^2. Here, we solve a form of Pell's equation with (4n + 3)^2 - 48k^2 = 1. Using the substitution a = 4n + 3 and b = k. We solve the Pell equation: a^2 - 48k^2 = 1. Using Brute force for the form (7 + 4 sqrt(3))^n, we get the three smallest solutions (after checking..) 1, 337, 65521.