2018-10-10 18:03:03 -04:00
---
id: 5900f3dd1000cf542c50fef0
2021-02-06 04:42:36 +00:00
title: 'Problem 113: Non-bouncy numbers'
2018-10-10 18:03:03 -04:00
challengeType: 5
2021-02-06 04:42:36 +00:00
forumTopicId: 301739
2021-01-13 03:31:00 +01:00
dashedName: problem-113-non-bouncy-numbers
2018-10-10 18:03:03 -04:00
---
2020-12-16 00:37:30 -07:00
# --description--
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468.
Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; for example, 66420.
We shall call a positive integer that is neither increasing nor decreasing a "bouncy" number; for example, 155349.
2021-07-15 13:04:11 +05:30
As n increases, the proportion of bouncy numbers below n increases such that there are only 12951 numbers below one-million that are not bouncy and only 277032 non-bouncy numbers below ${10}^{10}$.
2021-02-06 04:42:36 +00:00
2021-07-15 13:04:11 +05:30
How many numbers below a googol (${10}^{100}$) are not bouncy?
2018-10-10 18:03:03 -04:00
2020-12-16 00:37:30 -07:00
# --hints--
2018-10-10 18:03:03 -04:00
2021-07-15 13:04:11 +05:30
`nonBouncyNumbers()` should return `51161058134250` .
2018-10-10 18:03:03 -04:00
```js
2021-07-15 13:04:11 +05:30
assert.strictEqual(nonBouncyNumbers(), 51161058134250);
2018-10-10 18:03:03 -04:00
```
2021-01-13 03:31:00 +01:00
# --seed--
## --seed-contents--
```js
2021-07-15 13:04:11 +05:30
function nonBouncyNumbers() {
2021-01-13 03:31:00 +01:00
return true;
}
2021-07-15 13:04:11 +05:30
nonBouncyNumbers();
2021-01-13 03:31:00 +01:00
```
2020-12-16 00:37:30 -07:00
# --solutions--
2020-08-13 17:24:35 +02:00
2021-01-13 03:31:00 +01:00
```js
// solution required
```