login
A371469
Least pandigital number whose n-th power contains each digit (0-9) exactly n times.
0
1023456789, 3175462089, 4680215379, 5702631489, 7351062489, 7025869314
OFFSET
1,1
COMMENTS
If an n-th power of a pandigital number k contains each digit (0-9) exactly n times, it implies that 10^(10 - 1/n) <= 9876543210, so n <= 185. It's easy to verify that no solutions exist for n=7 to 185.
For the largest pandigital number whose n-th power contains each digit (0-9) exactly n times, see A370667.
EXAMPLE
a(4) = 5702631489 because it is the least 10-digit number that contains each digit (0-9) exactly once and its 4th power 1057550783692741389295697108242363408641 contains each digit (0-9) exactly 4 times.
MATHEMATICA
s = FromDigits /@ Permutations[Range[0, 9]]; For[n = 1, n < 7, n++,
For[k = 1, k <= Length@s, k++,
If[Count[Tally[IntegerDigits[s[[k]]^n]][[All, 2]], n] == 10,
Print[{n, s[[k]]}]; Break[]]]]
PROG
(Python)
from itertools import permutations as per
a=[]
for n in range(1, 7):
for k in [int(''.join(d)) for d in per('0123456789', 10)]:
if all(str(k**n).count(d) ==n for d in '0123456789'):
a.append(k)
break
print(a)
KEYWORD
base,easy,fini,full,nonn,less
AUTHOR
Zhining Yang, Apr 01 2024
STATUS
approved