(*start*)
nn = 15;
p = 2;
f = x^p + y^p - z^p;
g[n_] := DivisorSum[n, MoebiusMu[#] # &]; Monitor[
Table[Sum[
Sum[Sum[Sum[If[GCD[f, n] == k, 1, 0]*g[k], {x, 1, n}], {y, 1,
n}], {z, 1, n}], {k, 1, n}], {n, 1, nn}], n]
(*end*)
Output:
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
g[n_] is the Dirichlet inverse of the Euler totient function.
I suspect that p=1 and p=2 are the only values for which the Fermat last theorem equation outputs the charachteristic sequence of 1.