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.
DEFDBL A-Z
nlim = SQR(9876543210#)
lnlim = LOG(nlim)
FOR n = 2 TO nlim
plim = 2 * lnlim / LOG(n)
FOR p1 = 2 TO plim
FOR p2 = p1 + 1 TO plim
tot = INT(n ^ p1 + n ^ p2 + .5)
t$ = LTRIM$(STR$(tot))
IF LEN(t$) = 10 THEN
good = 1
FOR i = 1 TO 9
IF INSTR(i + 1, t$, MID$(t$, i, 1)) > 0 THEN good = 0: EXIT FOR
NEXT
IF good THEN PRINT n; p1; p2, n ^ p1; n ^ p2, tot
END IF
NEXT
NEXT
NEXT
finds
n pwr1 pwr2 n^pwr1 n^pwr2 n^pwr1 + n^pwr2
264 3 4 18399744 4857532416 4875932160
2016 2 3 4064256 8193540096 8197604352
If it hadn't been required that the powers be distinct, there would have been many more solutions, one of which would have two 4th powers, and the rest of the equal powers as 2. In fact 264 is the one that has two 4th powers.
264 3 4 18399744 4857532416 4875932160
264 4 4 4857532416 4857532416 9715064832
2016 2 3 4064256 8193540096 8197604352
22887 2 2 523814769 523814769 1047629538
23124 2 2 534719376 534719376 1069438752
24957 2 2 622851849 622851849 1245703698
25941 2 2 672935481 672935481 1345870962
26409 2 2 697435281 697435281 1394870562
26733 2 2 714653289 714653289 1429306578
27276 2 2 743980176 743980176 1487960352
29685 2 2 881199225 881199225 1762398450
31389 2 2 985269321 985269321 1970538642
35367 2 2 1250824689 1250824689 2501649378
39036 2 2 1523809296 1523809296 3047618592
39147 2 2 1532487609 1532487609 3064975218
39432 2 2 1554882624 1554882624 3109765248
39702 2 2 1576248804 1576248804 3152497608
40293 2 2 1623525849 1623525849 3247051698
41997 2 2 1763748009 1763748009 3527496018
42843 2 2 1835522649 1835522649 3671045298
43059 2 2 1854077481 1854077481 3708154962
44922 2 2 2017986084 2017986084 4035972168
45258 2 2 2048286564 2048286564 4096573128
45624 2 2 2081549376 2081549376 4163098752
46464 2 2 2158903296 2158903296 4317806592
49059 2 2 2406785481 2406785481 4813570962
50889 2 2 2589690321 2589690321 5179380642
53568 2 2 2869530624 2869530624 5739061248
54354 2 2 2954357316 2954357316 5908714632
57321 2 2 3285697041 3285697041 6571394082
59268 2 2 3512695824 3512695824 7025391648
59727 2 2 3567314529 3567314529 7134629058
60984 2 2 3719048256 3719048256 7438096512
61098 2 2 3732965604 3732965604 7465931208
61611 2 2 3795915321 3795915321 7591830642
61866 2 2 3827401956 3827401956 7654803912
62634 2 2 3923017956 3923017956 7846035912
65436 2 2 4281870096 4281870096 8563740192
68823 2 2 4736605329 4736605329 9473210658
68982 2 2 4758516324 4758516324 9517032648
69087 2 2 4773013569 4773013569 9546027138
69696 2 2 4857532416 4857532416 9715064832
69732 2 2 4862551824 4862551824 9725103648
69798 2 2 4871760804 4871760804 9743521608
|
Posted by Charlie
on 2009-05-06 13:10:35 |