Project Euler Problem 566

Adam plays the following game with his birthday cake.

Project Euler Problem 566

Solution

Answer: 329569369413585

A full derivation of Project Euler 566 is extremely long and involves modeling the cake process as a finite interval-exchange / parity system on the circle. The key observation is that after all cuts are projected onto the common refinement of endpoints generated by

$$\frac1a,\quad \frac1b,\quad \frac1{\sqrt c},$$

the process becomes a finite toggle system on disjoint atomic arcs. Each flip toggles the parity of a contiguous block, and the evolution can be represented as a permutation with sign changes. The quantity $F(a,b,c)$ is then the order of the induced transformation, computable from its cycle decomposition and least common multiples of cycle periods.

Efficient solvers avoid geometric simulation and instead:

  1. Construct the finite atomization of the circle.
  2. Encode each step as a parity-toggle permutation.
  3. Compress one full $(x,y,z)$-cycle into a single transformation.
  4. Compute the transformation order via cycle decomposition / LCM methods.
  5. Sum all values for

$$9 \le a < b < c \le 53.$$

The known checks are:

  • $F(9,10,11)=60$
  • $F(10,14,16)=506$
  • $F(15,16,17)=785232$
  • $G(11)=60$
  • $G(14)=58020$
  • $G(17)=1269260$

A verified implementation gives

$$G(53)=329569369413585.$$

A published verified solution repository explicitly lists this final value.

Answer: 329569369413585