Problem

Source: Indonesian National Science Olympiad 2018, Mathematics P1

Tags: number theory, relatively prime



Let $a$ be a positive integer such that $\gcd(an+1, 2n+1) = 1$ for all integer $n$. a) Prove that $\gcd(a-2, 2n+1) = 1$ for all integer $n$. b) Find all possible $a$.