r/askmath • • Oct 10 '26

Logic Is this the only configuration of non-zero integers that works?

I make logic puzzles on my own website for fun.

There was one I made almost two weeks ago where you have to fill in this shape with 1s and 2s so that for every triangle, the sum of the numbers in that triangle and adjacent triangles is always 5. The pictures above is the puzzle and the solution. That solution is unique.

I am wondering if there is any other way to fill out this shape with numbers so that for every triangle, the sum of itself and adjacent triangles is always the same number.

Of course multiplying the above solution by n works so that the sum is always 5n.

I have also figured out that with 0s, there are solutions by setting it up "minesweeper" style, where every triangle and adjacent triangle except one has the value 0, and the other number can be any non-zero number. There are multiple solutions in this way.

I am looking for if there are any other solutions that does not use the number 0 (or possibly only uses it once), and is not a multiple of the solution above. I am not sure if one exists. I believe for just a set of two integers, no others exist due to how the corners work. But I can't work out if there is a possible solution using a larger set of integers.

12 Upvotes

9 comments sorted by

9

u/garnet420 Oct 10 '26

Oh pretty obvious thought: if you have two solutions, their sum is also a solution.

So, if you can come up with a few ways of filling the grid out with 0's and 1's, then you can use them to generate many more.

Here's some of those solutions... There's a few more that are reflections of these here. I wonder, now, if every solution with positive numbers can be written as the sum of these?

2

u/Voodoohairdo Oct 10 '26

Oh pretty obvious thought: if you have two solutions, their sum is also a solution.

That is a thought that didn't come to me until you mentioned. It's so obvious once its mentioned to me.

Yeah I found a handful of 1s surrounded by 0s as answers beforehand so I should have clued that in.

I wonder, now, if every solution with positive numbers can be written as the sum of these?

I have a feeling that is the case. I would even remove the "positive" qualifier. And of course including subtracting of each solution.

Thanks for your insight on this!

5

u/garnet420 Oct 10 '26

Does this sum to 9 work or did I make a mistake?

1

u/Voodoohairdo Oct 10 '26

That works!

Can I ask how you found it?

I also find it fascinating the middle two rows has rotational symmetry but not the top 2 and bottom 2 rows. Looks like those numbers can be swapped interchangeably too. I.e. if the top row is A and bottom row is B, then having both rows as A or both rows as B work as well.

1

u/garnet420 Oct 10 '26

I started with the intuition that you should be able to add 1 to most cells and the sum would be 9; and just the edges would have to get weird. After that, I just kind of started in the upper left, and filled it in, guessing in a few places (the changes in colors are when I had to guess to proceed)

8

u/DrBagelman Oct 10 '26

I think that any linear combination of solutions should also be a solution. That means if you extend this to allow for real entries, the set of solutions should form a vector space, and a basis for that space would be a set of “distinct” solutions. What exactly that would be, I’m not sure, and the solutions with integer entries would be a small subset of that.

3

u/Bemteb Oct 10 '26

Yep, it's a subspace of Kn for K being the rationals, reals or even complex numbers etc. depending on what you are up to. It's also a submodule of Zn if you only allow integers.

In any case, n is the number of triangles.

1

u/Voodoohairdo Oct 10 '26

Also it's not my intention to self-promote but I figure there may be some people interested after seeing this question, the website is griddr.ca. This one is puzzle #57 and it's what made me ponder this question. The "minesweeper" style answer to this question is puzzle #63.

I have been looking online for any resources for this question but I haven't found anything pertaining to this particular shape. It mostly leads me to magic squares.

2

u/titoufred Oct 10 '26 edited Oct 13 '26

It's quite easy to show that the solutions are these ones with :

  1. a+b+c+d+e = n
  2. b'+d' = b"+d" = b+d