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

Home > Just Math
Non Prime Integer Inquiry (Posted on 2024-02-29) Difficulty: 3 of 5
The positive integers x and y satisfy the equation

x2 – y2 = 2026 – 2(x + 2y)

Given that neither x nor y is prime, find the value of xy.

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer solution Comment 3 of 3 |
Checking positive integers up to 10,000 finds three results, but only one result with x and y both being composite.

The requested product is 21021.

program output:
67 53 x is prime; y is prime
147 143 neither x nor y is prime
   the requested product is 21021
1011 1013 x is composite; y is prime

----------------------------
big = 10001
for x in range(1,big):
    for y in range(1,big):
        if x**2 - y**2 == 2026 - 2*(x + 2*y):
            bothcomposite = True
            if isprime(x):
                msg1 = 'x is prime;'
                bothcomposite = False
            else:
                msg1 = 'x is composite;'

            if isprime(y):
                msg2 = 'y is prime'
                bothcomposite = False
            else:
                msg2 = 'y is composite'
                
            if bothcomposite:
                print(x,y,  'neither x nor y is prime')
                print('   the requested product is', x*y)
            else:
                print(x,y,msg1,msg2)

  Posted by Larry on 2024-02-29 11:07:17
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 (0)
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