Can only think of the search program being restricted to
ceiling[sqrt(1023456789)] = 31992 and floor[sqrt(9876543210)] = 99380;
so a looper:
loop n from 31992 to 99380
x = n^2
x's digits all different?
Hello everybody!
I need a little help with my homework. I need to find all (natural) numbers whose squares are pandigital numbers (they use each of the digits 0,1,...,9 only once), e.g. .
Since that would take ages to do manually, I made a small program in Mathematica which finds all such numbers. Now, I would like to know if there is some "more mathematical" way to do this or is it simply the work for computers.
Just a few tips, please! Thanks in advance.
P.S. Sorry for eventually bad English. It's not my native language.
Hello, Dr. Jekyll!
I don't know of any algorithm that will help.I need to find all (natural) numbers whose squares are pandigital numbers
(they use each of the digits 0,1,...,9 only once), e.g. .
Since that would take ages to do manually, I made a small program
in Mathematica which finds all such numbers.
Now, I would like to know if there is some "more mathematical" way to do this.
I did find a list of pandigital squares
. . with your example conspicuously missing.
. .
Well, that's exactly what I did. I'm allowed to use Mathematica (or Maple) for my homework and since Mathematica has function which counts digits I managed to find all such numbers. I also wrote a program in C which does the same thing and I think it found 87 such numbers or something like that. They all seemed correct. Maybe I'll post these numbers later.
I don't know of a pencil-and-paper solution, but you can reduce the search space somewhat by observing that if x is a pandigital number then x must be divisible by 3. That is because the sum of the digits of x^2 is 0+1+2+...+9 = 45, which is divisible by 9, so x^2 is divisible by 9.
If you consider the problem where x^2 has digits 1,2,...,9 (excluding zero), there are fewer solutions, and I think I once found a reference showing that all the solutions had been found in the pre-computer era, so a pencil and paper solution must exist. But I have never seen it (or found it, despite trying). :-(
That's strange. Wikipedia has not got the same definition as you of pandigital numbers.
You : they use each of the digits 0,1,...,9 only once
Wiki : has among its significant digits each digit used in the base at least once
And no, I do not think that there is an easy way. But perhaps, by fiddling with moduli, you might find a way to express such 10-digit long numbers. But I haven't tried and it may not be that easy.