Find all possible positive integer(s)
N, such that the decimal representation of the
sum of two distinct perfect powers of
N consists of non leading zeroes and contains each of the digits from 0 to 9 exactly once.
in my program I used the fact that the 2 powers would be at least 2,3 and thus n^3 can't be any larger than 9876543210 and thus need only search for n=2 to 2145. Then for each n I search for each power that does not make n^p larger than 9876543210. My Mathematica code is
For[n=2,n„T2145,n++,
p1=3;
While[n^p1„T9876543210,
p2=2;
While[p2<p1,
v1=n^p1;
v2=n^p2;
v3=v1+v2;
dgs=IntegerDigits[v3];
cmb=Sort[dgs];
If[cmbƒú{0,1,2,3,4,5,6,7,8,9},
Print[n,"^",p1,"= ",v1," ",n,"^",p2,"= ",v2," total: ",v3];];
p2++];
p1++];
];
and this gave the following 2 solutions
264^4=485732416 264^3=18399744 total: 4875932160
and
2016^3=819354096 2016^2=4064256 total: 8197604352
|
Posted by Daniel
on 2009-05-06 11:51:47 |