On the last day of his last term as mayor of New York, Michael R. Bloomberg put on a pinstripe gray-and-blue suit, tied a red-and-white tie, and soaked up something that is rarely proffered: the unabashed gratitude of a brusque city.

Outside the New York Public Library, a husky middle-age man with a heavy Brooklyn accent walked up to him, hand outstretched.

“Mayor Bloomberg,” the man shouted, “you did a great job. Thank you for being our mayor for the past 12 years.”

The mayor broke his stride, turned and smiled.

“I wish you could stay on,” the man added.

The mayor’s smile widened. He shook his hand.