2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
id: 5900f54c1000cf542c51005f
|
|
|
|
title: 'Problem 480: The Last Question'
|
2020-11-27 19:02:05 +01:00
|
|
|
challengeType: 5
|
2019-08-05 09:17:33 -07:00
|
|
|
forumTopicId: 302158
|
2021-01-13 03:31:00 +01:00
|
|
|
dashedName: problem-480-the-last-question
|
2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --description--
|
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
Consider all the words which can be formed by selecting letters, in any order, from the phrase:
|
2020-11-27 19:02:05 +01:00
|
|
|
|
2021-07-30 17:32:21 +02:00
|
|
|
$$\mathbf{\text{thereisasyetinsufficientdataforameaningfulanswer}}$$
|
2020-11-27 19:02:05 +01:00
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
Suppose those with 15 letters or less are listed in alphabetical order and numbered sequentially starting at 1.
|
2020-11-27 19:02:05 +01:00
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
The list would include:
|
2020-11-27 19:02:05 +01:00
|
|
|
|
2021-07-30 17:32:21 +02:00
|
|
|
$$\begin{align}
|
|
|
|
& 1: \text{a} \\\\
|
|
|
|
& 2: \text{aa} \\\\
|
|
|
|
& 3: \text{aaa} \\\\
|
|
|
|
& 4: \text{aaaa} \\\\
|
|
|
|
& 5: \text{aaaaa} \\\\
|
|
|
|
& 6: \text{aaaaaa} \\\\
|
|
|
|
& 7: \text{aaaaaac} \\\\
|
|
|
|
& 8: \text{aaaaaacd} \\\\
|
|
|
|
& 9: \text{aaaaaacde} \\\\
|
|
|
|
& 10: \text{aaaaaacdee} \\\\
|
|
|
|
& 11: \text{aaaaaacdeee} \\\\
|
|
|
|
& 12: \text{aaaaaacdeeee} \\\\
|
|
|
|
& 13: \text{aaaaaacdeeeee} \\\\
|
|
|
|
& 14: \text{aaaaaacdeeeeee} \\\\
|
|
|
|
& 15: \text{aaaaaacdeeeeeef} \\\\
|
|
|
|
& 16: \text{aaaaaacdeeeeeeg} \\\\
|
|
|
|
& 17: \text{aaaaaacdeeeeeeh} \\\\
|
|
|
|
& \ldots \\\\
|
|
|
|
& 28: \text{aaaaaacdeeeeeey} \\\\
|
|
|
|
& 29: \text{aaaaaacdeeeeef} \\\\
|
|
|
|
& 30: \text{aaaaaacdeeeeefe} \\\\
|
|
|
|
& \ldots \\\\
|
|
|
|
& 115246685191495242: \text{euleoywuttttsss} \\\\
|
|
|
|
& 115246685191495243: \text{euler} \\\\
|
|
|
|
& 115246685191495244: \text{eulera} \\\\
|
|
|
|
& ... \\\\
|
|
|
|
& 525069350231428029: \text{ywuuttttssssrrr} \\\\
|
|
|
|
\end{align}$$
|
|
|
|
|
|
|
|
Define $P(w)$ as the position of the word $w$.
|
|
|
|
|
|
|
|
Define $W(p)$ as the word in position $p$.
|
|
|
|
|
|
|
|
We can see that $P(w)$ and $W(p)$ are inverses: $P(W(p)) = p$ and $W(P(w)) = w$.
|
2020-11-27 19:02:05 +01:00
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
Examples:
|
2020-11-27 19:02:05 +01:00
|
|
|
|
2021-07-30 17:32:21 +02:00
|
|
|
$$\begin{align}
|
|
|
|
& W(10) = \text{ aaaaaacdee} \\\\
|
|
|
|
& P(\text{aaaaaacdee}) = 10 \\\\
|
|
|
|
& W(115246685191495243) = \text{ euler} \\\\
|
|
|
|
& P(\text{euler}) = 115246685191495243 \\\\
|
|
|
|
\end{align}$$
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2021-07-30 17:32:21 +02:00
|
|
|
Find
|
|
|
|
$$W(P(\text{legionary}) + P(\text{calorimeters}) - P(\text{annihilate}) + P(\text{orchestrated}) - P(\text{fluttering})).$$
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
Give your answer using lowercase characters (no punctuation or space).
|
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
|
|
|
`euler480()` should return a string.
|
|
|
|
|
|
|
|
```js
|
|
|
|
assert(typeof euler480() === 'string');
|
|
|
|
```
|
|
|
|
|
|
|
|
`euler480()` should return the string `turnthestarson`.
|
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(euler480(), 'turnthestarson');
|
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
|
|
|
|
function euler480() {
|
2020-09-15 09:57:40 -07:00
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
euler480();
|
|
|
|
```
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --solutions--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|