Off-diagonal all-ones quadratic form
= Off-diagonal all-ones quadratic form
{title2=$q(x)=(\sum_i x_i)^2-\sum_i x_i^2$}
Its symmetric matrix is $\mathbf1\mathbf1^T-I$. The line spanned by $\mathbf1$ has eigenvalue $n-1$ and its orthogonal complement has eigenvalue $-1$. Thus for $n>1$ it is nondegenerate with inertia $(1,n-1,0)$; for $n=1$ it vanishes. This gives a useful explicit example for <Sylvester's law of inertia>.