The chemical formula for quartz is SiO2. This means that one mole of quartz contains one mole of silicon atoms and two moles of oxygen atoms. However, one silicon atom is locally bonded to four other oxygen atoms in the crystal structure of quartz.
Quartz exists as a continuous framework of atoms arranged in a tetrahedral tessellation. In this tessellation, one silicon atom is bonded to four oxygen atoms, while one oxygen atom is bonded to two silicon atoms. This means that the repeating unit of the crystal structure only contains one silicon atom and two oxygen atoms, giving the chemical formula SiO2.