﻿ Decay — Keep Talking and Nobody Explodes Module ## On the Subject of Decaying Decay

Everything falls apart.

This module displays three pressable symbols.

### Step 1

#### Step 1.1: Decrypting the display

For each symbol, interpret each vertical bar as:

• 0 if it’s disconnected to the base
• 1 if it’s connected to the base

Treat each number as binary and convert them into base 10.
Then, add 2^{k}-1 to the number, where k is the number of vertical bars on the character.
Your base number (hereby referred as n) is (First number * 225) + (Second number * 15) + Third number.

#### Step 1.2: Constructing the tree

Construct a tree consisting of nodes and branches. Each node consists of three values: Prime Value, Remainder Value, and Binary Value.
In this step we will only consider the Prime and Remainder Values.
Start by constructing a node with n as the Remainder Value and 0 as the Prime Value. This node is also known as the base node.
Then for each node:

• For each unique prime factor of the Remainder Value, construct a child node connecting to the node where Prime Value = the prime factor and Remainder Value = [Remainder Value of the parent] / [Prime Value] + 1.
• Order these children nodes from lowest to highest based on the Prime Value.

Apply these steps above for each node, with the exception when the Remainder Value of that node is prime.

Example: 284
(Each node is presented as [Prime Value, Remainder Value])
0, 284
- 2, 143
- - 11, 14
- - - 2, 8
- - - - 2, 5*
- - 13, 12
- - - 2, 7*
- - - 3, 5*
- 71, 5*

*cases where Remainder Value is prime

### Step 2

#### Step 2.1: Obtaining the Binary

Press the middle symbol. You should hear a sequence of seven notes played.
For each note:

• If the next note is higher, this number is a 1.
• Otherwise, this number is a 0.
• For the last note, the term “next note” refers to the first note.

This set of numbers is called B_{i}.

Next, create B_{f} by doing the following:

• Start by letting k = 1.
• Take the first kth digits from B_{i}, reverse it, then append it in B_{f}.
• Add 1 to k and repeat the second step.
• If you ran out of digits to use from B_{i}, take the same string and append it in B_{i}.
• This goes on until you have enough bits to be used for the upcoming steps. You may generate more bits if needed.

At any point if a bit is requested from B_{f}, use the first unused bit. It is highly recommended to mark which bit is left unused to avoid mistakes.

#### Step 2.2: Assigning the Branches

In this step we will begin to assign a bit to the branches of the tree.
The branch of a node is the branch that connects the node to its parent.

• Start from the base node and go through each child node in order. From this child, go to its children and repeat until you land on a node that has no children.
• Assign a requested bit from B_{f} to the branch of this node.
• Repeat the above until all branches whose nodes have no children are assigned.
• For nodes that have children nodes, if their branches are assigned, assign the branch of this node a 0 if there are an even number of 1s on the assigned branches, otherwise assign a 1.
• Repeat this process until all branches are assigned.

#### Step 2.3: Backpropagating

In this step we will begin to set the Binary Values of the nodes.

• Set the Binary Value of the base node equal to 1.
• Then go to its children and set each Binary Value = [Binary Value of parent node] XOR [Assigned bit on the branch of this node]
• Repeat the above until all Binary Values are set.

### Step 3

#### Step 3.1: Obtaining the initial number sequence

Create a sequence S as follows:

• First term = Sum of all Prime Values from all the nodes
• Second term = Sum of all Prime Values from the nodes where the Binary Values are equal to 1
• For all n > 2 and (n-1)th term is not 0,
• nth term = (n-2)th term ⨬ (n-1)th term
• The operation ⨬ means reductive modulo. ab means to repeatedly [subtract b from a, then subtract 1 from b] until a is less than b or b is 0.
• If b is 0, the result is 0. Otherwise, the result is a.
• Repeat the above until the last term of the sequence is 0.

#### Step 3.2: Obtaining the fractions

Create a sequence S2 as follows:

• Convert n to base-b, where b is the number of terms of S.
• If the number of digits is odd, prepend a 0 at the front.
• Add 1 to all the digits.
• Set k = 1, and repeat the following:
• Set the kth term of S2 equal to the [kth digit of the number]th term of S.
• If k is equal to the number of digits of the number, stop. Otherwise add 1 to k.

