Find all triples (a, b, c) such that a, b and c are all elements of the set {1, 2, 3, ..., 2015} and:
g(a), g(b), g(c), g(a + b), g(b + c), g(c + a), g(a + b + c) are all pairwise distinct, where g(n) is the GCD of n and 2015.
WLOG it can be assumed that $a > b > c \geq 1$ since if $a = b = c$ it is impossible for the above system to be pairwise distinct. How might one proceed?
This is just a start of an answer.
$2015=5\cdot 13\cdot 31$. So $g(n)$ is entirely determined by the subset of the primes $p\in\{5,13,31\}$ such that $p\mid n$. There are seven such subsets that we want distinct, and a total of $8$ such subsets.
Assume $g(a)=5,g(b)=13,g(c)=31$. Then $g(a+b)$ cannot have $13$ or $5$ as a factor, and it can't be $31$, so it must be $1$. But then likewise $g(a+c)=1$. So we can't have $g(a),g(b),g(c)$ all primes.
Another possibility is $g(a)=5\cdot 13,g(b)=13\cdot 31,g(c)=5\cdot 31$. Then $g(a+b)$ must be $13$, $g(a+c)=5,g(b+c)=31$, and $g(a+b+c)=1$. This becomes a set of Chinese remainder theorem questions:
$$a\equiv 0\pmod{5}\\ a\equiv 0\pmod{13}\\ a\equiv a_0\pmod{31} $$ $$ b\equiv 0\pmod{13}\\ b\equiv 0\pmod{31}\\ b\equiv b_0\pmod{5}\\ $$ $$ c\equiv 0\pmod{5}\\ c\equiv 0\pmod{31}\\ c\equiv c_0\pmod{13} $$
Where $a_0,b_0,c_0$ are not zero in the respective modulus.
This gives that $$a\equiv 65\cdot (-10)a_0\pmod{2015}\\ b\equiv 13\cdot 31\cdot 2b_0\pmod{2015}\\ c\equiv 5\cdot 31\cdot (-1)c_0\pmod{2015}$$
This will give you $30\cdot 12\cdot 4=1440$ distinct solutions.
I don't know if there are others, but you can try to enumerate what the seven subsets of $\{5,13,31\}$ can look like. If the commenter above is correct, there are lots more.
Since we are taking exactly seven of the eight subsets of $\{5,13,31\}$, this means that each prime must occur in either exactly three or exactly four of the values $g(a),g(b),g(c),g(a+b),g(a+c),g(b+c),g(a+b+c)$.
Now, $5$ cannot divide each of $a,b,c$, or it would divide all seven values.
If $5$ divides exactly two of $a,b,c$, the it can only divide one of $a+b,a+c,b+c$, and it cannot divide $a+b+c$.
Is there any way for $5$ to divide for of the values? If $5\mid a+b+c$? No, because we'd get an odd number of subsets that add up to a multiple of $5$. E.g, we'd have $5\mid a+b$ iff $5\mid c$, so the other multiples of $5$ would come in pairs.
If all three of $a+b,a+c,b+c$ are divisible by $5$, then so is $2(a+b+c)$ and hence $a+b+c$ and hence $a,b,c$.
So you eventually get that there is no possible way for $4$ of $g(a),g(b),...,g(a+b+c)$ to be divisible by $5$, so it must be exactly $3$.
And the same is true for $13$ and $31$.
But if two of $a+b,a+c,b+c$ are divisible by $5$, then it is not possible for only one of $a,b,c$ to be divisible by $5$.
So we are left with the possible patterns for $a,b,c,a+b,a+c,b+c,a+b+c$ and divisibility by $p\in\{5,13,31\}$:
$a+b+c$ is divisible by $p$ and one pair $\{a,b+c\}$, $\{b,a+c\}$, and $\{c,a+b\}$ is divisible by $p$.
Two of $a,b,c$ are divisible by $p$.
The answer I gave above covers the case where each prime $p$ is in case $(2)$.
The first case I covered was the possibility that all are $(1)$ and disjoint.
The other case where all are $(1)$ is $g(a)=1$, $g(b)=p_1$ and $g(c)=p_2p_3=2015/p_1$. But then $g(b+c)=1$. So all are $(1)$ is not possible.
So the question is finally, can there be mixes of (1) and (2).
I think there are. For example, it is possible for $$g(a)=p_1p_3,\\g(b)=p_1p_2,\\g(c)=p_2,\\g(a+b)=p_1,\\g(a+c)=1,\\g(b+c)=p_2p_3,\\g(a+b+c)=p_3$$
With $(p_1,p_2,p_3)=(5,13,31)$, this gives: $$a\equiv 0\pmod{5}\\ a\equiv a_0\pmod{13}\\ a\equiv 0\pmod{31} $$ $$ b\equiv 0\pmod{5}\\ b\equiv 0\pmod{13}\\ b\equiv b_0\pmod{31}\\ $$ $$ c\equiv c_0\pmod{5}\\ c\equiv 0\pmod{13}\\ c\equiv -b_0\pmod{31} $$
Getting another $1440$ solutions of the form:
$$a\equiv 5\cdot31\cdot(-1)a_0\pmod{2015}\\ b\equiv 5\cdot 13\cdot (-10)b_0\pmod{2015}\\ c\equiv 13\cdot 31\cdot 2c_0 -b\pmod{2015} $$
It's not hard to show that the $g$ values can never be $2015$. This is essentially because it would consume three of the nine prime factors we have to divvy up amongst the remaining six $g(\cdot)$ values, and there is no way to do that and get six distinct values.