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

Home > Just Math
Reverse GCD (Posted on 2025-03-22) Difficulty: 4 of 5
For all positive integers n, the function rev(n) reverses the digits of n. For example, rev(205) = 502 and rev(12340) = 04321 = 4321. Compute the least positive integer m such that gcd(m, rev(m)) = 13.

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 1 of 2
1495 = 13 * 115
5941 = 13 * 457 (457 is prime)

-----
from math import gcd

big = 10000
for n in range(0,big,13):
    if gcd(n, int(str(n)[::-1])) == 13:
        print(n)

Output:
1495
1586
1768
2587
3497
3679
4589
5941
6851
7852
7943
8671
9763
9854

  Posted by Larry on 2025-03-22 07:53:49
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 (4)
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