惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
The Cloudflare Blog
WordPress大学
WordPress大学
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 司徒正美
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
C
Check Point Blog
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
V
V2EX
F
Fortinet All Blogs
B
Blog
大猫的无限游戏
大猫的无限游戏
N
Netflix TechBlog - Medium
B
Blog RSS Feed
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

IBM Research

Introducing IBM and NASA’s new foundation model for the Moon Switzerland's first IBM Quantum System Two | IBM Quantum Computing Blog Cleveland Clinic, RIKEN, IBM named Gordon Bell finalists | IBM Quantum Computing Blog How llm-d makes the most of the hardware you already have Ponder This Challenge - September 2026 - Loeschian Arithmetic Progressions IBM Quantum Nighthawk r2—more circuits, faster | IBM Quantum Computing Blog What happens when information theory accounts for reasoning? Granite 4.2 brings native reasoning to enterprise agents Qiskit Fermions: a modular toolbox for fermionic systems | IBM Quantum Computing Blog IBM’s new modular architecture for cryogenic systems | IBM Quantum Computing Blog QOBLIB: tracking progress in quantum optimization | IBM Quantum Computing Blog DocLang: a markup language for LLMs From vision to reality: a unified AI solver for the grid The search for quantum advantage in differential equations Ponder This Challenge - August 2026 - The Wheel of Buttons Quantum advantage through trusted quantum computation | IBM Quantum Computing Blog All of AI benchmarking at your fingertips What are spin qubits? | IBM Quantum Computing Blog IBM to acquire HRL Laboratories IBM commits $50M in quantum access for US Genesis Mission It’s time for cryptography to get its own abstraction layer It’s time for cryptography to get its own abstraction layer This could be the largest synthetic code dataset yet How to measure the performance of a quantum computer | IBM Quantum Computing Blog Release News: Qiskit v2.5 is here! | IBM Quantum Computing Blog CoFrGeNets replace the ‘bones’ of transformer-based models How training environments can teach AI models to misbehave What’s new at IBM Quantum - Q2 2026 | IBM Quantum Computing Blog Modeling the chemistry of fusion reactor material | IBM Quantum Computing Blog Ponder This Challenge - July 2026 - Return of the Superheroes
Ponder This Challenge - March 2026 - Path game on a hole-...
Gadi Aleksandrowicz · 2026-03-01 · via IBM Research

