For how many positive integers n < 1 0 6 is 2 × n ! × ( n + 2 ) ! a perfect square?
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.
why they didn't consider (a0 , b0) as a solution since it is satisfy the equation 2x(0!)x(0+2)! = 4 then the right answer is 8.
Log in to reply
Because then n = 0 . However, n must be positive, so it doesn't work.
Just noticed a typo in the parenthetical remark referring to this: should have said "corresponds to n = 0 ," not "corresponds to x = 0 ."
Pell's equations destroy this problem
Would you be able to add this question and solution to the Pell's equation Wiki page that I have started? It would really add some variety and show people that it is not just used for approximations of surds :)
2 n ! ⋅ ( n + 2 ) ! = 2 n ! ⋅ n ! ⋅ ( n + 1 ) ( n + 2 ) = 2 n ! 2 ⋅ ( n + 1 ) ( n + 2 )
Since in the prime factorization of n ! 2 all exponents are even, we can ignore this factor: it is already a square.
2 ( n + 1 ) ( n + 2 ) = 4 ( 2 n + 2 )
We can discard 4 = 2 2 as well, for the same reason.
We are then left with, ( 2 n + 2 ) = k 2 for some integer k .
The n th triangular number is given by ( 2 n + 1 ) , and so we must now count the amount of non-negative values of n < 1 0 6 − 1 such that T n is also a square number.
Unfortunately, I do not know how to continue further by hand other than by chance having the square triangular numbers memorized, and so I used A001108 to count. There are 7 such square triangular numbers.
Unfortunately, I thought 10^6=100000, so I missed the question, but my solution is significantly different from yours, so I thought I'd give a quick outline: Basically, one of n+1 or n+2 must be a perfect square, and the other twice a perfect square, since they are relatively prime. Then, for each solution to the basic pell's equation x^2-2y^2=1 or -1, there is a working n. Finally, we can just use the properties of pell's equation to find how many solutions that has beneath 1 million.
Log in to reply
This was my solution, too. The motivation in this solution is the fact that gcd ( n + 1 , n + 2 ) = 1 , so in order for 2 ( n + 1 ) ( n + 2 ) to be a perfect square it requires that one of n + 1 , n + 2 to be twice a perfect square and the other a perfect square.
Read this on numbers being squares and triangular: http://www.cut-the-knot.org/do you know/triSquare.shtml. Apparently, the recurrence equation a n = 6 a n − 1 − a n − 2 , where a 0 = 0 and a 1 = 1 are the solutions. The numbers then have to be squared. For example, a 2 = 6 , which squared is equal to 36. 36 is the 8th triangular number and also a square. I used a calculator to continue, finding that 7 was the answer. By the way, nice solution!
2(n!)(n+2)!.
2
n
!
2
(n+1)(n+2).
thus 2(n+1)(n+2) must be square.
2(n+1)(n+2)/4 is square.
thus (n+1)(n+2)/2 is square.
the n+1th triangular number is square.
referring to OEIS A001108, 7 values of n satisfy the given conditions.
JAVA CODE :::
import java.io.*;
import java.math.*;
public class PerfectlyFactorialSquares
{
public static void main(String[] args)throws IOException
{
long a=0,i=0;
double d=0.0;
for(i=1;i<1000000;i++)
{
d=Math.sqrt(2*(i+1)*(i+2));
if(Math.ceil(d)==Math.floor(d))
a++;
}
System.out.println(a);
}
}
OUTPUT :: 7
int main()
{cout<<"Worst solution ever";
cout<<"Please keep these solutions to yourself";
return 0;
}
Dividing by n ! 2 we find that 2 ( n + 1 ) ( n + 2 ) = m 2 .
Since m is even, set m = 2 k , now ( n + 1 ) ( n + 2 ) = 2 k 2 .
Setting p = n + 1 , we get k 2 = 2 p ( p + 1 ) . So we are actually looking for square triangular numbers.
Since 2 < = p < = 1 0 6 , we have to look for them in the range 3 ≤ 2 p ( p + 1 ) ≤ 5 0 0 0 0 0 5 0 0 0 0 0 .
Wikipedia gives us: "There are infinitely many square triangular numbers; the first few are: 0, 1, 36, 1225, 41616, 1413721, 48024900, 1631432881, 55420693056, 1882672131025 (sequence A001110 in the OEIS)".
So there are 7 such numbers in the required range: 36, 1225, 41616, 1413721, 48024900, 1631432881, 55420693056.
Problem Loading...
Note Loading...
Set Loading...
Factor out ( n ! ) 2 ; then 2 ( n + 1 ) ( n + 2 ) = 2 n 2 + 6 n + 4 is a perfect square x 2 . Multiply both sides by 2 and complete the square to get ( 2 n + 3 ) 2 − 2 x 2 = 1 . The positive integer solutions to the Pell equation a 2 − 2 b 2 = 1 are well-known; one way to enumerate them is to start with ( a 0 , b 0 ) = ( 3 , 2 ) and apply the formulas a k + 1 = 3 a k + 4 b k , b k + 1 = 2 a k + 3 b k . Note that a is always odd and b always even. (Note that a 0 = 3 corresponds to n = 0 .)
We get ( a 1 , b 1 ) = ( 1 7 , 1 2 ) , ( a 2 , b 2 ) = ( 9 9 , 7 0 ) , … , ( a 7 , b 7 ) = ( 6 6 5 8 5 7 , 4 7 0 8 3 2 ) , ( a 8 , b 8 ) = ( 3 8 8 0 8 9 9 , 2 7 4 4 2 1 0 ) . This gives solutions n = 7 , 4 8 , 2 8 7 , 1 6 8 0 , 9 7 9 9 , 5 7 1 2 0 , 3 3 2 9 2 7 , 1 9 4 0 4 4 8 , … . The last one is larger than 1 0 6 , so there are exactly 7 such positive integers.