All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Quartic And Near Pandigital (Posted on 2008-11-01)
Determine all possible value(s) of a positive integer N, such that N and N4 together contain precisely nine digits from 0 to 9 which are all different. Neither N nor N4 can contain any leading zero.

Note: Try to solve this problem analytically, although computer program/spreadsheet solutions are welcome.

 See The Solution Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 solution | Comment 1 of 2

The fourth root of the lowest possible 7-digit number,1023456, is 31.8..., so the lowest N to try would be 32. The highest would be 56 ([4th root of 9876543]}. By happenstance, the lowest, 32, raised to the fourth power is 1048576, meeting the conditions of the problem.

The following program verifies not only that the answer is unique as posed, but also that no full-palindrome fourth power of an integer exists (all 10 digits accounted for).

DEFDBL A-Z
FOR n = 1 TO 100
ns\$ = LTRIM\$(STR\$(n))
n4s\$ = LTRIM\$(STR\$(n * n * n * n))
t\$ = ns\$ + n4s\$
IF LEN(t\$) = 9 OR LEN(t\$) = 10 THEN
good = 1
FOR i = 1 TO LEN(t\$) - 1
IF INSTR(i + 1, t\$, MID\$(t\$, i, 1)) > 0 THEN good = 0: EXIT FOR
NEXT
IF good THEN PRINT n; n4s\$
END IF
NEXT

 Posted by Charlie on 2008-11-01 19:21:28

 Search: Search body:
Forums (0)