Logic Masters Deutschland e.V.

Sum Of Two Squares

(Published on 17. March 2026, 11:17 by Cassinii)

A dynamic fog Sudoku exploring Fermat's theorem on the sum of two squares


THEOREM

Fermat's "Sum of Two Squares" theorem states that any odd prime number, p, can be written as the sum of the squares of two integers, A and B:

p = A² + B²

if and only if p ≡ 1 (mod 4).

This means that when divided by 4, p has a remainder of 1 (for example, if p = 13, then 13 ÷ 4 = 3 with remainder 1).

RULES

Normal Sudoku rules apply.

DYNAMIC FOG

  • The grid is covered in fog. Placing a correct digit will clear the fog in that cell, and may clear fog elsewhere.
  • No guessing is required.

SQUARES AND RECTANGLES

  • A blue square/rectangle contains an odd prime number that obeys Fermat's "Sum of Two Squares" theorem.
  • No two squares or rectangles can contain the same number.
  • Note: numbers in rectangles are read from left to right or top to bottom.

CIRCLES

  • Every square/rectangle has two circles adjacent to it (orthogonally or diagonally), connected by blue lines.
  • Circles can be connected to more than one square/rectangle.
  • These circles contain the values A and B, whose squared values sum to the prime number in their attached square/rectangle.
  • A and B are both single digit numbers.

KROPKI DOTS

  • Digits either side of a white dot are consecutive.
  • Digits either side of a black dot are in a 1:2 ratio (one is double the other).
Play the Puzzle here:

Have Fun Solving!

Solution code: Column 1, top to bottom.

Last changed on on 17. March 2026, 20:38

Solved by pep9, StefanSch, Rab3aron, L00ping007, GorgeousNicko, PjoeterBliep, Prepared Jester, kublai, SKORP17, illegel, Joyofrandomness, Felis_Timon, jkuo7, Firebird, CrippledLamp, schnitzl, dzamie, kangaroo, MaxSmartable, MattJones, dseverus, Galc127, Julianl, mbumbee, Neonesque, RadchenkoAleksandr, Jastucreudo
Full list

Comments

on 10. April 2026, 21:17 by Neonesque
I love a good mathematical theorem.

on 25. March 2026, 22:39 by MattJones
Coo idea, some nice logic in there. Good fun!

on 19. March 2026, 21:36 by dzamie
That was a lot of fun! I admittedly kept worrying that I might run into a 3-digit number at some point, and only after the puzzle was over did I check to see that that would've been impossible (only 117 is reachable with single-digit squares, and 1 can't be orthogonally next to itself).

I would recommend, as a personal preference, that you not reveal the entire rest of the board in one go. Going from a lot of grey fog cells to instantly all white cells kinda flashbanged me for a moment.

on 17. March 2026, 20:38 by Cassinii
Fingers crossed

on 17. March 2026, 20:34 by Cassinii
Trying to centre the "p = A^2 + B^2" text

on 17. March 2026, 19:56 by Cassinii
Hopefully last one

on 17. March 2026, 19:52 by Cassinii
More HTML testing, sorry about the comment spam :(

on 17. March 2026, 19:47 by Cassinii
Trying to move the link!

on 17. March 2026, 19:38 by Cassinii
Testing stuff :)

on 17. March 2026, 16:05 by Prepared Jester
Very nice puzzle! I did have to grab pen and paper for a little help lol

on 17. March 2026, 14:13 by Rab3aron
Very beautiful puzzle!

on 17. March 2026, 11:38 by Cassinii
Please ignore these, I'm not changing anything!

on 17. March 2026, 11:36 by Cassinii
small changes

on 17. March 2026, 11:29 by Cassinii
text change

on 17. March 2026, 11:27 by Cassinii
Added link

Difficulty:3
Rating:86 %
Solved:27 times
Observed:1 times
ID:000RXG

Puzzle combination Puzzle variant Online solving tool

Enter solution

Solution code:

Login