8
$\begingroup$

Create a 5x5 grid.

A1 A2 a3 a4 a5

B1 B2 b3 b4 b5

c1 c2 c3 c4 c5

d1 d2 d3 d4 d5

e1 e2 e3 e4 e5

Seed A1, A2, B1 and B2 with numbers that allow the grid to be completed with following criteria:

  • Except in the first to columns, every cell must be the modulo of the 2 cells left to it.
  • Except in the first two rows, every cell must be the modulo of the 2 cells above it.

  • No more than one cell is allowed to be 0.

  • Numbers may repeat in the grid

I.e.

  • c3 = a3%b3 = c1%c2
  • e5 = e3%e4 = c5%d5
  • ...

The solution with the lowest sum of initial numbers wins.

Bonus Question:

Can you choose 4 different numbers to start with? (That adds a hell of complexity :)

$\endgroup$
3
  • $\begingroup$ b5 = b3 % b4, but how does it work vertically for b5? $\endgroup$
    – Marius
    Oct 20, 2016 at 9:43
  • $\begingroup$ Thanks for the feedback. Updated description for better clarity. $\endgroup$ Oct 20, 2016 at 9:47
  • $\begingroup$ Is there an implicit requirement that the numbers are non-negative? I guess it depends on how you define modulo with negative numbers, but bc at least tells me -5 % -8 is -5 (and not say 3) $\endgroup$
    – Foon
    Oct 20, 2016 at 21:08

4 Answers 4

6
$\begingroup$

Based on Jamal Senjaya answer: Sum is 34

 [ 5  8  5  3  2]
 [ 8 13  8  5  3]
 [ 5  8  5  3  2]
 [ 3  5  3  2  1]
 [ 2  3  2  1  0]

You can create other solutions by using other Fibonacci numbers as start. For example:

 [ 8 13  8  5  3]
 [13 21 13  8  5]
 [ 8 13  8  5  3]
 [ 5  8  5  3  2]
 [ 3  5  3  2  1]

$\endgroup$
1
  • $\begingroup$ I honestly can't think of a better solution, so this might be the winner. Could you apply that approach to the bonus question, so we have everything in one place? $\endgroup$ Oct 20, 2016 at 11:53
3
$\begingroup$

For the standard question we can

just start with 0 in the bottom right, with 1 above and to it's left and add - this forms diagonals of Fibonacci numbers:

   34   21   13    8    5

21 13 8 5 3
13 8 5 3 2
8 5 3 2 1
5 3 2 1 0

This should be minimal sum, for $192$


For the bonus we can

change one of the bottom or right 2s to a 3 and sum again, here is changing the bottom one:

   50   29   21    8    5

31 18 13 5 3
19 11 8 3 2
12 7 5 2 1
7 4 3 1 0

As pointed out by @wl another way to construct the bonus (and almost certainly with minimal score) is to

shift the left-most column, or top most row, of the first solution up the Fibonacci scale by one place:

   55   21   13    8    5

34 13 8 5 3
21 8 5 3 2
13 5 3 2 1
8 3 2 1 0

For $242$ instead of the previous $268$

$\endgroup$
2
  • $\begingroup$ For the bonus question just replace each number in the first column or row with the next highest Fibonacci number: 55, 34, 21, 13, 8 $\endgroup$
    – w l
    Oct 20, 2016 at 10:03
  • $\begingroup$ @wl Ah yes that will make minimum bonus I think - I just did it another way (but for more cost) $\endgroup$ Oct 20, 2016 at 10:08
3
$\begingroup$

Sum is 55

 [8  13  8  5  3]
 [13 21  13 8  5]
 [8  13  8  5  3]
 [5   8  5  3  2]
 [3   5  3  2  1]

$\endgroup$
0
2
$\begingroup$

One solution but it may not be optimal:

 34 21 13  8  5
21 13 8 5 3
13 8 5 3 2
8 5 3 2 1
5 3 2 1 0

.

Started with 0 and 1 in the bottom right corner and moved my way up. (notice the symmetry).

$\endgroup$

Your Answer

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

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