2018-09-30 22:01:58 +00:00
---
id: 5900f3dd1000cf542c50fef0
title: 'Problem 113: Non-bouncy numbers'
2020-11-27 18:02:05 +00:00
challengeType: 5
2019-08-05 16:17:33 +00:00
forumTopicId: 301739
2021-01-13 02:31:00 +00:00
dashedName: problem-113-non-bouncy-numbers
2018-09-30 22:01:58 +00:00
---
2020-11-27 18:02:05 +00:00
# --description--
2018-09-30 22:01:58 +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.
2020-11-27 18:02:05 +00:00
2018-09-30 22:01:58 +00:00
Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; for example, 66420.
2020-11-27 18:02:05 +00:00
2018-09-30 22:01:58 +00:00
We shall call a positive integer that is neither increasing nor decreasing a "bouncy" number; for example, 155349.
2021-06-30 12:25:46 +00:00
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}$.
2018-09-30 22:01:58 +00:00
2021-06-30 12:25:46 +00:00
How many numbers below a googol (${10}^{100}$) are not bouncy?
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
# --hints--
2018-09-30 22:01:58 +00:00
2021-06-30 12:25:46 +00:00
`nonBouncyNumbers()` should return `51161058134250` .
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
```js
2021-06-30 12:25:46 +00:00
assert.strictEqual(nonBouncyNumbers(), 51161058134250);
2018-09-30 22:01:58 +00:00
```
2020-11-27 18:02:05 +00:00
# --seed--
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
## --seed-contents--
2018-09-30 22:01:58 +00:00
```js
2021-06-30 12:25:46 +00:00
function nonBouncyNumbers() {
2020-09-15 16:57:40 +00:00
2018-09-30 22:01:58 +00:00
return true;
}
2021-06-30 12:25:46 +00:00
nonBouncyNumbers();
2018-09-30 22:01:58 +00:00
```
2020-11-27 18:02:05 +00:00
# --solutions--
2018-09-30 22:01:58 +00:00
```js
// solution required
```