Forget the pills and prescriptions. Pat Lillehei has discovered a better recipe for good health: daily doses of running, swimming and cycling, along with regular injections of triathlons and swim races.

Lillehei, 71, believes that “motion is medicine.’’ Since 2008, when she awakened to the benefits of exercise and good nutrition, the Minneapolis resident has competed in 18 triathlons and several masters swimming events. She’s participating in both sports at the National Senior Games, swimming in six races this week after doing the triathlon last Saturday.

During her 30 years as a stockbroker, Lillehei often told people she would continue working until she was carried out of the office in a box. She left instead on two strong, fast legs, retiring in April to spend more time enjoying her favorite sports and the rewards that come with them.

“It’s time to have a new purpose in life, where you can be healthy and be with the people you love,’’ Lillehei said. “There is fun after 70. I’m having more fun than I ever had, and I’m healthier than I’ve ever been.’’

Lillehei’s transformation began in 2008, when her daughter asked her to do the National Multiple Sclerosis Society’s 150-mile bike ride. She started working out over her lunch hour to get into shape, and though she was among the last people to cross the finish line, she still felt a sense of accomplishment.

An acquaintance urged her to try a triathlon at Lake Nokomis. Lillehei finished that, too, and noticed she was feeling better and losing weight. She set a new goal in 2010, when she learned the National Senior Games would be held in Minnesota this summer.

“That felt like a door opening for me,’’ said Lillehei, who has lost 50 pounds since she got active and retooled her eating habits. “I really wanted to participate, and that gave me a great sense of purpose.’’

Lillehei has competed in the past two National Senior Games, as well as many local triathlons. Last month, she won three events and placed second in two others at the Minnesota Masters state swim meet. Accompanied by her husband, Bruce, Lillehei will travel to Utah for the Huntsman World Senior Games in October, and she is aiming to qualify for the 2017 World Masters Games in New Zealand.

She also loves trying new sports, especially with her active family. Lillehei wants to buy a stand-up paddle board to use at the lake, and she skis on both water and snow with her kids and grandkids.

It often strikes her as odd, Lillehei said, when people express surprise that a 71-year-old woman is diving into all those activities.

“I’ve raced against people in their 80s who have passed me, and I couldn’t catch them,’’ she said. “That inspires me to keep doing this until I’m 85, or more. My future is going to be even more fun.’’