You need to swap the 1 at the end for an 11.
Also, this code for me returns 2672 solutions although I don't believe all are valid due to integer division. Perhaps a python 2 -> python 3 difference? (py2 here)
Also, this code for me returns 2672 solutions although I don't believe all are valid due to integer division. Perhaps a python 2 -> python 3 difference? (py2 here)
However, larger is the difference in how division works.
Python2: 3 / 2 => 1
Python3: 3 / 2 => 1.5
def f(a, b, c, d, e, f, g, h, i):
return a + int((13 * b * i + g * h * c) / (i * c)) + d + 12 * e - f - 11 - 10
If I try it like this, I still have the same number of solutions...
Maybe I'm missing something..EDIT: code formatting...
And with checks to have only divisions without the remainder I get 20 solutions, the first one being (3, 2, 1, 5, 4, 7, 8, 9, 6)?
Edit - Ah yes, 10, sorry.