The exact solution to the Burnt Pancake Puzzle

These results flip the script on a classic brainteaser.

A longstanding puzzle about sorting a messy stack of pancakes with burnt sides has finally been solved for certain cases, thanks to new mathematical insights. Researchers Nacim Oijid and Gerold Jäger from Umeå University in Sweden revealed the precise number of flips needed to tidy up the toughest arrangements when the stack size follows one specific pattern, like 5, 9, or 13 items. Their work builds on earlier efforts and pins down the answer exactly for all odd-sized stacks.

The burnt pancake problem imagines a waiter who has a pile of differently sized pancakes, each with a burnt side; the pile is already ordered by size, but every pancake is upside down. With only a single spatula, he can flip the top k pancakes at once. The question is how many flips are needed to make every pancake both the right way up and in the right order? It’s a playful-sounding puzzle, but it maps to a huge graph of possible stacks and has connections to sorting algorithms, DNA rearrangements, and robotic planning.

Oijid and Jäger focused on the hardest starting mess, where the pancakes sit largest to smallest with all burnt sides exposed. They calculated the largest number of flips required in this worst case, known as T(n), where n is the stack size. “In our work, we present that ⌊(3n + 3)/2⌋ is also an upper bound of T(n) for n ≡ 1 mod 4, which again matches the lower bound of Cibulka (2011) and thus is exact,” the researchers wrote. For odd n starting from 19, this means exactly floor((3n + 3)/2) flips suffice and are necessary—no more, no less.

To achieve this result, the team started with computer searches to find the shortest flip sequences for smaller stacks, such as 29, 33, or 37 pancakes. These base cases helped them identify patterns. Then, they generalized the approach for larger stacks in the same family by adding extra steps that handle more pancakes without increasing the number of moves unnecessarily. The method divides the process into phases. First, splitting large, disorganized groups into pairs. Second, sorting those pairs toward order. Finally, merging everything into the neat stack. Each phase uses targeted flips to minimize waste, keeping the total moves as low as possible.

However, the even-size case remains unresolved. “The case of even n keeps an open problem, where two possible values for T(n) are possible, namely ⌊(3/2)n⌋ + 1 or ⌊(3/2)n⌋ + 2,” noted Oijid and Jäger. For even-sized stacks from 14 onward, the exact figure narrows to one of those two, but pinning it down awaits future work.

Citations

N. Oijid and G. Jäger et al. Exact number of flips required to sort a burnt stack of pancakes. ArXiv Preprint. Published online January 14, 2026. DOI: 10.48550/arXiv.2601.09447

Sanket Mungase
Sanket Mungase
Sanket Mungase is a freelance science writer who covers everything from science, space, robotics, and technologies that change our world. He holds a degree in Mechanical Engineering.