A leaked dataset from the Pi Market reveals that some stock prices were altered to match the sequence of digits in Pi. Your first task is to identify which days were manipulated by finding stock prices that appear sequentially within the first 32 digits of Pi.
A clue found on π-Ghost's laptop suggests that the secret code is hidden within these manipulated prices. Follow these steps:
- Search for price values that appear in the sequence of Pi.
- Find the earliest occurrence of each price in the Pi sequence and match it to the corresponding day.
- Continue the process until no more prices match a sequence in Pi.
Once you've identified the manipulated days and their corresponding prices, put them in order from smaller to largest day and apply the following operations:
- Use the price from the first manipulated day as your base value.
- For every subsequent manipulated day, perform an operation based on the day number:
- - If day number is even, multiply the current value by the price from that day.
- - If day number is odd, divide the current value by the price from that day.
- Continue this process sequentially for all manipulated days to arrive at the final secret code.
The secret code is the first ten digits of the result removing any character that is not a number.
Example Calculation
Imagine we use the first digits of the Phi number (1.61803…) instead of Pi. Here's a sample dataset:
Day Price ($) Ticker
1 0.3 GST
2 3.75 IVA
3 2.64 SPI
4 7.77 LCK
5 1.6 HST
6 1.8 NUM
7 5.88 XIJ
From the Phi sequence, we find the manipulated prices happened on days 1, 5, and 6, so we order them by its day number:
Day Price ($) Ticker
1 0.3 GST
5 1.6 HST
6 1.8 NUM
Notice that in the prices, the numbers can be decimals, while in the constant value the correspond value could be an integer.
Now, we apply the operations:
- Start with 0.3 (from day 1).
- Day 5 (odd) → Divide by 1.6 → 0.3 / 1.6 = 0.1875
- Day 6 (even) → Multiply by 1.8 → 0.1875 * 1.8 = 0.3375
Final secret code = 03375 = 3375
Pi Market Dataset:
Day Price ($) Ticker
1 150.00 TLM
2 93.23 PIH
3 300.50 MTH
4 420.75 IUV
5 3.14 GST
6 720.20 FKE
7 12.57 KVW
8 88.90 TEC
9 210.00 OIL
10 2.64 PHI
11 45.60 CUV
12 33.83 SPI
13 999.99 MEME
14 28.27 MED
15 123.45 BIA
16 65.80 REN
17 6.53 HST
18 250.00 AND
19 18.85 YVO
20 33.33 XOR
21 8.46 NUM
22 777.77 POT
23 9.42 BNO
24 199.99 NOT
25 15.92 SPI
26 850.00 VSL
27 19.94 IVA
28 58.97 GST
29 27.95 PHI
30 21.99 EXW