The anionic species (AlnX3n+1)(-) with X = Cl or Pr and n greater than or equal to 1 have been recognized for a number of years to form in acidic liquid mixtures of aluminium chloride or bromide with the corresponding halides of alkali or organic cations, in relative proportions which vary with the composition of the mixture. In this work we evaluate the structure and the energetics of such polymeric series in a comparative study of Al and Ga compounds. To this end we first extend an earlier study of the ionic interactions in the Al2Cl6 molecule [Z. Akdeniz and M. P Tosi, 2. Naturforsch. 54a, 180 (1999)] to determine microscopic ionic models for Ga2Cl6, Al2Br6, and Ga2Br6. The models are then used (i) to evaluate the polymeric clusters for n less than or equal to 4 in the two trivalent-metal chlorides, and (ii) to explore the potential-energy hypersurface of alkali counterions in the case n = 2. We present tests of the results against available data and an evaluation of the convergence of the energy of the polymeric series towards a value of about 0.5 eV per monomer.