On the inversion of a certain gram matrix