Model of n coupled anharmonic oscillators and applications to octahedral molecules