Skip to content

Searching for Primes: A Neural AlphaZero Approach to a Factoring Game

Marcel Crasmaru

math.OC

Abstract

We study a one-player token game on an N×NN\times N board where tokens slide along diagonals or duplicate onto neighbouring ones to form a combinatorial rectangle R×SR\times S. A conserved integer weight W&#39; and a strict monovariant guarantee O(N2)O(N^2)-length solutions, placing the game in NP\mathsf{NP}. We prove that reaching a final position factors this 2N2N-bit W&#39; into two NN-bit factors V,M<2NV,M < 2^N that encode the rectangle&#39;s rows and columns. Consequently, solving the game for a balanced-semiprime target is equivalent to integer factoring. However, if the target rectangle is known, the solution reduces to two polynomial-time steps: a forced downward chip-flow and a 0/10/1-polynomial factorisation leveraging Cohn&#39;s theorem. The game&#39;s entire difficulty is thus isolated to the initial number-theoretic split. Supplying the popcounts of the factors as a promise preserves this asymptotic hardness but bounds the target search space. We exploit this constrained space using a learned policy/value network and an AlphaZero-style Monte-Carlo tree search, empirically probing the limits of neural look-ahead on a factoring-equivalent environment.

Create a lesson

Metadata

Categories
math.OC, cs.CR