Define R(n) as the function that "reverses the digits" of the number n, when written as a four digit number (with leading zeros if necessary). For example: R(1234) = 4321, R(5200)= 0025 = 25, and similarly R(25)=R(0025)=5200.
Define F(n) as function returning the absolute value of n - R(n). For example: F(1234) = |1234 - 4321| = 3087
Problem:
Show that, starting with any natural number below 9999, if the function F(n) is performed repeatedly, one (and only one) of the following numbers eventually shows up: 0, 90, 909, 999, 6534.
Example:
F(1234) = 3087
F(3087) = 4716
F(4716) = 1458
F(1458) = 7083
F(7083) = 3276
F(3276) = 3447
F(3447) = 3996
F(3996) = 2997
F(2997) = 4995
F(4995) = 999
Clearly, this is very simple to show with a computer, but I was looking for a more interesting solution.
Question
Guest
Define R(n) as the function that "reverses the digits" of the number n, when written as a four digit number (with leading zeros if necessary). For example: R(1234) = 4321, R(5200)= 0025 = 25, and similarly R(25)=R(0025)=5200.
Define F(n) as function returning the absolute value of n - R(n). For example: F(1234) = |1234 - 4321| = 3087
Problem:
Show that, starting with any natural number below 9999, if the function F(n) is performed repeatedly, one (and only one) of the following numbers eventually shows up: 0, 90, 909, 999, 6534.
Example:
F(1234) = 3087
F(3087) = 4716
F(4716) = 1458
F(1458) = 7083
F(7083) = 3276
F(3276) = 3447
F(3447) = 3996
F(3996) = 2997
F(2997) = 4995
F(4995) = 999
Clearly, this is very simple to show with a computer, but I was looking for a more interesting solution.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.