Associated Topics || Dr. Math Home || Search Dr. Math

### Number and Its Square Using All 9 Digits Exactly Once

```
Date: 05/22/98 at 05:34:11
From: Faye
Subject: numbers

Dr. Math,

I want to know the way to get the answer for the following:

Find all the whole numbers for which the number and its square
together consist of exactly the nine digits 1, 2, 3,..., 9
appearing exactly once. Zero does not appear.

From, Faye
```

```
Date: 05/22/98 at 13:40:16
From: Doctor Schwa
Subject: Re: number and its square using all 9 digits exactly once

Interesting question, Faye!

I started by thinking about how many digits the original number would
have. A three-digit number, since it's between 100 and 999, when
squared is between 10000 and, well, a bit less than 1000000. So in
order to have the right number of digits, we have to have a three-
digit number whose square has six digits. Right away, we've narrowed
down the number to only a few hundred possible possibilities, from 317
(the first one with a six-digit square) to 987 (the last one that
doesn't repeat any digits).

So then what? We could just painstakingly check each of those few
hundred numbers, but that would get boring pretty fast. How else can
we narrow the search? Well, I had one other idea. The last digit of a
number is related to the last digit of a square, as 0^2 = 0, 1^2 = 1,
2^2 = 4, and so on.

Among other things, that means that the number can't end in 0, 1, 5,
or 6, because then the square would end in the same digit, but we can
only use each digit once.

That's about all the ideas I have so far ... it should give you a good
start on doing the rest. If you're patient, you could just check all
the remaining possible numbers on a calculator. Or, you could try
cutting down the search some more (for instance, numbers between 317
and 444 can't end in a 1, because the square will start with 1). And
they can't end in 9, either, because then the square will end with 1.

So now let's see what we need to check in the 300s:

324, 327, 328, 342, 347, 348, 352, 354, 357, 358, 362, 364, 367,
368, 372, 374, 378, 382, 384, 387, 392, 394, 397, 398

Still rather a lot, especially considering that there are still the
400s, 500s, 600s, 700s, 800s, and 900s left to check. You can cross
off a few more using the techniques I've already mentioned (348, for
instance, since its square will end with 4, which was already used).

Then apply a generous dose of patience with a calculator.

If you hear of any better shortcuts for cutting down on the search,
let me know!

-Doctor Schwa, The Math Forum
Check out our web site! http://mathforum.org/dr.math/
```
Associated Topics:
High School Exponents
High School Number Theory
High School Puzzles
Middle School Exponents
Middle School Puzzles

Search the Dr. Math Library:

 Find items containing (put spaces between keywords):   Click only once for faster results: [ Choose "whole words" when searching for a word like age.] all keywords, in any order at least one, that exact phrase parts of words whole words

Submit your own question to Dr. Math
Math Forum Home || Math Library || Quick Reference || Math Forum Search