Back to Freecodecamp

Problem 145: How many reversible numbers are there below one-billion?

curriculum/challenges/english/blocks/project-euler-problems-101-to-200/5900f3fd1000cf542c50ff10.md

latest741 B
Original Source

--description--

Some positive integers $n$ have the property that the sum [ $n + reverse(n)$ ] consists entirely of odd (decimal) digits. For instance, $36 + 63 = 99$ and $409 + 904 = 1313$. We will call such numbers reversible; so 36, 63, 409, and 904 are reversible. Leading zeroes are not allowed in either $n$ or $reverse(n)$.

There are 120 reversible numbers below one-thousand.

How many reversible numbers are there below one-billion (${10}^9$)?

--hints--

reversibleNumbers() should return 608720.

js
assert.strictEqual(reversibleNumbers(), 608720);

--seed--

--seed-contents--

js
function reversibleNumbers() {

  return true;
}

reversibleNumbers();

--solutions--

js
// solution required