Minor correction : the lower Hamming bound for g=5 if exact not only if one of the ai is 1, but also in the particular case where all the a_i are equal to 2.
Good synthese of various results, by the way, thanx!