I am not aware of a single formula, only recursive formulas involving the "shuffle basis" for Cayley-Dickson spaces. The shuffle basis is not the one commonly used by most researchers. For the shuffle basis, $e_0=1$ and $e_{2n}=(e_n,0)$ and $e_{2n+1}=(0,e_n)$. Furthermore, the product $e_pe_q=\pm e_{pq}$ where $pq$ is defined as the 'exclusive or' of the binary representations of $p$ and $q$. There are actually eighteight[edit: four] different Cayley-Dickson doubling products which satisfy the quaternion properties but the one most commonly used is $(a,b)(c,d)=(ac-db^*,a^*d+cb)$. For each of the eighteight[edit: four] Cayley-Dickson doubling products there is a distinct and well-defined 'sign function' or 'twist' $\omega(p,q)$ such that $e_pe_q=\omega(p,q)e_{pq}$. It is always true that $\omega(0,0)=\omega(p,0)=\omega(0,q)=1$ and that $\omega(p,p)=-1$ for $p>0.$ This much is true for all eighteight[edit: four] Cayley-Dickson doubling products. For the product mentioned above, for all positive $n$, $\omega(1,2n)=1$ and $\omega(2n,1)=-1$. Furthermore, for $0\ne p\ne q\ne 0$ $\omega(p,q)=-\omega(q,p)$ is true for all eighteight[edit: four] doubling products. For the given doubling product it is also true that the following are all equal for $0\ne p\ne q\ne 0$: $\omega(p,q),\omega(2p,2q),\omega(2q,2p+1),\omega(2q+1,2p),\omega(2q+1,2p+1).$ From these properties, the 'sign function' or 'twist' $\omega(p,q)$ for all higher dimensional Cayley-Dickson algebras can be recovered inductively when using the shuffle basis. You can visit my website jwbales.us for more information.