Last active
January 5, 2016 16:49
-
-
Save ghaiklor/9e05ef6320306ff7e50e to your computer and use it in GitHub Desktop.
Advent of Code (Day 25)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ROW = 3010; | |
const COLUMN = 3019; | |
const FIRST_CODE = 20151125; | |
const TARGET_INDEX = ((Math.pow(ROW + COLUMN - 1, 2) + ROW + COLUMN - 1) / 2) - ((ROW + COLUMN - 1) - COLUMN); | |
let result = FIRST_CODE; | |
for (var i = 1; i < TARGET_INDEX; i++) { | |
result = (result * 252533) % 33554393; | |
} | |
console.log(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment