  Given $r\geq 3$ and $2^{r-1}+1\leq n< 2^{r}-1$, an $[n,n-r,3]$ shortened
Hamming code that can detect a maximal number of double errors is constructed.
The optimality of the construction is proven.
