Question 17N4 (BRA). Determine all triples of positive integers $(a,m,n)$ such that $a^m+1$ divides $(a+1)^n$.