Mario's Early Years! Fun with Numbers
From the Super Mario Wiki
Mario's Early Years! Fun with Numbers is an educational Mario game that taught numbers and basic geometry/sorting to children. It was released for the PC and SNES in September 1994, following Fun with Letters and preceding Preschool Fun.
The game takes place on a set of islands to which Mario and Princess Peach sail. The player can click one of the islands to enter, after which the player sees Luigi asleep. Once the player clicks him, various activities must be performed to learn.
The SNES version of the game is generally the same as the PC edition, but with some differences due to system, decreased space, etc...