Harvard, he was the roommate of the Canadian theologian Robert Crouse. He received his AM degree the next year and was inducted into Phi Beta Kappa. He later taught mathematics and other classes at MIT, Harvard, Wellesley, and the University of California, Santa Cruz. Lehrer remained in Harvard's doctoral program for several years, taking time out for his musical career and to work as a researcher at the Los Alamos Scientific Laboratory. Lehrer was drafted into the U.S. Army from 1955 to 1957, working at the National Security Agency (NSA). Lehrer has stated that he invented the Jello shot during this time, as a means of circumventing a naval base's ban on alcoholic beverages. Despite holding a master's degree in an era when American conscripts often lacked a high school diploma, Lehrer served as an enlisted soldier, achieving the rank of Specialist Third Class, which he described as being a "corporal without portfolio". These experiences became fodder for songs, such as "The Wild West is Where I Want to Be" and "It Makes a Fellow Proud to Be a Soldier". In 2020 Lehrer publicly revealed that he had been assigned to the NSA; since the mere fact of the NSA's existence was classified at the time, Lehrer found himself in the position of implicitly using nuclear weapons work as a cover story for something more sensitive. In 1960, Lehrer returned to full-time math studies at Harvard. From 1962, Lehrer taught in the political science department at the Massachusetts Institute of Technology (MIT). In 1965 he gave up on his mathematics dissertation on modes in statistics, after having worked on it intermittently for 15 years. In 1972, Lehrer joined the faculty of the University of California, Santa Cruz, teaching an introductory course entitled The Nature of Mathematics to liberal arts majors—"math for tenors", according to Lehrer. He also taught a class in musical theater. He occasionally performed songs in his lectures. In 2001, Lehrer taught his last mathematics class, on the topic of infinity, and retired from academia. He has remained in the area, and in 2003 said he still "hangs out" around the University of California, Santa Cruz. Publications The American Mathematical Society database lists him as co-author of two papers: Two of Lehrer's songs were reprinted, with his permission, in MAD Magazine: Tom Lehrer Sings "The Wild West is Where I Want To Be" (illustrated by George Woodbridge, MAD