#!/usr/bin/env python pos_row, pos_col = 1, 1 target_row, target_col = 2978, 3083 curr = 20151125 for i in range(sum(range(target_row + target_col - 1)) + target_col - 1): curr = (curr * 252533) % 33554393 print(curr)