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

Home > Numbers
3 Cubes #2 (Posted on 2024-02-18) Difficulty: 3 of 5
The digits of 5^3, i.e. 125, can be rearranged to form 8^3, 512.

Find the smallest cube whose digits can be rearranged to form 2 other cubes.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer solution | Comment 1 of 4
The program finds 41063625.
41063625 = 345^3
56623104 = 384^3
66430125 = 405^3

-----------
Program Output:
3 [41063625, 56623104, 66430125]
-----------
from itertools import permutations
big = 1000
cubes = [c**3 for c in range(big)]

for c in cubes:
    s = str(c)
    cube_list = []
    for perm in permutations(s):
        if perm[0] == '0':
            continue
        jumble = int(''.join(perm))
        if jumble < c:
            continue
        if jumble in cubes  and  jumble not in cube_list:
            cube_list.append(jumble)
    cube_list = sorted(list(set(cube_list)))
    if len(cube_list) > 2:
        print(len(cube_list), cube_list)

  Posted by Larry on 2024-02-18 12:23:55
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (19)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information