The name Richard D. Trentlage may not roll off the tongues of most Americans, but generations can no doubt sing along to some of the catchy advertising jingles that he wrote for companies like Oscar Mayer and McDonald's.

Just try not to.

Oh, I wish I were an Oscar Mayer wiener

That is what I'd truly like to be

'Cause if I were an Oscar Mayer wiener

Everyone would be in love with me.

Mr. Trentlage, who wrote a number of jingles that have the mental stickiness of flypaper, died Sept. 21 at the Advocate Condell Medical Center in Libertyville, Illinois. He was 87.

One of his daughters, Linda Bruun, said the cause of death was congestive heart failure.

Among the other memorable melodies and tag lines he wrote: "McDonald's is your kind of place"; "Wow! It sure doesn't taste like tomato juice," for V8; and "Buckle up for safety, buckle up!" for a National Safety Council promotion for using seat belts.

The Oscar Mayer Wiener Song had its beginnings in September 1962, when Mr. Trentlage, who worked for some large advertising agencies, learned that Oscar Mayer, the food giant known for its deli meats and frankfurters, was sponsoring a contest for a wiener jingle.

He heard about the contest the day before the deadline, however. At home that night, he started to tap out ideas on a typewriter. Inspiration struck when he remembered one of his sons talking about a friend who was a "dirt bike hot dog," he told the Wisconsin State Journal in 2012.

"I wish I could be a dirt bike hot dog," his son said, using a term for someone who is cool.

That inspired Mr. Trentlage to type the first line to the jingle, which he completed within an hour. It debuted in 1963, becoming a signature tune for the company's advertising in 21 English-speaking countries until 2010, when it was retired.

An animated television commercial featured children marching and singing the praises of Oscar Mayer.

Mr. Trentlage, who lived in Fox River Grove, Ill., was a songwriter and musician who played a banjo-ukulele, a hybrid instrument that combined a banjo-like body with a ukulele neck.

While Mr. Trentlage's success with Oscar Mayer was long-lasting, it hardly happened overnight, Bruun recalled. One of his sons, David, then 11, and Bruun, then 9, recorded the jingle in a small recording studio in the family's living room.

Mr. Trentlage delivered the recording to the Oscar Mayer headquarters in Wisconsin, but it was a year before the jingle was selected as the winning entry, Bruun said. The company played it before a series of focus groups, and "that's the one that surfaced over and over" as the favorite, she said in an interview Thursday.

When the song debuted on a Houston radio station in 1963, listeners, thinking it was a pop tune, requested that it be played repeatedly, Judann Pollack, deputy editor at Advertising Age, said Thursday.

Over the years there have been perhaps 25 advertising tag lines or jingles that have truly remained memorable, she said, and "this is definitely one of them."

John H. Murphy II, a professor emeritus at the Stan Richards School of Advertising and Public Relations at the University of Texas in Austin, said the jingle was remarkable for "its longevity and uncanny freshness" after so many years.

Mr. Trentlage's work was "one of the great single accomplishments in advertising history," the professor said in an email Thursday, adding, "As far as jingles go, the OM jingle is one of the best all-time."

The song became part of the fabric of American culture, with airings on the children's television show Captain Kangaroo, on the cartoon show The Jetsons and on an episode of the The Simpsons in the 1990s, according to the Wisconsin Historical Society, which has among its possessions Mr. Trentlage's banjo-ukulele.

Bruun noted that her father continued to collect residuals on the jingle decades after it first aired. Such tunes generally have a shelf life of eight to 13 weeks, partly because of the requirement of such payments, she said.

Richard D. Trentlage was born Dec. 27, 1928, in Chicago to Richard B. and Edna Trentlage.

He discovered a passion for music early and began taking guitar lessons when he was 12. He began writing jingles as a senior at Calumet High School in Chicago, according to an obituary by his family. His first effort was on behalf of a fictional product, Modern Plastic Brooms. His idea was to create a sponsor for a high school talent show that sounded like a radio program, with the jingle for opening and closing commercials.

Fifty years after he was in high school, his classmates gathered at a reunion and sang his Modern Plastic Brooms jingle — a tribute to the staying power of his lyrics and melodies.

Survivors include his wife, Jacqueline; sons David and Tom; daughters Becky Trentlage and Bruun; stepdaughters Susan Jennings and Patricia Kelley; a stepson, Jeffrey Davis; 19 grandchildren; and 10 great-grandchildren. He was preceded in death by his first wife, Vivian Atherley; a brother, William; and a son, Terry, who died in 1997.