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

Home > Numbers
Pandigital Crossed Perfect Square Poser (Posted on 2023-06-08) Difficulty: 3 of 5
Two (non leading zero) five digit positive integers A and B together uses the digits 0 to 9 exactly once, with B=3*A

What are A and B, if the concatenated form of the first three digits of B is a perfect square?

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 2 of 2 |
Satisfying first few criteria:
[[20583, 61749], [23058, 69174], [30582, 91746], [32058, 96174], [16794, 50382], [17694, 53082]]

 All criteria met ... A and B are: [32058, 96174]

-----------
from itertools import permutations
from itertools import combinations
ds = '0123456789'
ab_possibles = []
ans = []
for comb in combinations(ds,5):
    other5 = [i for i in ds if i not in comb]
    for perm1 in permutations(comb):
        if perm1[0] == '0':
            continue
        a = int(''.join(perm1))
        for perm2 in permutations(other5):
            if perm2[0] == '0':
                continue
            b = int(''.join(perm2))
            if b == 3*a:
                ab_possibles.append([a,b])
print('Satisfying first few criteria:')
print(ab_possibles)
for ab in ab_possibles:
    isSquare = int(ab[1]/100)
    if (round(isSquare**.5))**2 == isSquare:
        print('\n', 'All criteria met ... A and B are:', ab)

  Posted by Larry on 2023-06-08 12:55:07
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 (11)
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