MathDB
Easy problem, but with infinite calculations

Source: Brazilian Mathematical Olympiad 2023, Level U, Problem 5

October 21, 2023
modular arithmeticgenerating functionsrecurrence relationalgebra

Problem Statement

A drunken horse moves on an infinite board whose squares are numbered in pairs (a,b)Z2(a, b) \in \mathbb{Z}^2. In each movement, the 8 possibilities (a,b)(a±1,b±2),(a, b) \rightarrow (a \pm 1, b \pm 2), (a,b)(a±2,b±1)(a, b) \rightarrow (a \pm 2, b \pm 1) are equally likely. Knowing that the knight starts at (0,0)(0, 0), calculate the probability that, after 20232023 moves, it is in a square (a,b)(a, b) with a4(mod8)a \equiv 4 \pmod 8 and b5(mod8)b \equiv 5 \pmod 8.