Solution 1. 2n is the maximal number. An example of 2n vectors in the set is given by a basis and its opposite vectors. In the rest of the text we prove that it is impossible to have 2n+1 vectors in the set. Consider the Gram matrix A with entries aij=ei⋅ej. Its rank is at most n, its eigenvalues are real and non-negative. Put B=A−I2n+1, this is the same matrix, but with zeros on the diagonal. The eigenvalues of B are real, greater or equal to -1, and the multiplicity of -1 is at least n+1. The matrix C=B3 has the following diagonal entries cii=i=j=k=i∑aijajkaki The problem statement implies that in every summand of this expression at least one factor is zero. Hence trC=0. Let x1,…,xm be the positive eigenvalues of B, their number is m≤n as noted above. From trB=trC we deduce (taking into account that the eigenvalues between -1 and 0 satisfy λ3≥λ ): x1+⋯+xm≥x13+⋯+xm3 Applying trC=0 once again and noting that C has eigenvalue -1 of multiplicity at least n+1, we obtain x13+⋯+xm3≥n+1 It also follows that (x1+⋯+xm)3≥(x13+⋯+xm3)(n+1)2 By Hölder's inequality, we obtain (x13+⋯+xm3)m2≥(x1+⋯+xm)3 which is a contradiction with m≤n. Solution 2. Let Pi denote the projection onto i-th vector, i=1,…,N. Then our relation reads as tr(PiPjPk)=0 for distinct i,j,k. Consider the operator Q=∑i=1NPi, it is non-negative definite, let t1,…,tn be its eigenvalues, ∑ti=trQ=N. We get ∑ti3=trQ3=N+6i<j∑trPiPj=N+3(trQ2−N)=3∑ti2−2N (we used the obvious identities like trPiPjPi=trPi2Pj=trPiPj ). But (ti−2)2(ti+1)=ti3−3ti2+4⩾0, thus −2N=∑ti3−3ti2⩾−4n and N⩽2n.