A three-year-old boy has attracted attention after confidently solving a substitution problem during a math exercise at home.