2018-09-30 23:01:58 +01:00
---
id: 5900f53b1000cf542c51004d
title: 'Problem 462: Permutation of 3-smooth numbers'
2020-11-27 19:02:05 +01:00
challengeType: 5
2019-08-05 09:17:33 -07:00
forumTopicId: 302137
2021-01-13 03:31:00 +01:00
dashedName: problem-462-permutation-of-3-smooth-numbers
2018-09-30 23:01:58 +01:00
---
2020-11-27 19:02:05 +01:00
# --description--
2019-07-18 17:32:12 +02:00
2021-07-30 17:32:21 +02:00
A 3-smooth number is an integer which has no prime factor larger than 3. For an integer $N$, we define $S(N)$ as the set of 3-smooth numbers less than or equal to $N$. For example, $S(20) = \\{1, 2, 3, 4, 6, 8, 9, 12, 16, 18\\}$.
2018-09-30 23:01:58 +01:00
2021-07-30 17:32:21 +02:00
We define $F(N)$ as the number of permutations of $S(N)$ in which each element comes after all of its proper divisors.
2018-09-30 23:01:58 +01:00
2021-07-30 17:32:21 +02:00
This is one of the possible permutations for $N = 20$.
2019-07-18 17:32:12 +02:00
2020-11-27 19:02:05 +01:00
- 1, 2, 4, 3, 9, 8, 16, 6, 18, 12.
2019-07-18 17:32:12 +02:00
2018-09-30 23:01:58 +01:00
This is not a valid permutation because 12 comes before its divisor 6.
2020-11-27 19:02:05 +01:00
- 1, 2, 4, 3, 9, 8, 12, 16, 6, 18.
2018-09-30 23:01:58 +01:00
2021-07-30 17:32:21 +02:00
We can verify that $F(6) = 5$, $F(8) = 9$, $F(20) = 450$ and $F(1000) ≈ 8.8521816557e\\,21$.
Find $F({10}^{18})$. Give as your answer as a string in its scientific notation rounded to ten digits after the decimal point. When giving your answer, use a lowercase `e` to separate mantissa and exponent. E.g. if the answer is $112\\,233\\,445\\,566\\,778\\,899$ then the answer format would be `1.1223344557e17` .
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
# --hints--
2018-09-30 23:01:58 +01:00
2021-07-30 17:32:21 +02:00
`permutationOf3SmoothNumbers()` should return a string.
```js
assert.strictEqual(typeof permutationOf3SmoothNumbers() === 'string');
```
`permutationOf3SmoothNumbers()` should return the string `5.5350769703e1512` .
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
2021-07-30 17:32:21 +02:00
assert.strictEqual(permutationOf3SmoothNumbers(), '5.5350769703e1512');
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
# --seed--
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
## --seed-contents--
2018-09-30 23:01:58 +01:00
```js
2021-07-30 17:32:21 +02:00
function permutationOf3SmoothNumbers() {
2020-09-15 09:57:40 -07:00
2018-09-30 23:01:58 +01:00
return true;
}
2021-07-30 17:32:21 +02:00
permutationOf3SmoothNumbers();
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
# --solutions--
2018-09-30 23:01:58 +01:00
```js
// solution required
```