News that Chelsea Clinton is expecting a baby has spurred many questions about how becoming a grandmother might affect the presidential prospects of her mother, Hillary Clinton. A lot of those questions sound more like ageism or sexism (or both) than genuine curiosity about voter perceptions, but the news did make me wonder about the history of grandparents in the White House.

How many U.S. presidents had children when they took office? And how many presidents had grandchildren when they moved into the White House?

Given that more than 14,000 historians are members of the American Historical Association, and that genealogy has become an enormous hobby, you would think this would be an easy question to answer. But it’s not.

Some issues make collecting this information less straightforward than it at first appears. Illegitimate children, especially when their DNA ties were never proven, are unlikely to be listed beneath a president’s name. When offspring were stillborn or if they died young (as was sometimes the case for earlier chief executives’ children), their births were not always recorded.

If the numbers on the first generation of presidential offspring are shaky, the second generation is even harder to figure out. We can be pretty certain that at least 12 presidents had grandchildren when they were sworn in, but the exact number is trickier. Whether grandchildren were recorded in the history books is partly dependent on how famous (or how infamous) they were.

I couldn’t find a comprehensive list anywhere; the best I could do was extract all the information I could find from sites such as the Miller Center, IPL, Wikipedia and book extracts and pull it into one database. It’s not a perfectly reliable source, but it’s a starting point to building one. You can download the data here; tell us if you find anything that is missing or wrong, and we will update the numbers accordingly.

Only one president, James K. Polk, did not have any children at the time of taking office. In fact, six presidents didn’t have biological children at inauguration, although the other five (George Washington, James Madison, Andrew Jackson, James Buchanan and Warren G. Harding) adopted children.

Our rough estimate for the median number of children at the time of taking office is three, although there was a stark contrast between the five presidents who, like Hillary Clinton should she run and win in 2016, only had one child and the three presidents who had 10 or more children.

Grandchildren are rarer for presidents at the time of being sworn in — 32 didn’t have any by our count, although William Henry Harrison may have had all 25 of his grandchildren when he became president in 1841, given that the youngest of his 11 children was then 27.

Our three most recent presidents entered office without any grandchildren. Before them, however, George H.W. Bush, moved into the White House with 10, second in our data set only to Harrison.