wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> medium >> Perfect squares
(Message started by: Altamira_64 on Apr 11th, 2012, 1:07am)

Title: Perfect squares
Post by Altamira_64 on Apr 11th, 2012, 1:07am
Consider an integer x. If we add 30, then the result is a perfect square. If we subtract 30, the result is also a perfect square. How many such integers are there?"

Title: Re: Perfect squares
Post by pex on Apr 11th, 2012, 1:26am
[hide]Two.[/hide]

Title: Re: Perfect squares
Post by Altamira_64 on Apr 11th, 2012, 2:42am
Well, I guess these must be 34 and 226.

Title: Re: Perfect squares
Post by pex on Apr 11th, 2012, 11:12am

on 04/11/12 at 02:42:54, Altamira_64 wrote:
Well, I guess these must be 34 and 226.

Yes, they are. Full solution:
[hideb]Let the two squares be a2 and b2, with a>b>0 without loss of generality. It is given that a2-b2 = 2*30 = 60, or equivalently (a+b)(a-b) = 60.

Now we could just check all factorizations of 60 into two positive integer factors (there are only five possibilities), but let's narrow it down a little further. The difference between a+b and a-b is 2b, which is even, so the factors are both odd or both even. Two odd factors couldn't have product 60, so both factors must be even.

The prime factorization is 60 = 2*2*3*5. To get two even factors, both must contain a factor 2. There are only two options for assigning the remaining primes:

a) One to each factor: a+b = 2*5 = 10 and a-b = 2*3 = 6. Solving, a = 8, a2 = 64, b = 2, b2 = 4, and x = 34.

b) Both to the same factor: a+b = 2*3*5 = 30 and a-b = 2. Solving, a = 16, a2 = 256, b = 14, b2 = 196, and x = 226.[/hideb]

Title: Re: Perfect squares
Post by Altamira_64 on Apr 14th, 2012, 9:26am
Great solution, Pex!
Mine is different: It is based to the fact that each perfect square N^2  is the sum of the first  N odd numbers (5^2 = 25 = 1+3+5+7+9).
Thus the difference of 2 perfect squares should equal to the sum of consecutive odd numbers (and this should equal 60).
Starting from 1, we write down the sums of the odd numbers:
1+3+5+7+9+11+13 = 49 while 1+3+5+7+9+11+13+15 = 64. Thus we cannot make 60 starting from 1.
We do the same with 3: 3+5+7+9+11+13=48 while 3+5+7+9+11+13+15 = 63. Not possible.
Starting from 5:
5+7+9+11+13+15=60 YESS!!
Thus one perfect square is 4 and the next is 64, their difference being 60, so the first number we are looking for is 34 (34-30 = 4 and 34+30 = 64, both of them perfect squares).
Similarly we find that the only other sum of consecutive odd numbers equaling 60 is 29+31.
Therefore one perfect square is 1+3+5+...+27=196 (14^2) and the next is 1+3+5+...+27+29+31=256 (16^2) and the second number we are asking for is 226 (226-30 = 196, 226+30 = 256).
There is no other series of successive odd numbers equaling 60, so these two are the only numbers with this property.

Title: Re: Perfect squares
Post by SWF on Apr 16th, 2012, 3:11pm
x = b2+30 = a2-30 = (a2+b2)/2

(a-b)(a+b)=60. (a-b) and (a+b) must both be even, define 2n as:
2n=a-b which means 30/n=a+b. Square these two equations, add, and divide by 4:
n2 + (15/n)2 = (a2+b2)/2, but this equals the expression given above for x meaning x is the sum of the squares of any two positive integers whose product is 15.

There are two ways to factor 15 into two numbers:
{1,15} gives x= 12+152 = 226
{3,5} gives x= 32+52 = 34



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board