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

Home > Numbers
Smallest and Largest Hexadecimal Integers (Posted on 2025-01-15) Difficulty: 3 of 5
Find the smallest and largest hexadecimal integers such that each of their squares contains each of the 16 hexadecimal digits (0 through 9 and A through F) once and only once. A leading zero is not allowed.

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer solution | Comment 1 of 2
largest hex pandigital:
FEDCBA9876543210 is 18364758544493064720  
the square root of which is about 4285412295

smallest hex pandigital:
1023456789ABCDEF is 1162849439785405935
the square root of which is about 1078354969

The smallest and largest solutions are:
Smallest:
dec n     1078631835 
dec n^2 1163446635475467225 
hex n     404A9D9B 
hex n^2 1025648CFEA37BD9   hex pandigital

Largest
dec n     4285181505 
dec n^2 18362780530794065025 
hex n     FF6AAE41 
hex n^2 FED5B39A42706C81   hex pandigital

-----
first = 1078354969
last = 4285412295
ans = []

for n in range(first, last+1):
    s = n**2
    n16 = base2base(n,10,16)
    n16sqared = base2base(s,10,16)
    if len(n16sqared) == len(set(n16sqared)):
        print('Smallest')
        print(n, s, n16, n16sqared)
        ans.append([n, n**2, n16, n16sqared])
        break

print()

for n in range(last, first-1, -1): 
    s = n**2
    n16 = base2base(n,10,16)
    n16sqared = base2base(s,10,16)
    if len(n16sqared) == len(set(n16sqared)):
        print('Largest')
        print(n, s, n16, n16sqared)
        ans.append([n, n**2, n16, n16sqared])
        break

  Posted by Larry on 2025-01-15 12:05:42
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (6)
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 - 2025 by Animus Pactum Consulting. All rights reserved. Privacy Information