If you’re a baby boomer or a member of Generation X, consider yourself unlucky.

These two generations of Americans, born between the late 1940s and the early 1980s, have earned less money and accumulated less wealth than their parents and grandparents enjoyed at the same age, William Emmons and Bryan Noeth of the St. Louis Federal Reserve Bank conclude in a new study.

That older Silent Generation, born before and during World War II, won the birth lottery in several ways. Birth rates were low during the Depression and the war, so a scarcity effect helped push up wages when the war babies entered the workforce in the 1950s.

They also were lucky enough to come of age when American industry dominated the world and unionization rates were rising. And they were lucky enough to retire after the introduction of Medicare in 1965 and inflation-indexed Social Security benefits in 1975.

Most of them were out of the workforce by 2008, when the Great Recession hit. Heavily indebted Gen Xers saw their home equity evaporate, and many younger people who lost their jobs still haven’t recovered.

“It’s not just being hit by shocks, but also about your ability to bounce back from shocks,” said Emmons, an economist at the St. Louis Fed. “Older families as a rule were more resilient in that they had more liquid assets and much less debt.”

Here’s one telling comparison from the study: In 1989, the median older American (age 62 and up) had about four times the wealth of someone under 40. Now, the older generation is nine times as rich as the younger.

Emmons said he was surprised to find such a large birth-year effect. He and Noeth sorted out the effects of race, education, health, marital status and other factors, and were left with a big difference that could only be explained by when a person was born.

How big? At a similar age and education level, someone born in 1970 earns 27 percent less and has 43 percent less wealth than a person born in 1940.

People who got more education than their parents, of course, probably out-earn them, and many boomers and Gen Xers are in that category. For much of the 20th century, though, parents assumed that prosperity would make their children better off than they were, and that’s no longer automatically true.

In a country that prides itself on being the land of opportunity, it’s jarring to think that much of your wealth depends solely on when you were born. When you add in the luck of being born into a certain ethnic group, and being born to highly educated parents, the birth lottery plays a big role in inequality.

As we debate the fortunes of the 1 percent versus the 99 percent, as the Occupy movement posed the question, does it make a difference that the 1 percent got there largely through luck?

Emmons isn’t suggesting any policy answers, but he is hoping to inform the debate. “Our approach to the inequality question is to look at the demographic factors that are determining income and wealth,” he said.

Our leaders also might want to keep this finding in mind as they debate the scope and function of government. Is it fair to spend more money on the elderly at the expense of programs that serve young families?

Maybe the answer to that question changes when we think of older Americans as the Lucky Generation.