Problem

Source: CGMO 2015 Q4

Tags: number theory, greatest common divisor



Let $g(n)$ be the greatest common divisor of $n$ and $2015$. Find the number of triples $(a,b,c)$ which satisfies the following two conditions: $1)$ $a,b,c \in$ {$1,2,...,2015$}; $2)$ $g(a),g(b),g(c),g(a+b),g(b+c),g(c+a),g(a+b+c)$ are pairwise distinct.