Government says £8.2m will help more than 7,000 pupils to study maths at A level and get into AI-related jobs.