Finish 2015.

This commit is contained in:
2024-05-08 18:29:48 -04:00
parent f0a6214052
commit 4e6a44f67b
5 changed files with 134 additions and 29 deletions

19
2015/d25.py Normal file
View File

@@ -0,0 +1,19 @@
import sys
from lib import str_to_ints
with open("i25.txt", "r") as f:
target_row, target_col = str_to_ints(f.read())
x = 20151125
m = 252533
d = 33554393
for start_row in range(1, 10000):
row, col = start_row, 1
while row > 0:
if row == target_row and col == target_col:
print(x)
sys.exit(0)
x = (x * m) % d
row -= 1
col += 1