From b45f31b01c165c64d9c821fc36244da5d950962e Mon Sep 17 00:00:00 2001 From: Brian Chu Date: Sun, 9 Jan 2022 17:24:34 -0800 Subject: solution for day 25 --- day25.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 day25.md diff --git a/day25.md b/day25.md new file mode 100644 index 0000000..7ff839c --- /dev/null +++ b/day25.md @@ -0,0 +1,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 \ No newline at end of file -- cgit 1.4.1-2-gfad0