Given an N×MN\times M board and a starting location (x,y)(x,y) with 1xN1\le x\le N and 1yM1\le y\le M, Alice and Bob play the following game: Alice begins by placing a pawn on square (x,y)(x,y), then Bob moves the pawn to an adjacent square of the four potential neighboring squares (diagonals don't count) and removes the square the pawn left from the board. Alice makes the next move, and they alternate until a player has no possible move and loses the game.

Since this is a game obeying Zermalo's theorem, given N×MN\times M and (x,y)(x,y) either Alice can force a win, or Bob can force a win. Call (x,y)(x,y) an "A" square for the board if Alice can force a win, and "B" if Bob can force a win.

To complicate the game, we can remove some of the squares in the board before the game begins, in the following manner. Fix two prime numbers p,qp,q, and label each square in the board with a number, such that square (i,j)(i,j) is labelled pi+qjp^i+q^j (recall that indexing starts from 1, not 0). Now, pick a prime number ss, and remove from the board all the squares whose label is divisible by ss.

For example, it can be seen that for N=M=3N=M=3, the board is

A B A
B A B
A B A

But if we choose p=19,q=2,s=5p=19, q=2, s=5, as 192+22=36519^2+2^2=365 which is divisible by 5 the board becomes

B B B
B # B
B B B

With # denoting the missign square in the middle.

Given a board size N×MN\times M, two primes p,qp,q and a set SS of prime numbers, for each sSs\in S we can count the number of "A" and "B" squares in the board (we don't count "#"). We can then sum those values over all the possible sSs\in S.

For example, for N=M=3N=M=3 and p=19,q=2p=19, q=2 and S=[2,3,5,7,11]S = [2,3,5,7,11] we have a total of 1616 "A" and 1919 "B".

Your goal: Find the total number of "A" and "B" for N=M=157N=M=157, p=419,q=211p=419, q=211 and SS being the set of all prime numbers lower than 100.

A bonus "*" will be given for finding the total number of "A" and "B" for N=M=1557N=M=1557, p=419,q=211p=419, q=211 and SS being the set of all prime numbers lower than 500.

Solution

  • The numerical solutions are:

    • For n=157n=157:
      • Total A: 259501
      • Total B: 280200
    • For n=1557n=1557:
      • Total A: 109008067
      • Total B: 112989820

    Iterating over all cases is simple. The challange in the riddle is - given a specific board, how to find the "A" and "B" squares in it.

    This is an example of the undirected vertex geometry game, which can be played in general on any finite undirected graph, and there is a relatively simple graph-theoretic criterion: A vertex is an "A" vertex (whoever starts on it can force a win) if there exists a maximum matching of the graph that does not contain that vertex.

    Since the graph in question is bipartite, one can use the Hopcroft-Karp algorithm to find one maximum matching. Once such a matching is found, the Dulmage–Mendelsohn decomposition can be used to identify which vertices are part of every maximum matching of the graph.

Solvers

  • *Lazar Ilic (1/3/2026 12:48 AM IDT)
  • *Alper Halbutogullari (1/3/2026 3:55 AM IDT)
  • *Prashant Wankhede (1/3/2026 4:54 AM IDT)
  • *Paul Lupascu (1/3/2026 9:09 AM IDT)
  • Ahmet Yuksel (1/3/2026 12:21 PM IDT)
  • Abraham AJ Arshad (1/3/2026 2:18 PM IDT)
  • *Jean-françois Hermant (1/3/2026 6:01 PM IDT)
  • *Juergen Koehl (1/3/2026 11:06 PM IDT)
  • *Bertram Felgenhauer (2/3/2026 1:53 AM IDT)
  • *Rahid Zaman (2/3/2026 6:18 AM IDT)
  • *Guangxi Liu (2/3/2026 8:04 AM IDT)
  • *Pitiwat Chimplee (2/3/2026 8:16 AM IDT)
  • Stephen Ebert (2/3/2026 10:13 AM IDT)
  • *Daniel Chong Jyh Tar (2/3/2026 11:47 AM IDT)
  • Alex Fleischer (2/3/2026 5:27 PM IDT)
  • *Jack Saleeby (2/3/2026 7:37 PM IDT)
  • Stéphane Higueret (2/3/2026 9:40 PM IDT)
  • *Jan Ondras (3/3/2026 2:59 AM IDT)
  • *Franciraldo Cavalcante (3/3/2026 4:17 PM IDT)
  • Anshul Agarwal (4/3/2026 1:14 PM IDT)
  • *Michael Vahle (4/3/2026 2:36 PM IDT)
  • *Kang Jin Cho (4/3/2026 7:40 PM IDT)
  • *King Pig (5/3/2026 4:11 AM IDT)
  • *Rethna Pulikkoonattu (5/3/2026 9:14 PM IDT)
  • Gürkan Koray Akpınar (6/3/2026 11:31 AM IDT)
  • *Peter Moser (6/3/2026 5:17 PM IDT)
  • *George Jiri Spitalsky (7/3/2026 10:47 AM IDT)
  • *Shouky Dan & Tamir Ganor (7/3/2026 8:32 PM IDT)
  • *Reda Kebbaj (8/3/2026 11:40 AM IDT)
  • *Chern Arthas (9/3/2026 2:35 AM IDT)
  • *Ankit Aggarwal (9/3/2026 2:15 PM IDT)
  • *Daniel Bitin (10/3/2026 12:41 PM IDT)
  • Christoph Baumgarten (10/3/2026 7:41 PM IDT)
  • *Dieter Beckerle (11/3/2026 1:20 PM IDT)
  • Florian Sikora (11/3/2026 5:27 PM IDT)
  • Divyash (12/3/2026 6:37 AM IDT)
  • Nadir HAMOU (12/3/2026 12:03 PM IDT)
  • Lorenz Reichel (12/3/2026 4:35 PM IDT)
  • *Hubert Puszklewicz (13/3/2026 3:19 PM IDT)
  • Hakan Summakoğlu (14/3/2026 6:32 PM IDT)
  • *Mark Zhu (14/3/2026 11:33 PM IDT)
  • Vladimir Volevich (18/3/2026 2:06 PM IDT)
  • *Sanandan Swaminathan (19/3/2026 2:34 AM IDT)
  • *Nyles Heise (20/3/2026 4:14 AM IDT)
  • *Naftali Peles (22/3/2026 3:21 AM IDT)
  • Shirish Chinchalkar (23/3/2026 12:38 AM IDT)
  • *Jackson La Vallee (27/3/2026 11:09 PM IDT)
  • *Motty Porat (28/3/2026 2:52 AM IDT)
  • *Nickita (28/3/2026 10:59 PM IDT)
  • *Chris Shannon (30/3/2026 2:24 PM IDT)
  • David Greer (31/3/2026 6:24 PM IDT)
  • *David F.H. Dunkley (1/4/2026 4:19 AM IDT)
  • *Armin Krauss (2/4/2026 6:51 PM IDT)
  • Karl D’Souza (5/4/2026 1:47 AM IDT)
  • Evan Semet (5/4/2026 6:50 AM IDT)
  • Li Li (6/4/2026 7:59 AM IDT)
  • *Fakih Karademir (7/4/2026 2:12 AM IDT)
  • Govind Jujare (8/4/2026 1:50 PM IDT)
  • Marco Bellocchi (8/4/2026 2:21 PM IDT)