Then, group the terms of S2 in pairs ([1st number, 2nd number], [3rd number 4th number], etc.).
Make a fraction out of each pair, where the lower number is the top part and the higher number is the bottom part.
If your fraction is 0/0, replace it with 1 / 2.
This set of fractions will be referred to as F.

#### Step 3.3: Making the truth table

Request 2^[Number of terms in F] from B_{f}. This string will be the truth table for the upcoming steps.
Each bit will be the output of some binary configuration of 0s and 1s which length is the number of terms in F.
To determine which configuration outputs which bit, take all the possible binary configurations, order them from smallest to largest, then join them to each bit of the truth table.

Example:
Say the number of terms in F is 3, and the truth table is 11001011.
Then we’ll have:

 Configuration Output 000 001 010 011 100 101 110 111 1 1 0 0 1 0 1 1

#### Step 3.4: Applying the quantum logic

Let X1, X2, ….. Xk = 1, where k is the number of binary configurations that outputs a 1, and set n = 1.
For each of the binary configurations that outputs 1 in the truth table, do the following:

• Set k = 1.
• If the kth digit of the binary configuration is a 0, multiply Xn by (1 - [kth term of F]).
• Otherwise multiply Xn by [kth term of F].
• If k = number of terms in F, stop. Otherwise add 1 to k and repeat the second step above.

After stopping, go to the next binary configuration and add 1 to n. Repeat until there are no binary configurations left that outputs a 1.
Set f = X1 + X2 + X3 + … + Xk. Keep f as a fraction at all times.

Example:
We will be using the truth table from the last example shown, and F = {3 / 4, 10 / 11, 3 / 7}.
Then k = 5. Therefore we should have:
X1 = (1 - 3 / 4) * (1 - 10 / 11) * (1 - 3 / 7) = 1/77 (for configuration 000)
X2 = (1 - 3 / 4) * (1 - 10 / 11) * (3 / 7) = 3/308 (for configuration 001)
X3 = (3 / 4) * (1 - 10 / 11) * (1 - 3 / 7) = 3/77 (for configuration 100)
X4 = (3 / 4) * (10 / 11) * (1 - 3 / 7) = 30/77 (for configuration 110)
X5 = (3 / 4) * (10 / 11) * (3 / 7) = 45/154 (for configuration 111)
Thus f = 1/77 + 3/308 + 3/77 + 30/77 + 45/154 = 229/308.

### Step 4

#### Step 4.1: Obtaining the submission sequence

Create a sequence S3 for submission.

• If f = 1/1, skip all the steps below, add 1 to S3, and continue to Step 4.2
• Otherwise, turn f into a mixed fraction (into form a b/c). [If the denominator of f > the numerator of f, then a = 0.]
• Add this a to S3, subtract a from f, then swap the numerator and denominator of f and repeat.
• Stop if at any point b = 0.

#### Step 4.2: Submitting the answer

To submit S3, convert each term into binary. Treat the left symbol as 0 and right symbol as 1, then input each term from most to least significant, with the middle symbol as breaks.
Press the middle symbol twice to submit the input sequence.

Example:
S3 = {14, 5, 2, 1}
Converted into binary = {1110, 101, 10, 1}
Input: RRRL M RLR M RL M R MM

## List of Prime Numbers from 1 to 3000

You may need it.

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999

Common numbers while constructing the tree:
- 0, 4
- - 2, 3*

- 0, 6
- - 2, 4
- - - 2, 3*
- - 3, 3*

- 0, 8
- - 2, 5*

- 0, 9
- - 3, 4
- - - 2, 3*

- 0, 10
- - 2, 6
- - - 2, 4
- - - - 2, 3*
- - - 3, 3*
- - 5, 3*

- 0, 12
- - 2, 7*
- - 3, 5*

- 0, 14
- - 2, 8
- - - 2, 5*
- - 7, 3*

- 0, 15
- - 3, 6
- - - 2, 4
- - - - 2, 3*
- - - 3, 3*
- - 5, 4
- - - 2, 3*