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

Home > Numbers
AOUT and TUOA (Posted on 2024-01-19) Difficulty: 3 of 5
            A O U T      T U O A
          + A T A O    - U * T T
          ----------   ----------
            T U * U      O * T *
Can you solve these addition and subtraction problems, knowing that AOUT as well as it's reverse TUOA is a prime number?

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 solution | Comment 1 of 2
There are 84 4-digit reversable primes with unique digits (42 pairs).  But only one value of AOUT works.

3527 + 3735 = 7262 solves the addition

7253 - 2077 = 5176 solves the subtraction or 
7253 - 2177 = 5076 solves the subtraction

Program output:
AOUT found: 3527

-------------
def test(n):
    s = str(n)
    A = int(s[0])
    O = int(s[1])
    U = int(s[2])
    T = int(s[3])
    asum = 2010*A + 101*O + 10*U + 101*T
    if asum > 9999:
        return False
    s_asum = str(asum)
    if int(s_asum[0]) != T:
        return False
    if int(s_asum[1]) != U:
        return False
    if int(s_asum[3]) != U:
        return False
    return True

revprimes = []
for n in range(1001,10000,2):
    if len(str(n)) != len(set(str(n))):
        continue
    if isprime(n):
        rev_n = int(str(n)[::-1])
        if isprime(rev_n):
            if n not in revprimes:
                revprimes.append(n)
            if rev_n not in revprimes:
                revprimes.append(rev_n)
revprimes = sorted(revprimes)
for n in revprimes:
    if test(n):
        print('AOUT found:', n)

  Posted by Larry on 2024-01-19 12:13:42
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 (12)
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