Problem

Source: 2022 Thailand MO Day 2 P7

Tags: number theory, Sequence



Let $d \geq 2$ be a positive integer. Define the sequence $a_1,a_2,\dots$ by $$a_1=1 \ \text{and} \ a_{n+1}=a_n^d+1 \ \text{for all }n\geq 1.$$Determine all pairs of positive integers $(p, q)$ such that $a_p$ divides $a_q$.