## The cube, $41063625$ ($345^3$), can be permuted to produce two other cubes: $56623104$ ($384^3$) and $66430125$ ($405^3$). In fact, $41063625$ is the smallest cube which has exactly three permutations of its digits which are also cube.

Find the smallest cube for which exactly five permutations of its digits are cube.

### This is a difficult problem to solve manually, as it involves checking a large number of permutations. However, with the help of a computer script or a powerful calculator, it can be done relatively quickly.

Here is a way to approach this problem using Python:

“`python

from collections import defaultdict

def sortDigits(n):

return ”.join(sorted(str(n)))

# Create a dictionary where each key is a string of sorted digits and each value is a list of cubes with those digits

perms = defaultdict(list)

# For each integer n starting from 1…

n = 1

while True:

# Compute the cube of n

cube = n**3

# Sort the digits of this cube

sorted_digits = sortDigits(cube)

# Add this cube to the list of cubes keyed by the sorted digits

perms[sorted_digits].append(cube)

# If we’ve found a key with five cubes…

if len(perms[sorted_digits]) == 5:

# …then we’ve found the smallest cube for which exactly five permutations of its digits are also a cube

break

# Move on to the next number

n += 1

# The answer is the smallest cube in the list of five

answer = min(perms[sorted_digits])

“`

This program will first sort the digits from each cubed integer, thus finding sets of cubes with the same digits (meaning they are permutations of each other) due to the properties of sorted numbers.

Then it will find sets of cubes where exactly five permutations of its digits are cubes.

Finally, it will break the loop as soon as it finds a set of five and return the smallest cube from that set, effectively solving the problem. Please note that the actual smallest cube for which exactly five permutations of its digits are cube is a big number ($5027^3$), so doing this by hands is extremely challenging and even impossible if without tools.

##### More Answers:

XOR DecryptionPrime Pair Sets

Cyclical Figurate Numbers