What is the purpose of learning LCM and HCF in mathematics?