Can the Sun set twice during the same day on Mercury?

Mercury's day is only a little bit shorter than its orbital period, the relationship is a 3:2 resonance.

However, I noticed that the planet's angular velocity at perihelion, 0.265 arc-degrees per hour, is slightly larger than the angular velocity of its rotation, 0.256 arc-degrees per hour. Does that mean that the Sun briefly goes in the opposite direction across the sky when Mercury is at perihelion? If so, are strange phenomena like a double sunset or double sunrise possible?

The angular velocity of the orbit is larger for 25.5 degrees before and after perihelion, making the total retrograde motion 1.2 degrees.

If memory serves correctly*, then the angular diameter of the Sun as it appears on the skies of Mercury from its surface is larger than its total angular displacement during its apparent retrograde motion at Mercury's perihelion.

So assuming that's correct and my memory didn't suffer too much in the 80's, the disco ball, erm, the Sun won't set anywhere on Mercury's surface completely assuming it also rose first completely during the same early part of a day on Mercury. But it is possible to be at a specific point on Mercury's surface where a complete sunset can follow a partial sunrise or vice versa. Otherwise yes, your calculations are correct. According to Wikipedia on Apparent retrograde motion - From Mercury (citing Strom, Robert G.; Sprague, Ann L. (2003). Exploring Mercury: the iron planet. Springer. ISBN 1-85233-731-1):

At specific points on Mercury's surface, an observer would be able to see the Sun rise part way, then reverse and set before rising again, all within the same Mercurian day. This apparent retrograde motion of the Sun occurs because, from approximately four Earth days before perihelion until approximately four Earth days after it, Mercury's angular orbital speed exceeds its angular rotational velocity. Mercury's elliptical orbit is farther from circular than that of any other planet in the Solar System, resulting in a substantially higher orbital speed near perihelion.

If this is difficult to imagine, I've prepared a small animation of one Mercury's orbit around the Sun, starting at aphelion (farthest distance from the Sun) where animation restarts:

Note the apparent motion of Mercury's surface with respect to the Sun's center immediately after perihelion (closest distance to the Sun). Sizes of the Sun and Mercury are of course highly exaggerated and not to scale, but the orbit's geometry and Mercury's rotation rate are correct. Animation made with realistic orbit model setting in Solar System Scope.

If you're having problems seeing the effect of the apparent retrograde motion in the animation I prepared, then this animation of Mercury's spin-orbit resonance on Sky Marvels should demonstrate it better. Sadly, it's copyrighted so I can't reproduce it here. Similar animation could be made with Celestia and a Celestia Motherlode surface map of Mercury, if someone wants to create and publish it under our license.

* Memory served, and after a bit of insisting that it does in our chat and many recalculations after by both OP and I, we finally arrived to matching numbers;

Total Sun's angular displacement during apparent retrograde motion as seen from the surface of Mercury is ~ 1.2° (I got 1.2345° or 1° 14' 4.2", if a more precise number is needed to check against), and at Mercury's 46,778,000 km distance to the Sun when apparent retrograde motion begins, Sun's angular diameter is ~ 1.706° and increasing to ~ 1.734° at perihelion. So apparent retrograde motion is roughly two thirds of Sun's angular diameter.

This goes slightly against Wikipedia's mention of about half the Sun's angular diameter in Mercury - Orbit, rotation, and longitude:

At certain points on Mercury's surface, an observer would be able to see the Sun rise about halfway, then reverse and set before rising again, all within the same Mercurian day.

But let's settle for about halfway being close enough to about two thirds, and the initial point about the Sun's apparent motion stands.

Paying it forward a bit, here's another quote of the following paragraph from the same Wikipedia page that I thought is interesting enough to reproduce here:

For the same reason, there are two points on Mercury's equator, 180 degrees apart in longitude, at either of which, around perihelion in alternate Mercurian years (once a Mercurian day), the Sun passes overhead, then reverses its apparent motion and passes overhead again, then reverses a second time and passes overhead a third time, taking a total of about 16 Earth-days for this entire process. In the other alternate Mercurian years, the same thing happens at the other of these two points. The amplitude of the retrograde motion is small, so the overall effect is that, for two or three weeks, the Sun is almost stationary overhead, and is at its most brilliant because Mercury is at perihelion, its closest to the Sun. This prolonged exposure to the Sun at its brightest makes these two points the hottest places on Mercury. Conversely, there are two other points on the equator, 90 degrees of longitude apart from the first ones, where the Sun passes overhead only when the planet is at aphelion in alternate years, when the apparent motion of the Sun in Mercury's sky is relatively rapid. These points, which are the ones on the equator where the apparent retrograde motion of the Sun happens when it is crossing the horizon as described in the preceding paragraph, receive much less solar heat than the first ones described above.

• All assuming the observer survives long enough... Commented Jan 30, 2016 at 23:09
• This is excellent!! - having it all worked out here. The animation is very helpful - is there a chance that you can add an additional, identical copy, except say 4 or 5 times slower? I can't follow the terrain features because it's moving too fast for me. Maybe add a dot or some marking? Is it possible to add Solar System Scope output to Wikipedia Commons also?
– uhoh
Commented Jan 31, 2016 at 15:38
• Maybe a clearly colored dot that remains in the same place on the surface could make the rotation easier to follow, without significantly increasing the size of the animation image file?
– user
Commented Feb 1, 2016 at 12:42
• Please see the update Commented Feb 1, 2016 at 22:02