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

Home > Numbers
Fourth Power Arranger (Posted on 2024-03-30) Difficulty: 4 of 5
Find the smallest distinct whole numbers, M and N such that you can rearrange the digits of M to get N, and you can rearrange the digits of M4 to get N4, and where neither M nor M4 contains a 0.

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 1
Depending on how you define the smallest pair, the first pair has the overall smallest number, but the second pair has the smallest sum:
(M, N): (125413, 152314)
The 4th powers: (247383213595342283761, 538219333452784723216)

(M, N): (127286, 127826)
The 4th powers: (262495918768771833616, 266978811763592348176)

-------------

big = 1000000
numbDict = {}
quartDict = {}
for k in range(1,big):
    if '0' in str(k):
        continue
    kquartd = k**4
    numbKey = ''.join(sorted(str(k)))
    if '0' in numbKey:
        continue
    quartKey = ''.join(sorted(str(kquartd)))
    if '0' in quartKey:
        continue
    if numbKey not in numbDict:
        numbDict[numbKey] = [k]
    else:
        numbDict[numbKey].append(k)
    if quartKey not in quartDict:
        quartDict[quartKey] = [kquartd]
    else:
        quartDict[quartKey].append(kquartd)

for k,v in quartDict.items():
    if len(v) == 1:
        continue
    these_N_keys = []
    thesenumbs = []
    for cub in v:
        n = round(cub**(1/4))
        keyOfN =  ''.join(sorted(str(n)))
        these_N_keys.append(keyOfN)
        thesenumbs.append(n)
    if len(these_N_keys) == len(set(these_N_keys)):
        continue
        
    print('M and N are among:', thesenumbs )
    print('The 4th powers are among:', v)
    print()

  Posted by Larry on 2024-03-30 11:58:26
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 (3)
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