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 Analytic Solution Comment 2 of 2 |
Two digit N are easy enough to list: 13, 26, 39, 52, 65, 78, 91 are the two digit multiples of 13 but none of them remain multiples of 13 when the digits are reversed.

For N and rev(N) to have a GCD of 13 then they must both necessarily be multiples of 13.  Furthermore their sum and difference must also be multiples of 13.

For three digit N, let N=ABC and then rev(N)=CBA. Then N-rev(N) = (A-C)*99.  This needs to be a multiple of 13, but that can happen when A=C.
But then N=rev(N) and their GCD will be ABA, not just 13.  So no three digit solutions either.

Onto four digit N.  Then rev(N)=DCBA.
Now N+rev(N) = 1001*(A+D) + 11*(B+C).  1001 is a multiple of 13 so for the whole sum to be a multiple of 13 we need to have B+C=13.
Only six cases to consider: (B,C) = (4,9), (5,8), (6,7), (7,6), (8,5), (9,4). Since we are seeking the smallest then (B,C) = (4,9) will be the first place to look

If N=A49D, then N-rev(N) = (A-D)*999-450 needs to be a multiple of 13.  Then A-D=9 mod 13, or equivalently, D-A=4 mod 13.  So (A,D) could be (1,5), (2,6), (3,7), (4,8), (5,9), or (9,0).
ABCD=1495, 2496, 3497, 4498, 5499, or 9490.  Of these the ones with GCD(N,rev(N))=13 are 1495 and 3497.

1495 has the smallest possible A and B values so it is the least positive integer m such that gcd(m, rev(m)) = 13.

  Posted by Brian Smith on 2025-03-22 20:55:58
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