His death was confirmed by Deborah Smullyan, a cousin.

Professor Smullyan was a serious mathematician, with the publications and the doctorate to prove it. But his greatest legacy may be the devilishly clever logic puzzles that he devised, presenting them in numerous books or just in casual conversation.

Sometimes they were one-offs, and sometimes they were embedded in longer narratives to explain mathematical concepts, such as Boolean logic, as he did in "The Magic Garden of George B and Other Logic Puzzles" in 2015; or retrograde analysis, as he explored in the "The Chess Mysteries of the Arabian Knights"in 1981.

He was also a character. With his long white hair and beard, Professor Smullyan resembled Ian McKellen's wizard, Gandalf, from the "Lord of the Rings" film series. He was lanky, hated exercise and loved steak and eggs. He studied Eastern religion. He told corny jokes and performed close-up magic to anyone near him. He played the piano with passion and talent into his 90s. (A career in music had been derailed by tendinitis when he was a young man.)

And he was fond of his philosophical, if silly, sayings, such as, "Why should I worry about dying? It's not going to happen in my lifetime!"

Melvin Fitting, a retired professor of mathematics, philosophy and computer science at the Graduate Center of the City University of New York, recalled Professor Smullyan's demeanor as his teacher at Yeshiva University in the 1960s while Professor Fitting was pursuing his doctorate.

"He'd be smiling in anticipation of the many beautiful things he was going to show you," the professor said in an interview.

Professor Smullyan saw beauty in the puzzles that he created, seemingly nonstop, over the decades, and viewed them as tools to spread the gospel of mathematics. In his 1982 book "The Lady or the Tiger? And Other Logic Puzzles," he wrote about the greater popularity that Euclid's "Elements" would have achieved had the Greek mathematician framed it as a puzzle book.

He wrote: "Problem: Given a triangle with two equal sides, are two of the angles necessarily equal? Why, or why not?"

His puzzles were so much a part of his identity that he posed one on his first date with his future wife, Blanche de Grab.

What he posed to her was a statement that, in the way he framed it, could only result in a kiss from her. Reminiscing about it, he wrote that it was a "pretty sneaky way of winning a kiss, wasn't it?"

Jason Rosenhouse, a mathematics professor at James Madison University, who edited a book in 2015 celebrating Mr. Smullyan, said the clarity of his puzzles could unveil the beauty of math to those who could not previously grasp it.

"It was like fooling a kid into eating his vegetables," Professor Rosenhouse said in a telephone interview, adding, "Raymond took something like Gödel's incompleteness theorems and used a string of logic puzzles as a device for presenting them."

Martin Gardner, himself a renowned math puzzler, compared Professor Smullyan to the Oxford logician Charles Dodgson, who also was an author better known by his pen name, Lewis Carroll. Professor Smullyan paid tribute to Carroll in his 1982 book "Alice in Puzzle-Land: A Carrollian Tale for Children Under Eighty."

In one chapter, Professor Smullyan wrote, Alice thinks to herself about how confusing, yet remarkably logical, Humpty Dumpty is.

"I wonder," she says, "how he manages to be both confusing and logical?"

There was, it would seem, some confusing logic in the zigzagging path of Mr. Smullyan's life.

Raymond Merrill Smullyan was born in Far Rockaway, Queens, on May 25, 1919. His father, Isidore, was a businessman; his mother, the former Rosina Freedman, a homemaker.

His education was peripatetic and eclectic. He attended both Pacific University and Reed College in Oregon, then studied mathematics and logic on his own. He learned magic. He created chess puzzles that were more concerned about moves that had been made than the ones that should be made.

He put together a magic act, and performed under the stage name Five-Ace Merrill at nightclubs like the Pump Room in Chicago, where he worked for tips. He went on to get his bachelor's degree in mathematics from the University of Chicago and a Ph.D. from Princeton. He taught at Princeton, Yeshiva, Lehman College of the City University of New York and Indiana University.

His philosophy of teaching was a little puzzling. "My policy is to teach the student as much as possible and to require from him or her as little as possible," he told Donald Albers and Gerald Alexanderson, the authors of "Mathematical People: Profiles and Interviews" in 2008.

But, he added, the impact of his apparent lenience was that many of his students worked harder in his course than in any other.

Professor Smullyan is survived by his stepson, Jack Kotik; six step-grandchildren; and 16 step-great-grandchildren. His wife Blanche, a Belgian-born pianist and music educator, died in 2006. His first marriage ended in divorce.

Mr. Kotik recalled being with his wife at the Smullyans' house in Elka Park, N.Y., and listening to a radio report about the high salaries of professional athletes. His mother, Blanche, said they were excessive.

Professor Smullyan said that to be paid so much was unfair.

"I said, 'Raymond, isn't it true that you're more intelligent than most people?'" Mr. Kotik said during a phone interview. "'Yes,' he said. So I said, 'I think that's unfair. We should take out part of your brain and distribute it to people who could use it.'

"He was silent for a minute, and finally he said, 'I can't give you any reason, but I wouldn't do it.'"

Puzzles were an essential part of Mr. Smullyan's patois -- a logician's way of greeting and testing people.

When he met his most recent editor, Rochelle Kronzek, he asked her to solve some problems.

"It intimidated me at first, but I came up with creative answers," Ms. Kronzek, the executive editor of World Scientific Publishing, said in an interview, "and more than once he smiled because he liked the way I was thinking. He got a lot of joy out of seeing how other people thought."

**Richard Sandomir**

February 11, 2017 © NY Times