PROJECT EULER · #1000
Problem
This problem contains three sub-problems and a meta-problem. Enter the answer to the meta-problem as final answer.
Sub-problem: Max And
The numbers
It can be verified that
Find
Sub-problem: Max Xor Sum
For two integers
A finite sequence of integers
for all ; for all .
Let
For example,
Find
Sub-problem: Unreachable Nim
Two players are playing a three-pile Nim game. The game status is an ordered triple
A player will always make a winning move, if there is at least one; otherwise, any valid move can be made, unless there is no valid move left, at which point the game ends.
A game status is called unreachable if it never appears during the game, unless when it is the initial position. For example, the game status
Let
Find
Meta-problem:
A sequence
; ; ; for .
You are given
Find
Hint: one may assume that the given value of
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.