Natural language processing (NLP) has greatly advanced in machine learning, but math education software lacks AI integration for solving math word problems in English. We propose using the BertGen pre-trained Transformer model, along with the MAWPS dataset augmented by our dataset augmenter. The Transformer model, with its multi-head attention mechanisms, excels at capturing longrange dependencies and referential relationships, crucial for math word problems at the primary school level. Our accuracy tests and performance on different datasets validate the effectiveness and generalizability of our approach. Moreover, our augmented dataset outperforms smaller unaugmented datasets, while maintaining diversity. The math word problem augmenter can be adapted for other math problem sets, supporting future research in the field.