Find all triplets of positive integers (a,m,n) (a,m,n)(a,m,n) such that am+1∣(a+1)n a^m +{} 1 \mid (a +{} 1)^nam+1∣(a+1)n .