summary refs log tree commit diff stats
path: root/day25.md
blob: 7ff839cf336e48ef7b25dbdce666a57022e57744 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Based on decompiling the code we realize that the program essentially accomplishes this:

```
d = a + 2548
while true {
  a = d
  while a != 0 {
    b = a % 2
    a /= 2
    output b
  }
}
```

which basically takes the value of d and prints out the reverse binary representation over and over

the lowest such number above 2548 is 2730, which in binary is 101010101010 so we initialize a to value 2730 - 2548 = 182