Problem

Source: 2021 Chile National Olympiad level 2 p1

Tags: number theory, Last digit, recurrence relation



Consider the sequence of numbers defined by $a_1 = 7$, $a_2 = 7^7$ , $ ...$ , $a_n = 7^{a_{n-1}}$ for $n \ge 2$. Determine the last digit of the decimal representation of $a_{2021}$.