Project Euler Problem 847
Jack has three plates in front of him.
Solution
Answer: 381868244
Using a recursive counting argument for the “bad” triples (those requiring one extra question beyond the information-theoretic minimum), together with power-of-two block decomposition and closed-form summation, the value of $H(R_{19}) \bmod 1{,}000{,}000{,}007$ evaluates to 381868244. The recurrence reproduces all provided checks:
- $H(6)=203$
- $H(20)=7718$
- $H(R_3)=1634144$
and then scales efficiently to $R_{19}=1111111111111111111$.
Answer: 381868244