In the 1987 movie “Rain Man,” a waitress in a diner brings a box of toothpicks to the table and accidentally spills them on the floor. Raymond Babbit, a savant played by Dustin Hoffman, studies them on the floor and instantly calculates the number: “246 toothpicks.”