The valence of a representative element equals the number of valence electrons or eight minus that number. Balance the valences to get the formula.
(a) Li (group 1, valence 1) and O (group 16, valence 2): Li2O
(b) Mg (group 2, valence 2) and N (group 15, valence 3): Mg3N2
(c) Al (group 13, valence 3) and I (group 17, valence 1): AlI3
(d) Si (group 14, valence 4) and O (valence 2): SiO2
(e) P (group 15, valence 3 or 5) and F (valence 1): PF3 and PF5
(f) Element 71 is lutetium (Lu), the last lanthanoid, [Xe]4f145d16s2, with the common oxidation state +3; F has valence 1: LuF3