PROJECT EULER · #0789
Minimal Pairing Modulo
Given an odd prime
The total cost of a pairing is the sum of the costs of its pairs. We say that such pairing is optimal if its total cost is minimal for that
For example, if
The cost product of a pairing is the product of the costs of its pairs. For example, the cost product of the optimal pairing for
It turns out that all optimal pairings for
Find the value of this product.
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.