An efficient algorithm to count the cardinalities of certain subsets of constant weight binary vectors is presented in this paper. The algorithm enables us to design I-symmetric error correcting/all unidirectional error detecting (1-syEC/AUED) codes with the highest cardinality based on the group Z/sub n/. Since a field Z/sub p/ is a group, this algorithm can also be used to design a field 1-syEC/AUED code. We can construct t-syEC/AUED codes for f=2 or 3 by appending a tail to the field 1-syEC/AUED codes. The information rates of the proposed t-syEC/AUED codes are shown to be better than the previously developed codes.