# Perfect Squares

Show 40 post(s) from this thread on one page
Page 1 of 2 12 Last
• Jul 29th 2011, 08:17 AM
PASCALfan
Perfect Squares
Which are the lowest and highest nine digit perfect squares that include all the numbers from one to nine without the repetition of any number?
• Jul 29th 2011, 08:58 AM
Also sprach Zarathustra
Re: Perfect Squares
Quote:

Originally Posted by PASCALfan
Which are the lowest and highest nine digit perfect squares that include all the numbers from one to nine without the repetition of any number?

My first suggestion for you is:

Look for numbers divisible by 9.
• Jul 29th 2011, 10:25 AM
SammyS
Re: Perfect Squares
Every nine digit number composed of all the digits from 1 through 9, is divisible by 9, so that's not much help. -- except that the square root of the number must be divisible by 3.

Look at the result of squaring each of the digits 1 through 9, -- particularly look at the one's digit of the result. -- the ten's digit may be handy as well.

What is the range of the numbers whose squares have nine digits? Narrow that down a bit, to numbers between the square root of 123456789 ≈ 11112, and the square root of 987654321 ≈ 31428 .
• Jul 29th 2011, 10:46 AM
Wilmer
Re: Perfect Squares
Quote:

Originally Posted by PASCALfan
Which are the lowest and highest nine digit perfect squares that include all the numbers from one to nine without the repetition of any number?

There's 30 of them. WHY do you need this?
• Jul 29th 2011, 12:33 PM
SammyS
Re: Perfect Squares
Here's one of them: 14676^2 = 215384976 .
• Jul 29th 2011, 02:08 PM
Wilmer
Re: Perfect Squares
Highest is 923187456
• Jul 29th 2011, 03:08 PM
awkward
Re: Perfect Squares
Quote:

Originally Posted by PASCALfan
Which are the lowest and highest nine digit perfect squares that include all the numbers from one to nine without the repetition of any number?

This is one of my favorite problems, and you have already been given some excellent advice. I have written computer programs to find all 30 solutions (in many languages-- as I said, the problem is a favorite of mine).

The problem dates back at least to "Amusements in Mathematics" by H.D. Dudeney, first published in 1917. Like you, Dudeney asked for the largest and smallest squares, and he gives the answers in the book. Obviously he did not use a computer in 1917. I wish I knew how he got the answers, but I don't. The solution in the book simply gives the two numbers with no hint of how they were derived. I think Dudeney knew at least the "casting out nines" property, which is enough to conclude that each square is divisible by 9, but my impression of him is that he did not know much more in the way of number theory. I could be wrong about that, of course.

In my first brief introduction to number theory, many years ago, my instructor mentioned this problem and pointed out the nines business. He said that he had solved the problem completely, finding all 30 solutions "by hand", and that his method involved just a little more number theory than we knew at the time. I have often wondered since then just what bit of number theory he had in mind, but I have never figured that out. If anyone has any ideas along those lines, I wish they would post them.
• Jul 29th 2011, 10:32 PM
PASCALfan
Re: Perfect Squares
Hello,

Thanks for the results, How is this derived?? thats what I am also looking for..
• Jul 29th 2011, 11:07 PM
CaptainBlack
Re: Perfect Squares
Quote:

Originally Posted by PASCALfan
Hello,

Thanks for the results, How is this derived?? thats what I am also looking for..

What have you tried?

This is going to involve some trial and error and systematic search. You have to find methods of reducing the size of the search space.

CB
• Jul 29th 2011, 11:22 PM
PASCALfan
Re: Perfect Squares
I am using trial and error method on all combinations. But something in my mind says there could be an easier method, b'coz of the special number 9. I am looking for it
• Jul 30th 2011, 12:17 AM
CaptainBlack
Re: Perfect Squares
Quote:

Originally Posted by PASCALfan
I am using trial and error method on all combinations. But something in my mind says there could be an easier method, b'coz of the special number 9. I am looking for it

What have you done to reduce the search space?

CB
• Jul 30th 2011, 01:14 AM
PASCALfan
Re: Perfect Squares
A perfect square can end only in 1, 4, 5, 6 and 9
• Jul 30th 2011, 03:24 AM
PASCALfan
Re: Perfect Squares
Finally got them

lowest 139854276 = 11826 ^2

Highest 923187456 = 30384 ^2
• Jul 30th 2011, 03:52 AM
CaptainBlack
Re: Perfect Squares
Quote:

Originally Posted by PASCALfan
A perfect square can end only in 1, 4, 5, 6 and 9

The ideas that reduce the size of search space are:

You are searching the squares of the numbers in the range ceiling(sqrt(123456789) to floor((sqrt(987654321)) also these roots should be divisible by 3, these reduce the number of possibilities to ~6800.

Maybe someone can suggest other means of reducing the search space size.

CB
• Jul 30th 2011, 06:20 AM
Wilmer
Re: Perfect Squares
I prefer sticking digits together to taking a number apart (even if it takes a little longer);
keeping last digit at 1,4,5,6,9 and looping others such that none of the 9 are the same:
201600 "examinations" required (5 * 8!), taking 4 seconds (using UBasic).
Show 40 post(s) from this thread on one page
Page 1 of 2 12 Last