Peg toybox

Both The Sims 2 and The Sims 3 have a toy which toddlers can use to build the Logic skill. They look the same in both games.

Magical Mystery's "Shape, Rattle & Roll"
In The Sims 2, it's called Magical Mystery's "Shape, Rattle & Roll", and can be bought for §30.

Baby Brainiac Peg Toybox
"'Babies are nothing but cooing simpletons who are often too easily amused. For example, toddlers love the Baby Brainiac Peg Toybox. It's like state-of-the-art entertainment to them, probably because they're too naive to know any better.'"

In The Sims 3, it's renamed the Baby Brainiac Peg Toybox, and the price is changed to §40. It will not raise a Toddler Sim's Logic skill any higher than three points, and those points will not be visible until the Sim starts skilling in Logic as a child or older life stage.