480. The Last Question
https://projecteuler.net/problem=480
考慮所有由下列字串中以任意順序挑選任意文字組成的字串的集合:
thereisasyetinsufficientdataforameaningfulanswer
將此集合中字串長度不超過15的挑出,並依字典順序加以排序並編號,則此一序列包含:
項次:字串內容
1 : a
2 : aa
3 : aaa
4 : aaaa
5 : aaaaa
6 : aaaaaa
7 : aaaaaac
8 : aaaaaacd
9 : aaaaaacde
10 : aaaaaacdee
11 : aaaaaacdeee
12 : aaaaaacdeeee
13 : aaaaaacdeeeee
14 : aaaaaacdeeeeee
15 : aaaaaacdeeeeeef
16 : aaaaaacdeeeeeeg
17 : aaaaaacdeeeeeeh
...
28 : aaaaaacdeeeeeey
29 : aaaaaacdeeeeef
30 : aaaaaacdeeeeefe
...
115246685191495242: euleoywuttttsss
115246685191495243: euler
115246685191495244: eulera
...
525069350231428029: ywuuttttssssrrr
定義P(w)為字串w的項次
定義W(p)為項次p的字串內容
可以看出P(w)和W(p)互為反函數,P(W(p)) = p以及W(P(w)) = w。
舉例:
W(10) = aaaaaacdee
P(aaaaaacdee) = 10
W(115246685191495243) = euler
P(euler) = 115246685191495243
請求出W(P(legionary) + P(calorimeters) - P(annihilate)
+ P(orchestrated) - P(fluttering))。
請用小寫字母表達答案(不加標點或空白)。