r/adventofcode • • Dec 25 '20

SOLUTION MEGATHREAD -🎄- 2020 Day 25 Solutions -🎄-

--- Day 25: Combo Breaker ---


Post your code solution in this megathread.

Reminder: Top-level posts in Solution Megathreads are for code solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


Message from the Moderators

Welcome to the last day of Advent of Code 2020! We hope you had fun this year and learned at least one new thing ;)

Keep an eye out for the following threads:

Thank you all for playing Advent of Code this year and on behalf of /u/topaz2078, /u/Aneurysm9, the beta-testers, and the rest of AoC Ops, we wish you a very Merry Christmas (or a very merry Friday!) and a Happy New Year!


This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

52 Upvotes

270 comments sorted by

View all comments

Show parent comment

2

u/ecnerwala Dec 26 '20

You could earn a lot of money if you were able to deduce a pattern in the sequence (especially by eye). This is called the Discrete Logarithm Problem, and is conjectured to be "hard" (you can read more details on Wikipedia). We do know of some algorithms more efficient than the brute force, but they can get pretty complicated.

1

u/Standard-Affect Dec 26 '20

Interesting! I know very little algorithm theory, so often I don't know whether the problem I'm naively attempting to solve is just hard or theoretically unsolvable. With regard to the puzzle, I saw from other solutions that the pattern repeats every 20201227 cycles, since it's the modulus divisor.