HP Forums

Full Version: Playing with numbers: Balanced Pandigits
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I know this is not a Number Theory forum, but I see that many of you have played extensively with pandigital numbers (hereafter referred to as pandigits), so I'm hoping you can help me with a pandigit puzzler.

Let's call "balanced pandigits" the set of pandigits which are exactly 10n digits long AND which have each digit (0 through 9) occur exactly n times. The order of the digits doesn't matter; only the count of each must be the same. E.g. 77412551806806934392 is a balanced pandigit because it contains each digit (0 through 9) exactly twice. (As usual, leading zeros are not allowed).

I hypothesized that balanced pandigits which were an exact power of an integer would be rare, so I set about looking for the smallest one. But a brute-force search found NO balanced pandigits at all. I'm using UBASIC to raise x to powers as high as it could go before overflowing (very high!), with x starting at 2 and now it's above 30000. I'm mystified. (Maybe I'll try the HP Prime emulator and see if it's faster than UBASIC.)

So my question is: Is it provable that no power of x (where x<1023456789 of course) can yield a balanced pandigit? If not, ARE there any?

Thanks in advance!

EDIT: OH GOOD GRIEF! Immediately after posting the above, the UBASIC program beeped and output 32043^2 = 1026753849. So... never mind! <blush>
(07-07-2016 04:40 PM)Joe Horn Wrote: [ -> ]I know this is not a Number Theory forum, but I see that many of you have played extensively with pandigital numbers (hereafter referred to as pandigits), so I'm hoping you can help me with a pandigit puzzler.

Let's call "balanced pandigits" the set of pandigits which are exactly 10n digits long AND which have each digit (0 through 9) occur exactly n times. The order of the digits doesn't matter; only the count of each must be the same. E.g. 77412551806806934392 is a balanced pandigit because it contains each digit (0 through 9) exactly twice. (As usual, leading zeros are not allowed).

I hypothesized that balanced pandigits which were an exact power of an integer would be rare, so I set about looking for the smallest one. But a brute-force search found NO balanced pandigits at all. I'm using UBASIC to raise x to powers as high as it could go before overflowing (very high!), with x starting at 2 and now it's above 30000. I'm mystified. (Maybe I'll try the HP Prime emulator and see if it's faster than UBASIC.)

So my question is: Is it provable that no power of x (where x<1023456789 of course) can yield a balanced pandigit? If not, ARE there any?

Thanks in advance!

EDIT: OH GOOD GRIEF! Immediately after posting the above, the UBASIC program beeped and output 32043^2 = 1026753849. So... never mind! <blush>

The range of numbers can be optimized a little, if you are looking only for 10-digit numbers, you know for sure log10(x^a) is between 9 and 10. This means:
a) a can only go from 2 to 9 (which would yield a single-digit x).
b) for each a, you can determine the range of x. For a=2, 9/2=4.5 and 10/2=5, so xmin=10^4.5=31623 and xmax=10^5=100000, so your loop could start from 31623 (would've found the 32043 much faster). As a becomes larger, the range of x is much narrower which would speed up your search a lot.

I'll give it a try if I have time, perhaps we can find a 20-digit one.
Playing around with 10digits Balanced Pandigits I wrote a program for the Prime, it found 87 of them in 10.4secs on the emulator and a sometimes freezing but always present error on the HW-Prime with iquo().
Arno
(07-09-2016 10:54 AM)Claudio L. Wrote: [ -> ]... perhaps we can find a 20-digit one.

The smallest 20-digit-long balanced pandigit that I've seen so far is 2158479^3 = 10056421854778936239.

The biggest balanced pandigit I've seen so far is 175536645^23 which is 190 digits long. My poor computer is never bored...
Reference URL's