Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Given that $[n(n+1)(n+2)]^2 = 303916253\square96$, find the value of $\square$.

Given that $[n(n+1)(n+2)]^2 = 30391625\square796$, find the value of $\square$.


Given that $[n(n+1)(n+2)]^2 = 3039162537\square6$, find the value of $\square$.


In any three consecutive integers, $n, n+1, n+2$, at least one of the numbers will be even, and one of them will be a multiple of 3. Hence the product, $n(n+1)(n+2)$, will be even and divisible by 3. Furthermore, the square of an even number will be divisible by 4, and the square of a multiple of 3 will be divisible by 9. If a number is divisible by 9, the sum of the digits will also be divisible by $9: 3 + 3 + 9+ 1 + 6 + 2 + 5 + 3 + 7 + 6 = 45$, so the value of $\square$ must be 0 or 9. However, if the number is divisible by 4, the last two digits (either 06 or 96) must be divisible by 4. Hence the value of $\square$ is 9.

Find the value of n. How would you solve the equation, $[n(n+1)(n+2)] ^2 = k$, in general?

share|cite|improve this question
Find prime factors of $\sqrt k$. – Lazar Ljubenović Feb 10 '12 at 8:41
Your result is 11 digit, so running a program from approximation of $k^{1/3}$ is not bad. – Saeed Feb 10 '12 at 8:47
The equation [n(n+1)(n+2)]^2=k isn't exactly what we have here because $k$ in the stated problem is almost but not fully known. But for computational purposes, the facts (a) $n\approx k^{1/6}-1$, (b) $k$ is a square, (c) $36|k$, and (d) $n|(k-4)$ should be all we need for not-too-large numbers. – anon Feb 10 '12 at 8:47
general solution – pedja Feb 10 '12 at 8:55
up vote 5 down vote accepted

Then, there's brute force:

303,916,253,?96 ~= 30.3 e+10 ~= (5.5 e+5) squared ~= (n cubed) squared. So, 80 < n < 90 since 80 cubed = 512,000 and 90 cubed = 729,000. Since 303,916,253,?96 ends with 6, the number that is squared must end with 4 or 6. Hence, none of n, n+1, and n+2 can have 0 or 5 in the one's digit. This limits possible choices to 81*82*83 or 82*83*84 or 86*87*88 or 87*88*89. As it turns out, with n=81, 81*82*83 = 551,286, which when squared = 303,916,253,796. The missing digit (?) is 7.

share|cite|improve this answer

Some (less than beautiful) Maple code to do the brute force search: (putting X's in for unknown digits)

mystery_number := "303X1625XX96";
mystery_number := convert(mystery_number,list):
digits := nops(convert(mystery_number,list)):
k := ceil(digits/6): # since we have m is approx n^6

for n from 1 to 10^k do
  flag := true;
  m := (n*(n+1)*(n+2))^2;
  nList := convert(convert(m,string),list);
  if nops(nList) = digits then 
     for i from 1 to digits do
        if flag and (mystery_number[i] = nList[i] or mystery_number[i] = "X") then 
           flag := true; 
           flag := false; 
        end if;
     end do:
     if flag then print(m); end if;
  end if;
end do:

For example: Starting with "XXXXXXXXXX9X" the only 2 solutions are 303916253796 and 646840581696

In fact, merely knowing that the desired number is 12 digits long (using "XXXXXXXXXXXX") produces a list of 32 possibilities. So analyzing the number of digits might be a very good place to start.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.