Filling in a rational orthogonal matrix given one row

Quick version: given natural $n$ and a row of $n$ integers such that the sum of the squares is another square, call it $m^2.$ For $n=5,6,7$ is it always possible to fill in the rest of an $n$ by $n$ matrix of integers, call it $M,$ so that $M M^T = m^2 I?$ If so, $M/m$ is rational orthogonal.

Notes: this is true for $n=1,2,3,4,8.$ 1 is trivial 2 uses complex numbers, 4 uses quaternions, 8 uses octonions. 3 uses quaternion stuff applied to ternary quadratic forms, papers of Jones and Pall mostly, the main one 1939. The naive adaptation of the Jones-Pall formalism to our $n=7$ does not work very well, see Realizing proper pure octonions as conjugates

This is false for $n = 9,17,25,33,\ldots.$ Indeed, take any odd $n = k^2,$ let the first row have all entries $1,$ no second row is possible that is orthogonal to the given first row, consists of integers, and has the same length. Problem mod 2, insofar as the dot product of the two rows is odd, therefore nonzero. Actually, for any $n >1, \; \; \; n \equiv 1 \pmod 8,$ one may specify any $n-3$ odd numbers, then find the final three (also odd) by Gauss three square theorem to get an odd square sum, no luck.

Anyway, I did some computer checks, entirely successful for small entries for $n=5,6,7,$ and instinct tells me that it only gets easier with larger entries.

So, that is the short version, does this work for any first row of integral length (sum of squares is another square) in dimension $n=5,6,7?$

• That's nice, if you do a large number of edits, but they are all in a few minutes, it clumps them together and counts only one edit. May 6, 2013 at 19:42
• Indeed. However, note that after a certain number of edits (maybe 8) the question automatically becomes CW, so be careful despite the clumping. May 6, 2013 at 19:51
• @Tony, yes, I pay attention to that. If I click in the middle, where it currently says "edited 13 mins ago" it shows me the revision list and the official edit count. So that is how I know when to start an answer of my own, for example. May 6, 2013 at 19:54
• You might be interested in weighing matrices. (I think that's the term.) I know Robert Craigen and others in combinatorial matrix theory have studied matrices with MM^T = wI. Also Will Orrick might know some people who can help. Gerhard "Ask Me About Indirect References" Paseman, 2013.05.06 May 6, 2013 at 20:03
• @Gerhard, I used to have a very nice bathroom scale, based on strain gauge. Later I dripped a bunch of water on it and it died. en.wikipedia.org/wiki/Weighing_matrix Will Orrick is an MO regular, not sure about the other name. It appears the important case for most people has entries $0,1,-1.$ May 6, 2013 at 20:37