The odds of winning the $654 million Mega Million prize last year were put at one in 302 million, while the $345 million Powerball offered one chance in 292 million. But those astronomical odds apparently haven't deterred the many Americans who are banking on using a lottery jackpot for their retirement nest egg.

More than two-thirds of millennials are waiting on a winning a lottery jackpot to secure their retirements, according to a survey by STASH, a consumer investing app.

Thirty-one percent of Americans don’t invest because they think it’s risky, but 39 percent, including 59 percent of millennials, feel it’s reasonable to think of the lottery jackpot as a potential means of retirement, according to the survey.

The survey indicated that winning the lottery is the only plan that many Americans have for retirement.

Eighteen percent are basing their retirement plans on hopes they will win the lottery, including 26 percent millennials, 19 percent Gen Xers and 13 percent baby boomers, according to the survey.

Miillennial men in particular (66 percent) believe the lottery is a reasonable retirement plan, compared to 58 percent of millennial women. However, if they did win the lottery, more millennial men (61 percent) than women (42 percent ) would save or invest the entire amount.

The survey also provided some insight into U.S. workers who are approaching their retirements the old fashioned way.

More than a fifth (22 percent) plan to spend their retirement working a part-time job, 4 percent hope to find cheaper living abroad, 4 percent will depend on their children, and 3percent will look for a rich spouse to support them, according to the report.