Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Given two natural numbers I am supposed to reverse each of them and then sum them up and reverse the sum to get the final answer.

For example if the numbers are $4358$ and $754$ then the answer should be $1998$

I always thought that there should be a mathematical trick avoid brute force (i.e reversing each numbers and summing them up and reverse the sum to get the final answer).I heard "double reverse is no reverse" but never really get the trick myself.Could anybody help?

share|cite|improve this question
up vote 13 down vote accepted

Line the numbers up flush left. When you carry a digit, carry to the right. Something like

754  (+
share|cite|improve this answer
So it's boils down to the simple addition routine without reversing the strings first ... Thanks :-) – Quixotic Mar 4 '11 at 21:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.