“But the math takes a turn for the worse when they reveal an average retirement goal of only $822,789,” the study says. That problem is compounded by their belief that they will retire by age 61, on average. Goodsell says the $822,789 number is too low.

“For instance, baby boomers think they need $1 million, and that price is not going to go down over time.” He says millennials need to save about 19 percent more a year.

He says millennials’ retirement plans are flawed because they are saying they will retire “well before their Social Security age.” Goodsell notes that, in the first retirement years without Social Security, private savings “will be eroded much quicker.”

He also says age 61 is not realistic—that millennials will probably need seven or eight more years to contribute to their retirement funds and let them compound longer.

If not, “that may mean a generation, with the potential to live to age 100, could run out of money early on in a retirement that could last 30 to 40 years,” the study warns.

Generation Xers, sandwiched between those two generations, have unique problems, the survey said. Nonetheless, they still aren’t figuring on saving enough: They estimate they will need some $980,000 to retire, and that won’t be sufficient, according to Natixis.

Their current savings are not in line with their assumptions of retiring at age 64, Goodsell says.

“Currently, they have accumulated an average of just $166,328 in retirement savings. The leading edge of this generation has a little over 20 years until retirement, leaving plenty of time to potentially catch up, but many struggle to make the numbers work.”

One way financial pros say these people can close the gap is to use the catch-up provisions of many qualified plans. Here’s where an advisor could make a big difference, Goodsell says—by educating plan participants. Only 30 percent of Generation Xers take advantage of this provision allowing more saving, according to the study.

What keeps these middle-aged people from saving more and getting on track for a secure retirement?