7
$\begingroup$

You are given an empty square grid. Each cell can be an island with a positive integer $n$ or a bridge connecting islands. The following rules apply:

  • Each island with a number $n$ must have exactly $n$ bridges attached to it
  • Bridges must be either horizontal or vertical with one or more cells in length
  • Bridges cannot intersect, but they can meet at an island
  • All islands must be connected into a single component

For example, here is a valid arrangement for islands with numbers 1 to 4:

enter image description here

Can you find an arrangement for islands with numbers that are the first 12 odd primes: 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41? Bonus: what is the smallest rectangle (by area) that can fit such an arrangement?

$\endgroup$

1 Answer 1

7
$\begingroup$

These islands can be arranged in one line: numbers in brackets are the islands, number between dashes are the number of bridges between islands.

 [3] -3- [5] -2- [7] -5- [11] -6- [13] -7- [17] -10- [23] -13- [37] -24- [41] -17- [29] -12- [31] -19- [19]
 

$\endgroup$
3
  • $\begingroup$ Great work, well done! $\endgroup$ Commented Aug 1, 2023 at 12:09
  • $\begingroup$ @DmitryKamenetsky is this the optimal area? $\endgroup$ Commented Aug 1, 2023 at 12:14
  • 2
    $\begingroup$ @newQOpenWid yes: it is the minimal number of cells: 12 islands + 11 bridges (which are necessary in order that all the islands are connected) $\endgroup$
    – daw
    Commented Aug 1, 2023 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.