OFFSET
1,1
COMMENTS
A parity argument shows that the edge length of an equilateral triangle with vertices in Z^4 must be the square root of an even integer.
A characterization of the planes in which an equilateral triangle with vertices in Z^4 can lie is given in the Ionascu reference.
LINKS
E.J. Ionascu, Equilateral triangles in Z^4, arXiv:1209.0147 [math.NT], 2012-2013; Vietnam J. Math. 43 (3) (2015), 525-539.
FORMULA
a(2n) = a(n).
MATHEMATICA
a[n_] := a[n] = If[ EvenQ[n], a[n/2], Block[{p, c=0, v = Tuples[ {1, -1}, 4]}, p = Union@ Flatten[ Table[ Union[ Permutations /@ ((q #) & /@ v)], {q, PowersRepresentations[2 n, 4, 2]}], 2]; Do[ If[ Total[ (p[[i]] - p[[j]])^2] == 2 n, c++], {i, Length@ p}, {j, i-1}]; c]]; Array[a, 30] (* Giovanni Resta, May 08 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Matt Noble and Will Farran, May 07 2020
STATUS
approved