← Complete problem index

PROJECT EULER · #0746

A Messy Dinner

Statement only · UnsolvedOriginal problem ↗

n families, each with four members, a father, a mother, a son and a daughter, were invited to a restaurant. They were all seated at a large circular table with 4n seats such that men and women alternate.

Let M(n) be the number of ways the families can be seated such that none of the families were seated together. A family is considered to be seated together only when all the members of a family sit next to each other.

For example, M(1)=0, M(2)=896, M(3)=890880 and M(10)170717180(mod1000000007).

Let S(n)=k=2nM(k).

For example, S(10)399291975(mod1000000007).

Find S(2021). Give your answer modulo 1000000007.

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.