Skip to main content
added 1952 characters in body
Source Link
Roman
  • 49.9k
  • 2
  • 57
  • 131
Solve[Join[{Equal @@ f /@ {1, 2, 3, 4, 7, 9},
            m != 0,
            a >= 0, c >= 0, b <= d},
            Thread[-100 <= {a, b, c, d, n} <= 100]],
           {a, b, c, d, m, n}, Integers]

(*    {{a -> 9, b -> -51, c -> 4, bd -> -10, cm -> -2, n -> 19}}    *)

I've added the condition $b\le d$ to eliminate some duplicate solutions, i.e., solutions that differ only by interchanging $(a,b)$ with $(c,d)$. Further, I've added the conditions $a\ge0$ and $c\ge0$ to eliminate duplicate solutions that differ only in the sign of $(a,b)\leftrightarrow(-a,-b)$ or that of $(c,d)\leftrightarrow(-c,-d)$.

Further enlarging the search space gives more solutions:

Solve[Join[{Equal @@ f /@ {1, 2, 3, 4, 7, 9},
            m != 0,
            a >= 0, c >= 0, b <= d},
           Thread[-1000 <= {a, b, c, d, n} <= 1000]],
           {a, b, c, d, m, n}, Integers]

(*    {{a -> 9, b -> -51, c -> 4, d -> -10, m -> -2, n -> 19},
       {a -> 18, b -> -102, c -> 8, d -> -20, m -> -4, n -> 38},
       {a -> 27, b -> -153, c -> 12, d -> -30, m -> -6, n -> 57},
       {a -> 36, b -> -204, c -> 16, d -> -40, m -> -8, n -> 76},
       {a -> 45, b -> -255, c -> 20, d -> -50, m -> -10, n -> 95},
       {a -> 54, b -> -306, c -> 24, d -9> -60, m -> -12, n -> 114},
       {a -> 63, b -> -357, c -> 28, d -> 51-70, m -> -214, n -> 19133},
       {a -> 972, b -> -51408, c -> 32, d -4> -80, m -> -16, n -> 152},
       {a -> 81, b -> -459, c -> 36, d -> 10-90, m -> -218, n -> 19171},
       {a -> 990, b -> -51510, c -> 440, d -> -10100, m -> -220, n -> 19190},
       {a -> 99, b -> -561, c -> 44, d -> -110, m -> -22, n -> 209},
       {a -> 108, b -> -612, c -> 48, d -> -120, m -> -24, n -> 228},
       {a -> 117, b -> -663, c -> 52, d -> -130, m -> -26, n -> 247},
       {a -> 126, b -> -714, c -> 56, d -> -140, m -> -28, n -> 266},
       {a -> 135, b -> -765, c -> 60, d -> -150, m -> -30, n -> 285},
       {a -> 144, b -> -816, c -> 64, d -> -160, m -> -32, n -> 304},
       {a -> 153, b -> -867, c -> 68, d -> -170, m -> -34, n -> 323},
       {a -> 162, b -> -918, c -> 72, d -> -180, m -> -36, n -> 342},
       {a -> 171, b -> -969, c -> 76, d -> -190, m -> -38, n -> 361}}    *)

I've addedwhich are all just integer multiples of the condition $b\le d$ to eliminate duplicate solutions, i.e., solutions that differ only by interchanging $(a,b)$ with $(c,d)$first solution.

Solve[Join[{Equal @@ f /@ {1, 2, 3, 4, 7, 9}, m != 0, b <= d},
            Thread[-100 <= {a, b, c, d, n} <= 100]],
      {a, b, c, d, m, n}, Integers]

(*    {{a -> -4, b -> 10, c -> -9, d -> 51, m -> -2, n -> 19},
       {a -> 4, b -> -10, c -> -9, d -> 51, m -> -2, n -> 19},
       {a -> 9, b -> -51, c -> -4, d -> 10, m -> -2, n -> 19},
       {a -> 9, b -> -51, c -> 4, d -> -10, m -> -2, n -> 19}}    *)

I've added the condition $b\le d$ to eliminate duplicate solutions, i.e., solutions that differ only by interchanging $(a,b)$ with $(c,d)$.

Solve[Join[{Equal @@ f /@ {1, 2, 3, 4, 7, 9},
            m != 0,
            a >= 0, c >= 0, b <= d},
           Thread[-100 <= {a, b, c, d, n} <= 100]],
           {a, b, c, d, m, n}, Integers]

(*    {{a -> 9, b -> -51, c -> 4, d -> -10, m -> -2, n -> 19}}    *)

I've added the condition $b\le d$ to eliminate some duplicate solutions, i.e., solutions that differ only by interchanging $(a,b)$ with $(c,d)$. Further, I've added the conditions $a\ge0$ and $c\ge0$ to eliminate duplicate solutions that differ only in the sign of $(a,b)\leftrightarrow(-a,-b)$ or that of $(c,d)\leftrightarrow(-c,-d)$.

Further enlarging the search space gives more solutions:

Solve[Join[{Equal @@ f /@ {1, 2, 3, 4, 7, 9},
            m != 0,
            a >= 0, c >= 0, b <= d},
           Thread[-1000 <= {a, b, c, d, n} <= 1000]],
           {a, b, c, d, m, n}, Integers]

(*    {{a -> 9, b -> -51, c -> 4, d -> -10, m -> -2, n -> 19},
       {a -> 18, b -> -102, c -> 8, d -> -20, m -> -4, n -> 38},
       {a -> 27, b -> -153, c -> 12, d -> -30, m -> -6, n -> 57},
       {a -> 36, b -> -204, c -> 16, d -> -40, m -> -8, n -> 76},
       {a -> 45, b -> -255, c -> 20, d -> -50, m -> -10, n -> 95},
       {a -> 54, b -> -306, c -> 24, d -> -60, m -> -12, n -> 114},
       {a -> 63, b -> -357, c -> 28, d -> -70, m -> -14, n -> 133},
       {a -> 72, b -> -408, c -> 32, d -> -80, m -> -16, n -> 152},
       {a -> 81, b -> -459, c -> 36, d -> -90, m -> -18, n -> 171},
       {a -> 90, b -> -510, c -> 40, d -> -100, m -> -20, n -> 190},
       {a -> 99, b -> -561, c -> 44, d -> -110, m -> -22, n -> 209},
       {a -> 108, b -> -612, c -> 48, d -> -120, m -> -24, n -> 228},
       {a -> 117, b -> -663, c -> 52, d -> -130, m -> -26, n -> 247},
       {a -> 126, b -> -714, c -> 56, d -> -140, m -> -28, n -> 266},
       {a -> 135, b -> -765, c -> 60, d -> -150, m -> -30, n -> 285},
       {a -> 144, b -> -816, c -> 64, d -> -160, m -> -32, n -> 304},
       {a -> 153, b -> -867, c -> 68, d -> -170, m -> -34, n -> 323},
       {a -> 162, b -> -918, c -> 72, d -> -180, m -> -36, n -> 342},
       {a -> 171, b -> -969, c -> 76, d -> -190, m -> -38, n -> 361}}    *)

which are all just integer multiples of the first solution.

deleted 124 characters in body
Source Link
Roman
  • 49.9k
  • 2
  • 57
  • 131

Just use Solve instead of Reduce. We can eliminate $p$ by setting

f[x_] = Abs[a x + b] + Abs[c x + d] + m x^2 + n x;

and looking for $f(1)=f(2)=f(3)=f(4)=f(7)=f(9)$$f(1)=f(2)=f(3)=f(4)=f(7)=f(9)=-p$ (which is necessarily integer when all parameters are integers). As suggested by @Akku14, enlarging the search space yields solutions for $m\neq 0$:

Solve[Join[{Equal @@ f /@ {1, 2, 3, 4, 7, 9}, m != 0, b <= d},
            Thread[-100 <= {a, b, c, d, n} <= 100]],
            {a, b, c, d, m, n}, Integers]

(*    {{a -> -9, b -> 51, c -> -4, d -> 10, m -> -2, n -> 19},
       {a -> -9, b -> 51, c -> 4, d -> -10, m -> -2, n -> 19},
       {a -> -4, b -> 10, c -> -9, d -> 51, m -> -2, n -> 19},
       {a -> -4, b -> 10, c -> 9, d -> -51, m -> -2, n -> 19},
       {a -> 4, b -> -10, c -> -9, d -> 51, m -> -2, n -> 19},
       {a -> 4, b -> -10, c -> 9, d -> -51, m -> -2, n -> 19},
       {a -> 9, b -> -51, c -> -4, d -> 10, m -> -2, n -> 19},
       {a -> 9, b -> -51, c -> 4, d -> -10, m -> -2, n -> 19}}    *)

I've added the condition $b\le d$ to eliminate duplicate solutions, i.e., solutions that differ only by interchanging $(a,b)$ with $(c,d)$.

Just use Solve instead of Reduce. We can eliminate $p$ by setting

f[x_] = Abs[a x + b] + Abs[c x + d] + m x^2 + n x;

and looking for $f(1)=f(2)=f(3)=f(4)=f(7)=f(9)$ (which is necessarily integer when all parameters are integers). As suggested by @Akku14, enlarging the search space yields solutions for $m\neq 0$:

Solve[Join[{Equal @@ f /@ {1, 2, 3, 4, 7, 9}, m != 0},
            Thread[-100 <= {a, b, c, d, n} <= 100]],
            {a, b, c, d, m, n}, Integers]

(*    {{a -> -9, b -> 51, c -> -4, d -> 10, m -> -2, n -> 19},
       {a -> -9, b -> 51, c -> 4, d -> -10, m -> -2, n -> 19},
       {a -> -4, b -> 10, c -> -9, d -> 51, m -> -2, n -> 19},
       {a -> -4, b -> 10, c -> 9, d -> -51, m -> -2, n -> 19},
       {a -> 4, b -> -10, c -> -9, d -> 51, m -> -2, n -> 19},
       {a -> 4, b -> -10, c -> 9, d -> -51, m -> -2, n -> 19},
       {a -> 9, b -> -51, c -> -4, d -> 10, m -> -2, n -> 19},
       {a -> 9, b -> -51, c -> 4, d -> -10, m -> -2, n -> 19}}    *)

Just use Solve instead of Reduce. We can eliminate $p$ by setting

f[x_] = Abs[a x + b] + Abs[c x + d] + m x^2 + n x;

and looking for $f(1)=f(2)=f(3)=f(4)=f(7)=f(9)=-p$ (which is necessarily integer when all parameters are integers). As suggested by @Akku14, enlarging the search space yields solutions for $m\neq 0$:

Solve[Join[{Equal @@ f /@ {1, 2, 3, 4, 7, 9}, m != 0, b <= d},
            Thread[-100 <= {a, b, c, d, n} <= 100]],
      {a, b, c, d, m, n}, Integers]

(*    {{a -> -4, b -> 10, c -> -9, d -> 51, m -> -2, n -> 19},
       {a -> 4, b -> -10, c -> -9, d -> 51, m -> -2, n -> 19},
       {a -> 9, b -> -51, c -> -4, d -> 10, m -> -2, n -> 19},
       {a -> 9, b -> -51, c -> 4, d -> -10, m -> -2, n -> 19}}    *)

I've added the condition $b\le d$ to eliminate duplicate solutions, i.e., solutions that differ only by interchanging $(a,b)$ with $(c,d)$.

deleted 25786 characters in body
Source Link
Roman
  • 49.9k
  • 2
  • 57
  • 131

Just use Solve instead of Reduce. We can eliminate $p$ by setting

f[x_] = Abs[a x + b] + Abs[c x + d] + m x^2 + n x;

and looking for $f(1)=f(2)=f(3)=f(4)=f(7)=f(9)$ (which is necessarily integer when all parameters are integers). As suggested by @Akku14, enlarging the search space yields solutions for $m\neq 0$:

f[x_] = Abs[a x + b] + Abs[c x + d] + m x^2 +Solve[Join[{Equal n@@ xf +/@ p;

Solve[{f[1] == 01, f[2] == 02, f[3] == 03, f[4] == 04, f[7] ==7, 09}, f[9]m ==!= 0},
       -2 <= a <= -1, Thread[-2 <= b100 <= 3{a, -3 <=b, c <= 3, -3 <= d <= 10,
       -1 <= m <= 1, -3 <= n} <= 8100]], 
 -20 <= p <= 1},
       {a, b, c, d, m, n, p}, Integers]

(*    {{a -> -2, b -> -2, c -> -1, d -> -3, m -> 0, n -> -3, p -> -5},
       {a -> -2, b -> -2, c -> -1, d -> -2, m -> 0, n -> -3, p -> -4},
       {a -> -2, b -> -2, c -> -1, d -> -1, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> -2, c -> -1, d -> 0, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> -2, c -> -1, d -> 1, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> -2, c -> -1, d -> 9, m -> 0, n -> -1, p -> -11},
       {a -> -2, b -> -2, c -> -1, d -> 10, m -> 0, n -> -1, p -> -12},
       {a -> -2, b -> -2, c -> 0, d -> -3, m -> 0, n -> -2, p -> -5},
       {a -> -2, b -> -2, c -> 0, d -> -2, m -> 0, n -> -2, p -> -4},
       {a -> -2, b -> -2, c -> 0, d -> -1, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> -2, c -> 0, d -> 0, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> -2, c -> 0, d -> 1, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> -2, c -> 0, d -> 2, m -> 0, n -> -2, p -> -4},
       {a -> -2, b -> -2, c -> 0, d -> 3, m -> 0, n -> -2, p -> -5},
       {a -> -2, b -> -2, c -> 0, d -> 4, m -> 0, n -> -2, p -> -6},
       {a -> -2, b -> -2, c -> 0, d -> 5, m -> 0, n -> -2, p -> -7},
       {a -> -2, b -> -2, c -> 0, d -> 6, m -> 0, n -> -2, p -> -8},
       {a -> -2, b -> -2, c -> 0, d -> 7, m -> 0, n -> -2, p -> -9},
       {a -> -2, b -> -2, c -> 0, d -> 8, m -> 0, n -> -2, p -> -10},
       {a -> -2, b -> -2, c -> 0, d -> 9, m -> 0, n -> -2, p -> -11},
       {a -> -2, b -> -2, c -> 0, d -> 10, m -> 0, n -> -2, p -> -12},
       {a -> -2, b -> -2, c -> 1, d -> -1, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> -2, c -> 1, d -> 0, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> -2, c -> 1, d -> 1, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> -2, c -> 1, d -> 2, m -> 0, n -> -3, p -> -4},
       {a -> -2, b -> -2, c -> 1, d -> 3, m -> 0, n -> -3, p -> -5},
       {a -> -2, b -> -2, c -> 1, d -> 4, m -> 0, n -> -3, p -> -6},
       {a -> -2, b -> -2, c -> 1, d -> 5, m -> 0, n -> -3, p -> -7},
       {a -> -2, b -> -2, c -> 1, d -> 6, m -> 0, n -> -3, p -> -8},
       {a -> -2, b -> -2, c -> 1, d -> 7, m -> 0, n -> -3, p -> -9},
       {a -> -2, b -> -2, c -> 1, d -> 8, m -> 0, n -> -3, p -> -10},
       {a -> -2, b -> -2, c -> 1, d -> 9, m -> 0, n -> -3, p -> -11},
       {a -> -2, b -> -2, c -> 1, d -> 10, m -> 0, n -> -3, p -> -12},
       {a -> -2, b -> -1, c -> -1, d -> -3, m -> 0, n -> -3, p -> -4},
       {a -> -2, b -> -1, c -> -1, d -> -2, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> -1, c -> -1, d -> -1, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> -1, c -> -1, d -> 0, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> -1, c -> -1, d -> 1, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> -1, c -> -1, d -> 9, m -> 0, n -> -1, p -> -10},
       {a -> -2, b -> -1, c -> -1, d -> 10, m -> 0, n -> -1, p -> -11},
       {a -> -2, b -> -1, c -> 0, d -> -3, m -> 0, n -> -2, p -> -4},
       {a -> -2, b -> -1, c -> 0, d -> -2, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> -1, c -> 0, d -> -1, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> -1, c -> 0, d -> 0, m -> 0, n -> -2, p -> -1},
       {a -> -2, b -> -1, c -> 0, d -> 1, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> -1, c -> 0, d -> 2, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> -1, c -> 0, d -> 3, m -> 0, n -> -2, p -> -4},
       {a -> -2, b -> -1, c -> 0, d -> 4, m -> 0, n -> -2, p -> -5},
       {a -> -2, b -> -1, c -> 0, d -> 5, m -> 0, n -> -2, p -> -6},
       {a -> -2, b -> -1, c -> 0, d -> 6, m -> 0, n -> -2, p -> -7},
       {a -> -2, b -> -1, c -> 0, d -> 7, m -> 0, n -> -2, p -> -8},
       {a -> -2, b -> -1, c -> 0, d -> 8, m -> 0, n -> -2, p -> -9},
       {a -> -2, b -> -1, c -> 0, d -> 9, m -> 0, n -> -2, p -> -10},
       {a -> -2, b -> -1, c -> 0, d -> 10, m -> 0, n -> -2, p -> -11},
       {a -> -2, b -> -1, c -> 1, d -> -1, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> -1, c -> 1, d -> 0, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> -1, c -> 1, d -> 1, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> -1, c -> 1, d -> 2, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> -1, c -> 1, d -> 3, m -> 0, n -> -3, p -> -4},
       {a -> -2, b -> -1, c -> 1, d -> 4, m -> 0, n -> -3, p -> -5},
       {a -> -2, b -> -1, c -> 1, d -> 5, m -> 0, n -> -3, p -> -6},
       {a -> -2, b -> -1, c -> 1, d -> 6, m -> 0, n -> -3, p -> -7},
       {a -> -2, b -> -1, c -> 1, d -> 7, m -> 0, n -> -3, p -> -8},
       {a -> -2, b -> -1, c -> 1, d -> 8, m -> 0, n -> -3, p -> -9},
       {a -> -2, b -> -1, c -> 1, d -> 9, m -> 0, n -> -3, p -> -10},
       {a -> -2, b -> -1, c -> 1, d -> 10, m -> 0, n -> -3, p -> -11},
       {a -> -2, b -> 0, c -> -1, d -> -3, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> 0, c -> -1, d -> -2, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> 0, c -> -1, d -> -1, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> 0, c -> -1, d -> 0, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> 0, c -> -1, d -> 1, m -> 0, n -> -3, p -> 1},
       {a -> -2, b -> 0, c -> -1, d -> 9, m -> 0, n -> -1, p -> -9},
       {a -> -2, b -> 0, c -> -1, d -> 10, m -> 0, n -> -1, p -> -10},
       {a -> -2, b -> 0, c -> 0, d -> -3, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> 0, c -> 0, d -> -2, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> 0, c -> 0, d -> -1, m -> 0, n -> -2, p -> -1},
       {a -> -2, b -> 0, c -> 0, d -> 0, m -> 0, n -> -2, p -> 0},
       {a -> -2, b -> 0, c -> 0, d -> 1, m -> 0, n -> -2, p -> -1},
       {a -> -2, b -> 0, c -> 0, d -> 2, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> 0, c -> 0, d -> 3, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> 0, c -> 0, d -> 4, m -> 0, n -> -2, p -> -4},
       {a -> -2, b -> 0, c -> 0, d -> 5, m -> 0, n -> -2, p -> -5},
       {a -> -2, b -> 0, c -> 0, d -> 6, m -> 0, n -> -2, p -> -6},
       {a -> -2, b -> 0, c -> 0, d -> 7, m -> 0, n -> -2, p -> -7},
       {a -> -2, b -> 0, c -> 0, d -> 8, m -> 0, n -> -2, p -> -8},
       {a -> -2, b -> 0, c -> 0, d -> 9, m -> 0, n -> -2, p -> -9},
       {a -> -2, b -> 0, c -> 0, d -> 10, m -> 0, n -> -2, p -> -10},
       {a -> -2, b -> 0, c -> 1, d -> -1, m -> 0, n -> -3, p -> 1},
       {a -> -2, b -> 0, c -> 1, d -> 0, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> 0, c -> 1, d -> 1, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> 0, c -> 1, d -> 2, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> 0, c -> 1, d -> 3, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> 0, c -> 1, d -> 4, m -> 0, n -> -3, p -> -4},
       {a -> -2, b -> 0, c -> 1, d -> 5, m -> 0, n -> -3, p -> -5},
       {a -> -2, b -> 0, c -> 1, d -> 6, m -> 0, n -> -3, p -> -6},
       {a -> -2, b -> 0, c -> 1, d -> 7, m -> 0, n -> -3, p -> -7},
       {a -> -2, b -> 0, c -> 1, d -> 8, m -> 0, n -> -3, p -> -8},
       {a -> -2, b -> 0, c -> 1, d -> 9, m -> 0, n -> -3, p -> -9},
       {a -> -2, b -> 0, c -> 1, d -> 10, m -> 0, n -> -3, p -> -10},
       {a -> -2, b -> 1, c -> -1, d -> -3, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> 1, c -> -1, d -> -2, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> 1, c -> -1, d -> -1, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> 1, c -> -1, d -> 0, m -> 0, n -> -3, p -> 1},
       {a -> -2, b -> 1, c -> -1, d -> 9, m -> 0, n -> -1, p -> -8},
       {a -> -2, b -> 1, c -> -1, d -> 10, m -> 0, n -> -1, p -> -9},
       {a -> -2, b -> 1, c -> 0, d -> -3, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> 1, c -> 0, d -> -2, m -> 0, n -> -2, p -> -1},
       {a -> -2, b -> 1, c -> 0, d -> -1, m -> 0, n -> -2, p -> 0},
       {a -> -2, b -> 1, c -> 0, d -> 0, m -> 0, n -> -2, p -> 1},
       {a -> -2, b -> 1, c -> 0, d -> 1, m -> 0, n -> -2, p -> 0},
       {a -> -2, b -> 1, c -> 0, d -> 2, m -> 0, n -> -2, p -> -1},
       {a -> -2, b -> 1, c -> 0, d -> 3, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> 1, c -> 0, d -> 4, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> 1, c -> 0, d -> 5, m -> 0, n -> -2, p -> -4},
       {a -> -2, b -> 1, c -> 0, d -> 6, m -> 0, n -> -2, p -> -5},
       {a -> -2, b -> 1, c -> 0, d -> 7, m -> 0, n -> -2, p -> -6},
       {a -> -2, b -> 1, c -> 0, d -> 8, m -> 0, n -> -2, p -> -7},
       {a -> -2, b -> 1, c -> 0, d -> 9, m -> 0, n -> -2, p -> -8},
       {a -> -2, b -> 1, c -> 0, d -> 10, m -> 0, n -> -2, p -> -9},
       {a -> -2, b -> 1, c -> 1, d -> 0, m -> 0, n -> -3, p -> 1},
       {a -> -2, b -> 1, c -> 1, d -> 1, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> 1, c -> 1, d -> 2, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> 1, c -> 1, d -> 3, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> 1, c -> 1, d -> 4, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> 1, c -> 1, d -> 5, m -> 0, n -> -3, p -> -4},
       {a -> -2, b -> 1, c -> 1, d -> 6, m -> 0, n -> -3, p -> -5},
       {a -> -2, b -> 1, c -> 1, d -> 7, m -> 0, n -> -3, p -> -6},
       {a -> -2, b -> 1, c -> 1, d -> 8, m -> 0, n -> -3, p -> -7},
       {a -> -2, b -> 1, c -> 1, d -> 9, m -> 0, n -> -3, p -> -8},
       {a -> -2, b -> 1, c -> 1, d -> 10, m -> 0, n -> -3, p -> -9},
       {a -> -2, b -> 2, c -> -1, d -> -3, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> 2, c -> -1, d -> -2, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> 2, c -> -1, d -> -1, m -> 0, n -> -3, p -> 1},
       {a -> -2, b -> 2, c -> -1, d -> 9, m -> 0, n -> -1, p -> -7},
       {a -> -2, b -> 2, c -> -1, d -> 10, m -> 0, n -> -1, p -> -8},
       {a -> -2, b -> 2, c -> 0, d -> -3, m -> 0, n -> -2, p -> -1},
       {a -> -2, b -> 2, c -> 0, d -> -2, m -> 0, n -> -2, p -> 0},
       {a -> -2, b -> 2, c -> 0, d -> -1, m -> 0, n -> -2, p -> 1},
       {a -> -2, b -> 2, c -> 0, d -> 1, m -> 0, n -> -2, p -> 1},
       {a -> -2, b -> 2, c -> 0, d -> 2, m -> 0, n -> -2, p -> 0},
       {a -> -2, b -> 2, c -> 0, d -> 3, m -> 0, n -> -2, p -> -1},
       {a -> -2, b -> 2, c -> 0, d -> 4, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> 2, c -> 0, d -> 5, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> 2, c -> 0, d -> 6, m -> 0, n -> -2, p -> -4},
       {a -> -2, b -> 2, c -> 0, d -> 7, m -> 0, n -> -2, p -> -5},
       {a -> -2, b -> 2, c -> 0, d -> 8, m -> 0, n -> -2, p -> -6},
       {a -> -2, b -> 2, c -> 0, d -> 9, m -> 0, n -> -2, p -> -7},
       {a -> -2, b -> 2, c -> 0, d -> 10, m -> 0, n -> -2, p -> -8},
       {a -> -2, b -> 2, c -> 1, d -> 1, m -> 0, n -> -3, p -> 1},
       {a -> -2, b -> 2, c -> 1, d -> 2, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> 2, c -> 1, d -> 3, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> 2, c -> 1, d -> 4, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> 2, c -> 1, d -> 5, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> 2, c -> 1, d -> 6, m -> 0, n -> -3, p -> -4},
       {a -> -2, b -> 2, c -> 1, d -> 7, m -> 0, n -> -3, p -> -5},
       {a -> -2, b -> 2, c -> 1, d -> 8, m -> 0, n -> -3, p -> -6},
       {a -> -2, b -> 2, c -> 1, d -> 9, m -> 0, n -> -3, p -> -7},
       {a -> -2, b -> 2, c -> 1, d -> 10, m -> 0, n -> -3, p -> -8},
       {a -> -1, b -> -2, c -> -2, d -> -3, m -> 0, n -> -3, p -> -5},
       {a -> -1, b -> -2, c -> -2, d -> -2, m -> 0, n -> -3, p -> -4},
       {a -> -1, b -> -2, c -> -2, d -> -1, m -> 0, n -> -3, p -> -3},
       {a -> -1, b -> -2, c -> -2, d -> 0, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> -2, c -> -2, d -> 1, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> -2, c -> -2, d -> 2, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> -2, c -> -1, d -> -3, m -> 0, n -> -2, p -> -5},
       {a -> -1, b -> -2, c -> -1, d -> -2, m -> 0, n -> -2, p -> -4},
       {a -> -1, b -> -2, c -> -1, d -> -1, m -> 0, n -> -2, p -> -3},
       {a -> -1, b -> -2, c -> -1, d -> 0, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> -2, c -> -1, d -> 1, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> -2, c -> -1, d -> 9, m -> 0, n -> 0, p -> -11},
       {a -> -1, b -> -2, c -> -1, d -> 10, m -> 0, n -> 0, p -> -12},
       {a -> -1, b -> -2, c -> 0, d -> -3, m -> 0, n -> -1, p -> -5},
       {a -> -1, b -> -2, c -> 0, d -> -2, m -> 0, n -> -1, p -> -4},
       {a -> -1, b -> -2, c -> 0, d -> -1, m -> 0, n -> -1, p -> -3},
       {a -> -1, b -> -2, c -> 0, d -> 0, m -> 0, n -> -1, p -> -2},
       {a -> -1, b -> -2, c -> 0, d -> 1, m -> 0, n -> -1, p -> -3},
       {a -> -1, b -> -2, c -> 0, d -> 2, m -> 0, n -> -1, p -> -4},
       {a -> -1, b -> -2, c -> 0, d -> 3, m -> 0, n -> -1, p -> -5},
       {a -> -1, b -> -2, c -> 0, d -> 4, m -> 0, n -> -1, p -> -6},
       {a -> -1, b -> -2, c -> 0, d -> 5, m -> 0, n -> -1, p -> -7},
       {a -> -1, b -> -2, c -> 0, d -> 6, m -> 0, n -> -1, p -> -8},
       {a -> -1, b -> -2, c -> 0, d -> 7, m -> 0, n -> -1, p -> -9},
       {a -> -1, b -> -2, c -> 0, d -> 8, m -> 0, n -> -1, p -> -10},
       {a -> -1, b -> -2, c -> 0, d -> 9, m -> 0, n -> -1, p -> -11},
       {a -> -1, b -> -2, c -> 0, d -> 10, m -> 0, n -> -1, p -> -12},
       {a -> -1, b -> -2, c -> 1, d -> -1, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> -2, c -> 1, d -> 0, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> -2, c -> 1, d -> 1, m -> 0, n -> -2, p -> -3},
       {a -> -1, b -> -2, c -> 1, d -> 2, m -> 0, n -> -2, p -> -4},
       {a -> -1, b -> -2, c -> 1, d -> 3, m -> 0, n -> -2, p -> -5},
       {a -> -1, b -> -2, c -> 1, d -> 4, m -> 0, n -> -2, p -> -6},
       {a -> -1, b -> -2, c -> 1, d -> 5, m -> 0, n -> -2, p -> -7},
       {a -> -1, b -> -2, c -> 1, d -> 6, m -> 0, n -> -2, p -> -8},
       {a -> -1, b -> -2, c -> 1, d -> 7, m -> 0, n -> -2, p -> -9},
       {a -> -1, b -> -2, c -> 1, d -> 8, m -> 0, n -> -2, p -> -10},
       {a -> -1, b -> -2, c -> 1, d -> 9, m -> 0, n -> -2, p -> -11},
       {a -> -1, b -> -2, c -> 1, d -> 10, m -> 0, n -> -2, p -> -12},
       {a -> -1, b -> -2, c -> 2, d -> -2, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> -2, c -> 2, d -> -1, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> -2, c -> 2, d -> 0, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> -2, c -> 2, d -> 1, m -> 0, n -> -3, p -> -3},
       {a -> -1, b -> -2, c -> 2, d -> 2, m -> 0, n -> -3, p -> -4},
       {a -> -1, b -> -2, c -> 2, d -> 3, m -> 0, n -> -3, p -> -5},
       {a -> -1, b -> -2, c -> 2, d -> 4, m -> 0, n -> -3, p -> -6},
       {a -> -1, b -> -2, c -> 2, d -> 5, m -> 0, n -> -3, p -> -7},
       {a -> -1, b -> -2, c -> 2, d -> 6, m -> 0, n -> -3, p -> -8},
       {a -> -1, b -> -2, c -> 2, d -> 7, m -> 0, n -> -3, p -> -9},
       {a -> -1, b -> -2, c -> 2, d -> 8, m -> 0, n -> -3, p -> -10},
       {a -> -1, b -> -2, c -> 2, d -> 9, m -> 0, n -> -3, p -> -11},
       {a -> -1, b -> -2, c -> 2, d -> 10, m -> 0, n -> -3, p -> -12},
       {a -> -1, b -> -1, c -> -2, d -> -3, m -> 0, n -> -3, p -> -4},
       {a -> -1, b -> -1, c -> -2, d -> -2, m -> 0, n -> -3, p -> -3},
       {a -> -1, b -> -1, c -> -2, d -> -1, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> -1, c -> -2, d -> 0, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> -1, c -> -2, d -> 1, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> -1, c -> -2, d -> 2, m -> 0, n -> -3, p -> 1},
       {a -> -1, b -> -1, c -> -1, d -> -3, m -> 0, n -> -2, p -> -4},
       {a -> -1, b -> -1, c -> -1, d -> -2, m -> 0, n -> -2, p -> -3},
       {a -> -1, b -> -1, c -> -1, d -> -1, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> -1, c -> -1, d -> 0, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> -1, c -> -1, d -> 1, m -> 0, n -> -2, p -> 0},
       {a -> -1, b -> -1, c -> -1, d -> 9, m -> 0, n -> 0, p -> -10},
       {a -> -1, b -> -1, c -> -1, d -> 10, m -> 0, n -> 0, p -> -11},
       {a -> -1, b -> -1, c -> 0, d -> -3, m -> 0, n -> -1, p -> -4},
       {a -> -1, b -> -1, c -> 0, d -> -2, m -> 0, n -> -1, p -> -3},
       {a -> -1, b -> -1, c -> 0, d -> -1, m -> 0, n -> -1, p -> -2},
       {a -> -1, b -> -1, c -> 0, d -> 0, m -> 0, n -> -1, p -> -1},
       {a -> -1, b -> -1, c -> 0, d -> 1, m -> 0, n -> -1, p -> -2},
       {a -> -1, b -> -1, c -> 0, d -> 2, m -> 0, n -> -1, p -> -3},
       {a -> -1, b -> -1, c -> 0, d -> 3, m -> 0, n -> -1, p -> -4},
       {a -> -1, b -> -1, c -> 0, d -> 4, m -> 0, n -> -1, p -> -5},
       {a -> -1, b -> -1, c -> 0, d -> 5, m -> 0, n -> -1, p -> -6},
       {a -> -1, b -> -1, c -> 0, d -> 6, m -> 0, n -> -1, p -> -7},
       {a -> -1, b -> -1, c -> 0, d -> 7, m -> 0, n -> -1, p -> -8},
       {a -> -1, b -> -1, c -> 0, d -> 8, m -> 0, n -> -1, p -> -9},
       {a -> -1, b -> -1, c -> 0, d -> 9, m -> 0, n -> -1, p -> -10},
       {a -> -1, b -> -1, c -> 0, d -> 10, m -> 0, n -> -1, p -> -11},
       {a -> -1, b -> -1, c -> 1, d -> -1, m -> 0, n -> -2, p -> 0},
       {a -> -1, b -> -1, c -> 1, d -> 0, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> -1, c -> 1, d -> 1, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> -1, c -> 1, d -> 2, m -> 0, n -> -2, p -> -3},
       {a -> -1, b -> -1, c -> 1, d -> 3, m -> 0, n -> -2, p -> -4},
       {a -> -1, b -> -1, c -> 1, d -> 4, m -> 0, n -> -2, p -> -5},
       {a -> -1, b -> -1, c -> 1, d -> 5, m -> 0, n -> -2, p -> -6},
       {a -> -1, b -> -1, c -> 1, d -> 6, m -> 0, n -> -2, p -> -7},
       {a -> -1, b -> -1, c -> 1, d -> 7, m -> 0, n -> -2, p -> -8},
       {a -> -1, b -> -1, c -> 1, d -> 8, m -> 0, n -> -2, p -> -9},
       {a -> -1, b -> -1, c -> 1, d -> 9, m -> 0, n -> -2, p -> -10},
       {a -> -1, b -> -1, c -> 1, d -> 10, m -> 0, n -> -2, p -> -11},
       {a -> -1, b -> -1, c -> 2, d -> -2, m -> 0, n -> -3, p -> 1},
       {a -> -1, b -> -1, c -> 2, d -> -1, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> -1, c -> 2, d -> 0, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> -1, c -> 2, d -> 1, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> -1, c -> 2, d -> 2, m -> 0, n -> -3, p -> -3},
       {a -> -1, b -> -1, c -> 2, d -> 3, m -> 0, n -> -3, p -> -4},
       {a -> -1, b -> -1, c -> 2, d -> 4, m -> 0, n -> -3, p -> -5},
       {a -> -1, b -> -1, c -> 2, d -> 5, m -> 0, n -> -3, p -> -6},
       {a -> -1, b -> -1, c -> 2, d -> 6, m -> 0, n -> -3, p -> -7},
       {a -> -1, b -> -1, c -> 2, d -> 7, m -> 0, n -> -3, p -> -8},
       {a -> -1, b -> -1, c -> 2, d -> 8, m -> 0, n -> -3, p -> -9},
       {a -> -1, b -> -1, c -> 2, d -> 9, m -> 0, n -> -3, p -> -10},
       {a -> -1, b -> -1, c -> 2, d -> 10, m -> 0, n -> -3, p -> -11},
       {a -> -1, b -> 0, c -> -2, d -> -3, m -> 0, n -> -3, p -> -3},
       {a -> -1, b -> 0, c -> -2, d -> -2, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> 0, c -> -2, d -> -1, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> 0, c -> -2, d -> 0, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> 0, c -> -2, d -> 1, m -> 0, n -> -3, p -> 1},
       {a -> -1, b -> 0, c -> -1, d -> -3, m -> 0, n -> -2, p -> -3},
       {a -> -1, b -> 0, c -> -1, d -> -2, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> 0, c -> -1, d -> -1, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> 0, c -> -1, d -> 0, m -> 0, n -> -2, p -> 0},
       {a -> -1, b -> 0, c -> -1, d -> 1, m -> 0, n -> -2, p -> 1},
       {a -> -1, b -> 0, c -> -1, d -> 9, m -> 0, n -> 0, p -> -9},
       {a -> -1, b -> 0, c -> -1, d -> 10, m -> 0, n -> 0, p -> -10},
       {a -> -1, b -> 0, c -> 0, d -> -3, m -> 0, n -> -1, p -> -3},
       {a -> -1, b -> 0, c -> 0, d -> -2, m -> 0, n -> -1, p -> -2},
       {a -> -1, b -> 0, c -> 0, d -> -1, m -> 0, n -> -1, p -> -1},
       {a -> -1, b -> 0, c -> 0, d -> 0, m -> 0, n -> -1, p -> 0},
       {a -> -1, b -> 0, c -> 0, d -> 1, m -> 0, n -> -1, p -> -1},
       {a -> -1, b -> 0, c -> 0, d -> 2, m -> 0, n -> -1, p -> -2},
       {a -> -1, b -> 0, c -> 0, d -> 3, m -> 0, n -> -1, p -> -3},
       {a -> -1, b -> 0, c -> 0, d -> 4, m -> 0, n -> -1, p -> -4},
       {a -> -1, b -> 0, c -> 0, d -> 5, m -> 0, n -> -1, p -> -5},
       {a -> -1, b -> 0, c -> 0, d -> 6, m -> 0, n -> -1, p -> -6},
       {a -> -1, b -> 0, c -> 0, d -> 7, m -> 0, n -> -1, p -> -7},
       {a -> -1, b -> 0, c -> 0, d -> 8, m -> 0, n -> -1, p -> -8},
       {a -> -1, b -> 0, c -> 0, d -> 9, m -> 0, n -> -1, p -> -9},
       {a -> -1, b -> 0, c -> 0, d -> 10, m -> 0, n -> -1, p -> -10},
       {a -> -1, b -> 0, c -> 1, d -> -1, m -> 0, n -> -2, p -> 1},
       {a -> -1, b -> 0, c -> 1, d -> 0, m -> 0, n -> -2, p -> 0},
       {a -> -1, b -> 0, c -> 1, d -> 1, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> 0, c -> 1, d -> 2, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> 0, c -> 1, d -> 3, m -> 0, n -> -2, p -> -3},
       {a -> -1, b -> 0, c -> 1, d -> 4, m -> 0, n -> -2, p -> -4},
       {a -> -1, b -> 0, c -> 1, d -> 5, m -> 0, n -> -2, p -> -5},
       {a -> -1, b -> 0, c -> 1, d -> 6, m -> 0, n -> -2, p -> -6},
       {a -> -1, b -> 0, c -> 1, d -> 7, m -> 0, n -> -2, p -> -7},
       {a -> -1, b -> 0, c -> 1, d -> 8, m -> 0, n -> -2, p -> -8},
       {a -> -1, b -> 0, c -> 1, d -> 9, m -> 0, n -> -2, p -> -9},
       {a -> -1, b -> 0, c -> 1, d -> 10, m -> 0, n -> -2, p -> -10},
       {a -> -1, b -> 0, c -> 2, d -> -1, m -> 0, n -> -3, p -> 1},
       {a -> -1, b -> 0, c -> 2, d -> 0, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> 0, c -> 2, d -> 1, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> 0, c -> 2, d -> 2, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> 0, c -> 2, d -> 3, m -> 0, n -> -3, p -> -3},
       {a -> -1, b -> 0, c -> 2, d -> 4, m -> 0, n -> -3, p -> -4},
       {a -> -1, b -> 0, c -> 2, d -> 5, m -> 0, n -> -3, p -> -5},
       {a -> -1, b -> 0, c -> 2, d -> 6, m -> 0, n -> -3, p -> -6},
       {a -> -1, b -> 0, c -> 2, d -> 7, m -> 0, n -> -3, p -> -7},
       {a -> -1, b -> 0, c -> 2, d -> 8, m -> 0, n -> -3, p -> -8},
       {a -> -1, b -> 0, c -> 2, d -> 9, m -> 0, n -> -3, p -> -9},
       {a -> -1, b -> 0, c -> 2, d -> 10, m -> 0, n -> -3, p -> -10},
       {a -> -1, b -> 1, c -> -2, d -> -3, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> 1, c -> -2, d -> -2, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> 1, c -> -2, d -> -1, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> 1, c -> -2, d -> 0, m -> 0, n -> -3, p -> 1},
       {a -> -1, b -> 1, c -> -1, d -> -3, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> 1, c -> -1, d -> -2, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> 1, c -> -1, d -> -1, m -> 0, n -> -2, p -> 0},
       {a -> -1, b -> 1, c -> -1, d -> 0, m -> 0, n -> -2, p -> 1},
       {a -> -1, b -> 1, c -> -1, d -> 9, m -> 0, n -> 0, p -> -8},
       {a -> -1, b -> 1, c -> -1, d -> 10, m -> 0, n -> 0, p -> -9},
       {a -> -1, b -> 1, c -> 0, d -> -3, m -> 0, n -> -1, p -> -2},
       {a -> -1, b -> 1, c -> 0, d -> -2, m -> 0, n -> -1, p -> -1},
       {a -> -1, b -> 1, c -> 0, d -> -1, m -> 0, n -> -1, p -> 0},
       {a -> -1, b -> 1, c -> 0, d -> 0, m -> 0, n -> -1, p -> 1},
       {a -> -1, b -> 1, c -> 0, d -> 1, m -> 0, n -> -1, p -> 0},
       {a -> -1, b -> 1, c -> 0, d -> 2, m -> 0, n -> -1, p -> -1},
       {a -> -1, b -> 1, c -> 0, d -> 3, m -> 0, n -> -1, p -> -2},
       {a -> -1, b -> 1, c -> 0, d -> 4, m -> 0, n -> -1, p -> -3},
       {a -> -1, b -> 1, c -> 0, d -> 5, m -> 0, n -> -1, p -> -4},
       {a -> -1, b -> 1, c -> 0, d -> 6, m -> 0, n -> -1, p -> -5},
       {a -> -1, b -> 1, c -> 0, d -> 7, m -> 0, n -> -1, p -> -6},
       {a -> -1, b -> 1, c -> 0, d -> 8, m -> 0, n -> -1, p -> -7},
       {a -> -1, b -> 1, c -> 0, d -> 9, m -> 0, n -> -1, p -> -8},
       {a -> -1, b -> 1, c -> 0, d -> 10, m -> 0, n -> -1, p -> -9},
       {a -> -1, b -> 1, c -> 1, d -> 0, m -> 0, n -> -2, p -> 1},
       {a -> -1, b -> 1, c -> 1, d -> 1, m -> 0, n -> -2, p -> 0},
       {a -> -1, b -> 1, c -> 1, d -> 2, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> 1, c -> 1, d -> 3, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> 1, c -> 1, d -> 4, m -> 0, n -> -2, p -> -3},
       {a -> -1, b -> 1, c -> 1, d -> 5, m -> 0, n -> -2, p -> -4},
       {a -> -1, b -> 1, c -> 1, d -> 6, m -> 0, n -> -2, p -> -5},
       {a -> -1, b -> 1, c -> 1, d -> 7, m -> 0, n -> -2, p -> -6},
       {a -> -1, b -> 1, c -> 1, d -> 8, m -> 0, n -> -2, p -> -7},
       {a -> -1, b -> 1, c -> 1, d -> 9, m -> 0, n -> -2, p -> -8},
       {a -> -1, b -> 1, c -> 1, d -> 10, m -> 0, n -> -2, p -> -9},
       {a -> -1, b -> 1, c -> 2, d -> 0, m -> 0, n -> -3, p -> 1},
       {a -> -1, b -> 1, c -> 2, d -> 1, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> 1, c -> 2, d -> 2, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> 1, c -> 2, d -> 3, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> 1, c -> 2, d -> 4, m -> 0, n -> -3, p -> -3},
       {a -> -1, b -> 1, c -> 2, d -> 5, m -> 0, n -> -3, p -> -4},
       {a -> -1, b -> 1, c -> 2, d -> 6, m -> 0, n -> -3, p -> -5},
       {a -> -1, b -> 1, c -> 2, d -> 7, m -> 0, n -> -3, p -> -6},
       {a -> -1, b -> 1, c -> 2, d -> 8, m -> 0, n -> -3, p -> -7},
       {a -> -1, b -> 1, c -> 2, d -> 9, m -> 0, n -> -3, p -> -8},
       {a -> -1, b -> 1, c -> 2, d -> 10, m -> 0, n -> -3, p -> -9}}    *)
(*    {{a -> -9, b -> 51, c -> -4, d -> 10, m -> -2, n -> 19},
       {a -> -9, b -> 51, c -> 4, d -> -10, m -> -2, n -> 19},
       {a -> -4, b -> 10, c -> -9, d -> 51, m -> -2, n -> 19},
       {a -> -4, b -> 10, c -> 9, d -> -51, m -> -2, n -> 19},
       {a -> 4, b -> -10, c -> -9, d -> 51, m -> -2, n -> 19},
       {a -> 4, b -> -10, c -> 9, d -> -51, m -> -2, n -> 19},
       {a -> 9, b -> -51, c -> -4, d -> 10, m -> -2, n -> 19},
       {a -> 9, b -> -51, c -> 4, d -> -10, m -> -2, n -> 19}}    *)

Just use Solve instead of Reduce:

f[x_] = Abs[a x + b] + Abs[c x + d] + m x^2 + n x + p;

Solve[{f[1] == 0, f[2] == 0, f[3] == 0, f[4] == 0, f[7] == 0, f[9] == 0,
       -2 <= a <= -1, -2 <= b <= 3, -3 <= c <= 3, -3 <= d <= 10,
       -1 <= m <= 1, -3 <= n <= 8, -20 <= p <= 1},
      {a, b, c, d, m, n, p}, Integers]

(*    {{a -> -2, b -> -2, c -> -1, d -> -3, m -> 0, n -> -3, p -> -5},
       {a -> -2, b -> -2, c -> -1, d -> -2, m -> 0, n -> -3, p -> -4},
       {a -> -2, b -> -2, c -> -1, d -> -1, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> -2, c -> -1, d -> 0, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> -2, c -> -1, d -> 1, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> -2, c -> -1, d -> 9, m -> 0, n -> -1, p -> -11},
       {a -> -2, b -> -2, c -> -1, d -> 10, m -> 0, n -> -1, p -> -12},
       {a -> -2, b -> -2, c -> 0, d -> -3, m -> 0, n -> -2, p -> -5},
       {a -> -2, b -> -2, c -> 0, d -> -2, m -> 0, n -> -2, p -> -4},
       {a -> -2, b -> -2, c -> 0, d -> -1, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> -2, c -> 0, d -> 0, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> -2, c -> 0, d -> 1, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> -2, c -> 0, d -> 2, m -> 0, n -> -2, p -> -4},
       {a -> -2, b -> -2, c -> 0, d -> 3, m -> 0, n -> -2, p -> -5},
       {a -> -2, b -> -2, c -> 0, d -> 4, m -> 0, n -> -2, p -> -6},
       {a -> -2, b -> -2, c -> 0, d -> 5, m -> 0, n -> -2, p -> -7},
       {a -> -2, b -> -2, c -> 0, d -> 6, m -> 0, n -> -2, p -> -8},
       {a -> -2, b -> -2, c -> 0, d -> 7, m -> 0, n -> -2, p -> -9},
       {a -> -2, b -> -2, c -> 0, d -> 8, m -> 0, n -> -2, p -> -10},
       {a -> -2, b -> -2, c -> 0, d -> 9, m -> 0, n -> -2, p -> -11},
       {a -> -2, b -> -2, c -> 0, d -> 10, m -> 0, n -> -2, p -> -12},
       {a -> -2, b -> -2, c -> 1, d -> -1, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> -2, c -> 1, d -> 0, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> -2, c -> 1, d -> 1, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> -2, c -> 1, d -> 2, m -> 0, n -> -3, p -> -4},
       {a -> -2, b -> -2, c -> 1, d -> 3, m -> 0, n -> -3, p -> -5},
       {a -> -2, b -> -2, c -> 1, d -> 4, m -> 0, n -> -3, p -> -6},
       {a -> -2, b -> -2, c -> 1, d -> 5, m -> 0, n -> -3, p -> -7},
       {a -> -2, b -> -2, c -> 1, d -> 6, m -> 0, n -> -3, p -> -8},
       {a -> -2, b -> -2, c -> 1, d -> 7, m -> 0, n -> -3, p -> -9},
       {a -> -2, b -> -2, c -> 1, d -> 8, m -> 0, n -> -3, p -> -10},
       {a -> -2, b -> -2, c -> 1, d -> 9, m -> 0, n -> -3, p -> -11},
       {a -> -2, b -> -2, c -> 1, d -> 10, m -> 0, n -> -3, p -> -12},
       {a -> -2, b -> -1, c -> -1, d -> -3, m -> 0, n -> -3, p -> -4},
       {a -> -2, b -> -1, c -> -1, d -> -2, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> -1, c -> -1, d -> -1, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> -1, c -> -1, d -> 0, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> -1, c -> -1, d -> 1, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> -1, c -> -1, d -> 9, m -> 0, n -> -1, p -> -10},
       {a -> -2, b -> -1, c -> -1, d -> 10, m -> 0, n -> -1, p -> -11},
       {a -> -2, b -> -1, c -> 0, d -> -3, m -> 0, n -> -2, p -> -4},
       {a -> -2, b -> -1, c -> 0, d -> -2, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> -1, c -> 0, d -> -1, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> -1, c -> 0, d -> 0, m -> 0, n -> -2, p -> -1},
       {a -> -2, b -> -1, c -> 0, d -> 1, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> -1, c -> 0, d -> 2, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> -1, c -> 0, d -> 3, m -> 0, n -> -2, p -> -4},
       {a -> -2, b -> -1, c -> 0, d -> 4, m -> 0, n -> -2, p -> -5},
       {a -> -2, b -> -1, c -> 0, d -> 5, m -> 0, n -> -2, p -> -6},
       {a -> -2, b -> -1, c -> 0, d -> 6, m -> 0, n -> -2, p -> -7},
       {a -> -2, b -> -1, c -> 0, d -> 7, m -> 0, n -> -2, p -> -8},
       {a -> -2, b -> -1, c -> 0, d -> 8, m -> 0, n -> -2, p -> -9},
       {a -> -2, b -> -1, c -> 0, d -> 9, m -> 0, n -> -2, p -> -10},
       {a -> -2, b -> -1, c -> 0, d -> 10, m -> 0, n -> -2, p -> -11},
       {a -> -2, b -> -1, c -> 1, d -> -1, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> -1, c -> 1, d -> 0, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> -1, c -> 1, d -> 1, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> -1, c -> 1, d -> 2, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> -1, c -> 1, d -> 3, m -> 0, n -> -3, p -> -4},
       {a -> -2, b -> -1, c -> 1, d -> 4, m -> 0, n -> -3, p -> -5},
       {a -> -2, b -> -1, c -> 1, d -> 5, m -> 0, n -> -3, p -> -6},
       {a -> -2, b -> -1, c -> 1, d -> 6, m -> 0, n -> -3, p -> -7},
       {a -> -2, b -> -1, c -> 1, d -> 7, m -> 0, n -> -3, p -> -8},
       {a -> -2, b -> -1, c -> 1, d -> 8, m -> 0, n -> -3, p -> -9},
       {a -> -2, b -> -1, c -> 1, d -> 9, m -> 0, n -> -3, p -> -10},
       {a -> -2, b -> -1, c -> 1, d -> 10, m -> 0, n -> -3, p -> -11},
       {a -> -2, b -> 0, c -> -1, d -> -3, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> 0, c -> -1, d -> -2, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> 0, c -> -1, d -> -1, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> 0, c -> -1, d -> 0, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> 0, c -> -1, d -> 1, m -> 0, n -> -3, p -> 1},
       {a -> -2, b -> 0, c -> -1, d -> 9, m -> 0, n -> -1, p -> -9},
       {a -> -2, b -> 0, c -> -1, d -> 10, m -> 0, n -> -1, p -> -10},
       {a -> -2, b -> 0, c -> 0, d -> -3, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> 0, c -> 0, d -> -2, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> 0, c -> 0, d -> -1, m -> 0, n -> -2, p -> -1},
       {a -> -2, b -> 0, c -> 0, d -> 0, m -> 0, n -> -2, p -> 0},
       {a -> -2, b -> 0, c -> 0, d -> 1, m -> 0, n -> -2, p -> -1},
       {a -> -2, b -> 0, c -> 0, d -> 2, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> 0, c -> 0, d -> 3, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> 0, c -> 0, d -> 4, m -> 0, n -> -2, p -> -4},
       {a -> -2, b -> 0, c -> 0, d -> 5, m -> 0, n -> -2, p -> -5},
       {a -> -2, b -> 0, c -> 0, d -> 6, m -> 0, n -> -2, p -> -6},
       {a -> -2, b -> 0, c -> 0, d -> 7, m -> 0, n -> -2, p -> -7},
       {a -> -2, b -> 0, c -> 0, d -> 8, m -> 0, n -> -2, p -> -8},
       {a -> -2, b -> 0, c -> 0, d -> 9, m -> 0, n -> -2, p -> -9},
       {a -> -2, b -> 0, c -> 0, d -> 10, m -> 0, n -> -2, p -> -10},
       {a -> -2, b -> 0, c -> 1, d -> -1, m -> 0, n -> -3, p -> 1},
       {a -> -2, b -> 0, c -> 1, d -> 0, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> 0, c -> 1, d -> 1, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> 0, c -> 1, d -> 2, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> 0, c -> 1, d -> 3, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> 0, c -> 1, d -> 4, m -> 0, n -> -3, p -> -4},
       {a -> -2, b -> 0, c -> 1, d -> 5, m -> 0, n -> -3, p -> -5},
       {a -> -2, b -> 0, c -> 1, d -> 6, m -> 0, n -> -3, p -> -6},
       {a -> -2, b -> 0, c -> 1, d -> 7, m -> 0, n -> -3, p -> -7},
       {a -> -2, b -> 0, c -> 1, d -> 8, m -> 0, n -> -3, p -> -8},
       {a -> -2, b -> 0, c -> 1, d -> 9, m -> 0, n -> -3, p -> -9},
       {a -> -2, b -> 0, c -> 1, d -> 10, m -> 0, n -> -3, p -> -10},
       {a -> -2, b -> 1, c -> -1, d -> -3, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> 1, c -> -1, d -> -2, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> 1, c -> -1, d -> -1, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> 1, c -> -1, d -> 0, m -> 0, n -> -3, p -> 1},
       {a -> -2, b -> 1, c -> -1, d -> 9, m -> 0, n -> -1, p -> -8},
       {a -> -2, b -> 1, c -> -1, d -> 10, m -> 0, n -> -1, p -> -9},
       {a -> -2, b -> 1, c -> 0, d -> -3, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> 1, c -> 0, d -> -2, m -> 0, n -> -2, p -> -1},
       {a -> -2, b -> 1, c -> 0, d -> -1, m -> 0, n -> -2, p -> 0},
       {a -> -2, b -> 1, c -> 0, d -> 0, m -> 0, n -> -2, p -> 1},
       {a -> -2, b -> 1, c -> 0, d -> 1, m -> 0, n -> -2, p -> 0},
       {a -> -2, b -> 1, c -> 0, d -> 2, m -> 0, n -> -2, p -> -1},
       {a -> -2, b -> 1, c -> 0, d -> 3, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> 1, c -> 0, d -> 4, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> 1, c -> 0, d -> 5, m -> 0, n -> -2, p -> -4},
       {a -> -2, b -> 1, c -> 0, d -> 6, m -> 0, n -> -2, p -> -5},
       {a -> -2, b -> 1, c -> 0, d -> 7, m -> 0, n -> -2, p -> -6},
       {a -> -2, b -> 1, c -> 0, d -> 8, m -> 0, n -> -2, p -> -7},
       {a -> -2, b -> 1, c -> 0, d -> 9, m -> 0, n -> -2, p -> -8},
       {a -> -2, b -> 1, c -> 0, d -> 10, m -> 0, n -> -2, p -> -9},
       {a -> -2, b -> 1, c -> 1, d -> 0, m -> 0, n -> -3, p -> 1},
       {a -> -2, b -> 1, c -> 1, d -> 1, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> 1, c -> 1, d -> 2, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> 1, c -> 1, d -> 3, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> 1, c -> 1, d -> 4, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> 1, c -> 1, d -> 5, m -> 0, n -> -3, p -> -4},
       {a -> -2, b -> 1, c -> 1, d -> 6, m -> 0, n -> -3, p -> -5},
       {a -> -2, b -> 1, c -> 1, d -> 7, m -> 0, n -> -3, p -> -6},
       {a -> -2, b -> 1, c -> 1, d -> 8, m -> 0, n -> -3, p -> -7},
       {a -> -2, b -> 1, c -> 1, d -> 9, m -> 0, n -> -3, p -> -8},
       {a -> -2, b -> 1, c -> 1, d -> 10, m -> 0, n -> -3, p -> -9},
       {a -> -2, b -> 2, c -> -1, d -> -3, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> 2, c -> -1, d -> -2, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> 2, c -> -1, d -> -1, m -> 0, n -> -3, p -> 1},
       {a -> -2, b -> 2, c -> -1, d -> 9, m -> 0, n -> -1, p -> -7},
       {a -> -2, b -> 2, c -> -1, d -> 10, m -> 0, n -> -1, p -> -8},
       {a -> -2, b -> 2, c -> 0, d -> -3, m -> 0, n -> -2, p -> -1},
       {a -> -2, b -> 2, c -> 0, d -> -2, m -> 0, n -> -2, p -> 0},
       {a -> -2, b -> 2, c -> 0, d -> -1, m -> 0, n -> -2, p -> 1},
       {a -> -2, b -> 2, c -> 0, d -> 1, m -> 0, n -> -2, p -> 1},
       {a -> -2, b -> 2, c -> 0, d -> 2, m -> 0, n -> -2, p -> 0},
       {a -> -2, b -> 2, c -> 0, d -> 3, m -> 0, n -> -2, p -> -1},
       {a -> -2, b -> 2, c -> 0, d -> 4, m -> 0, n -> -2, p -> -2},
       {a -> -2, b -> 2, c -> 0, d -> 5, m -> 0, n -> -2, p -> -3},
       {a -> -2, b -> 2, c -> 0, d -> 6, m -> 0, n -> -2, p -> -4},
       {a -> -2, b -> 2, c -> 0, d -> 7, m -> 0, n -> -2, p -> -5},
       {a -> -2, b -> 2, c -> 0, d -> 8, m -> 0, n -> -2, p -> -6},
       {a -> -2, b -> 2, c -> 0, d -> 9, m -> 0, n -> -2, p -> -7},
       {a -> -2, b -> 2, c -> 0, d -> 10, m -> 0, n -> -2, p -> -8},
       {a -> -2, b -> 2, c -> 1, d -> 1, m -> 0, n -> -3, p -> 1},
       {a -> -2, b -> 2, c -> 1, d -> 2, m -> 0, n -> -3, p -> 0},
       {a -> -2, b -> 2, c -> 1, d -> 3, m -> 0, n -> -3, p -> -1},
       {a -> -2, b -> 2, c -> 1, d -> 4, m -> 0, n -> -3, p -> -2},
       {a -> -2, b -> 2, c -> 1, d -> 5, m -> 0, n -> -3, p -> -3},
       {a -> -2, b -> 2, c -> 1, d -> 6, m -> 0, n -> -3, p -> -4},
       {a -> -2, b -> 2, c -> 1, d -> 7, m -> 0, n -> -3, p -> -5},
       {a -> -2, b -> 2, c -> 1, d -> 8, m -> 0, n -> -3, p -> -6},
       {a -> -2, b -> 2, c -> 1, d -> 9, m -> 0, n -> -3, p -> -7},
       {a -> -2, b -> 2, c -> 1, d -> 10, m -> 0, n -> -3, p -> -8},
       {a -> -1, b -> -2, c -> -2, d -> -3, m -> 0, n -> -3, p -> -5},
       {a -> -1, b -> -2, c -> -2, d -> -2, m -> 0, n -> -3, p -> -4},
       {a -> -1, b -> -2, c -> -2, d -> -1, m -> 0, n -> -3, p -> -3},
       {a -> -1, b -> -2, c -> -2, d -> 0, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> -2, c -> -2, d -> 1, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> -2, c -> -2, d -> 2, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> -2, c -> -1, d -> -3, m -> 0, n -> -2, p -> -5},
       {a -> -1, b -> -2, c -> -1, d -> -2, m -> 0, n -> -2, p -> -4},
       {a -> -1, b -> -2, c -> -1, d -> -1, m -> 0, n -> -2, p -> -3},
       {a -> -1, b -> -2, c -> -1, d -> 0, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> -2, c -> -1, d -> 1, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> -2, c -> -1, d -> 9, m -> 0, n -> 0, p -> -11},
       {a -> -1, b -> -2, c -> -1, d -> 10, m -> 0, n -> 0, p -> -12},
       {a -> -1, b -> -2, c -> 0, d -> -3, m -> 0, n -> -1, p -> -5},
       {a -> -1, b -> -2, c -> 0, d -> -2, m -> 0, n -> -1, p -> -4},
       {a -> -1, b -> -2, c -> 0, d -> -1, m -> 0, n -> -1, p -> -3},
       {a -> -1, b -> -2, c -> 0, d -> 0, m -> 0, n -> -1, p -> -2},
       {a -> -1, b -> -2, c -> 0, d -> 1, m -> 0, n -> -1, p -> -3},
       {a -> -1, b -> -2, c -> 0, d -> 2, m -> 0, n -> -1, p -> -4},
       {a -> -1, b -> -2, c -> 0, d -> 3, m -> 0, n -> -1, p -> -5},
       {a -> -1, b -> -2, c -> 0, d -> 4, m -> 0, n -> -1, p -> -6},
       {a -> -1, b -> -2, c -> 0, d -> 5, m -> 0, n -> -1, p -> -7},
       {a -> -1, b -> -2, c -> 0, d -> 6, m -> 0, n -> -1, p -> -8},
       {a -> -1, b -> -2, c -> 0, d -> 7, m -> 0, n -> -1, p -> -9},
       {a -> -1, b -> -2, c -> 0, d -> 8, m -> 0, n -> -1, p -> -10},
       {a -> -1, b -> -2, c -> 0, d -> 9, m -> 0, n -> -1, p -> -11},
       {a -> -1, b -> -2, c -> 0, d -> 10, m -> 0, n -> -1, p -> -12},
       {a -> -1, b -> -2, c -> 1, d -> -1, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> -2, c -> 1, d -> 0, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> -2, c -> 1, d -> 1, m -> 0, n -> -2, p -> -3},
       {a -> -1, b -> -2, c -> 1, d -> 2, m -> 0, n -> -2, p -> -4},
       {a -> -1, b -> -2, c -> 1, d -> 3, m -> 0, n -> -2, p -> -5},
       {a -> -1, b -> -2, c -> 1, d -> 4, m -> 0, n -> -2, p -> -6},
       {a -> -1, b -> -2, c -> 1, d -> 5, m -> 0, n -> -2, p -> -7},
       {a -> -1, b -> -2, c -> 1, d -> 6, m -> 0, n -> -2, p -> -8},
       {a -> -1, b -> -2, c -> 1, d -> 7, m -> 0, n -> -2, p -> -9},
       {a -> -1, b -> -2, c -> 1, d -> 8, m -> 0, n -> -2, p -> -10},
       {a -> -1, b -> -2, c -> 1, d -> 9, m -> 0, n -> -2, p -> -11},
       {a -> -1, b -> -2, c -> 1, d -> 10, m -> 0, n -> -2, p -> -12},
       {a -> -1, b -> -2, c -> 2, d -> -2, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> -2, c -> 2, d -> -1, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> -2, c -> 2, d -> 0, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> -2, c -> 2, d -> 1, m -> 0, n -> -3, p -> -3},
       {a -> -1, b -> -2, c -> 2, d -> 2, m -> 0, n -> -3, p -> -4},
       {a -> -1, b -> -2, c -> 2, d -> 3, m -> 0, n -> -3, p -> -5},
       {a -> -1, b -> -2, c -> 2, d -> 4, m -> 0, n -> -3, p -> -6},
       {a -> -1, b -> -2, c -> 2, d -> 5, m -> 0, n -> -3, p -> -7},
       {a -> -1, b -> -2, c -> 2, d -> 6, m -> 0, n -> -3, p -> -8},
       {a -> -1, b -> -2, c -> 2, d -> 7, m -> 0, n -> -3, p -> -9},
       {a -> -1, b -> -2, c -> 2, d -> 8, m -> 0, n -> -3, p -> -10},
       {a -> -1, b -> -2, c -> 2, d -> 9, m -> 0, n -> -3, p -> -11},
       {a -> -1, b -> -2, c -> 2, d -> 10, m -> 0, n -> -3, p -> -12},
       {a -> -1, b -> -1, c -> -2, d -> -3, m -> 0, n -> -3, p -> -4},
       {a -> -1, b -> -1, c -> -2, d -> -2, m -> 0, n -> -3, p -> -3},
       {a -> -1, b -> -1, c -> -2, d -> -1, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> -1, c -> -2, d -> 0, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> -1, c -> -2, d -> 1, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> -1, c -> -2, d -> 2, m -> 0, n -> -3, p -> 1},
       {a -> -1, b -> -1, c -> -1, d -> -3, m -> 0, n -> -2, p -> -4},
       {a -> -1, b -> -1, c -> -1, d -> -2, m -> 0, n -> -2, p -> -3},
       {a -> -1, b -> -1, c -> -1, d -> -1, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> -1, c -> -1, d -> 0, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> -1, c -> -1, d -> 1, m -> 0, n -> -2, p -> 0},
       {a -> -1, b -> -1, c -> -1, d -> 9, m -> 0, n -> 0, p -> -10},
       {a -> -1, b -> -1, c -> -1, d -> 10, m -> 0, n -> 0, p -> -11},
       {a -> -1, b -> -1, c -> 0, d -> -3, m -> 0, n -> -1, p -> -4},
       {a -> -1, b -> -1, c -> 0, d -> -2, m -> 0, n -> -1, p -> -3},
       {a -> -1, b -> -1, c -> 0, d -> -1, m -> 0, n -> -1, p -> -2},
       {a -> -1, b -> -1, c -> 0, d -> 0, m -> 0, n -> -1, p -> -1},
       {a -> -1, b -> -1, c -> 0, d -> 1, m -> 0, n -> -1, p -> -2},
       {a -> -1, b -> -1, c -> 0, d -> 2, m -> 0, n -> -1, p -> -3},
       {a -> -1, b -> -1, c -> 0, d -> 3, m -> 0, n -> -1, p -> -4},
       {a -> -1, b -> -1, c -> 0, d -> 4, m -> 0, n -> -1, p -> -5},
       {a -> -1, b -> -1, c -> 0, d -> 5, m -> 0, n -> -1, p -> -6},
       {a -> -1, b -> -1, c -> 0, d -> 6, m -> 0, n -> -1, p -> -7},
       {a -> -1, b -> -1, c -> 0, d -> 7, m -> 0, n -> -1, p -> -8},
       {a -> -1, b -> -1, c -> 0, d -> 8, m -> 0, n -> -1, p -> -9},
       {a -> -1, b -> -1, c -> 0, d -> 9, m -> 0, n -> -1, p -> -10},
       {a -> -1, b -> -1, c -> 0, d -> 10, m -> 0, n -> -1, p -> -11},
       {a -> -1, b -> -1, c -> 1, d -> -1, m -> 0, n -> -2, p -> 0},
       {a -> -1, b -> -1, c -> 1, d -> 0, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> -1, c -> 1, d -> 1, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> -1, c -> 1, d -> 2, m -> 0, n -> -2, p -> -3},
       {a -> -1, b -> -1, c -> 1, d -> 3, m -> 0, n -> -2, p -> -4},
       {a -> -1, b -> -1, c -> 1, d -> 4, m -> 0, n -> -2, p -> -5},
       {a -> -1, b -> -1, c -> 1, d -> 5, m -> 0, n -> -2, p -> -6},
       {a -> -1, b -> -1, c -> 1, d -> 6, m -> 0, n -> -2, p -> -7},
       {a -> -1, b -> -1, c -> 1, d -> 7, m -> 0, n -> -2, p -> -8},
       {a -> -1, b -> -1, c -> 1, d -> 8, m -> 0, n -> -2, p -> -9},
       {a -> -1, b -> -1, c -> 1, d -> 9, m -> 0, n -> -2, p -> -10},
       {a -> -1, b -> -1, c -> 1, d -> 10, m -> 0, n -> -2, p -> -11},
       {a -> -1, b -> -1, c -> 2, d -> -2, m -> 0, n -> -3, p -> 1},
       {a -> -1, b -> -1, c -> 2, d -> -1, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> -1, c -> 2, d -> 0, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> -1, c -> 2, d -> 1, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> -1, c -> 2, d -> 2, m -> 0, n -> -3, p -> -3},
       {a -> -1, b -> -1, c -> 2, d -> 3, m -> 0, n -> -3, p -> -4},
       {a -> -1, b -> -1, c -> 2, d -> 4, m -> 0, n -> -3, p -> -5},
       {a -> -1, b -> -1, c -> 2, d -> 5, m -> 0, n -> -3, p -> -6},
       {a -> -1, b -> -1, c -> 2, d -> 6, m -> 0, n -> -3, p -> -7},
       {a -> -1, b -> -1, c -> 2, d -> 7, m -> 0, n -> -3, p -> -8},
       {a -> -1, b -> -1, c -> 2, d -> 8, m -> 0, n -> -3, p -> -9},
       {a -> -1, b -> -1, c -> 2, d -> 9, m -> 0, n -> -3, p -> -10},
       {a -> -1, b -> -1, c -> 2, d -> 10, m -> 0, n -> -3, p -> -11},
       {a -> -1, b -> 0, c -> -2, d -> -3, m -> 0, n -> -3, p -> -3},
       {a -> -1, b -> 0, c -> -2, d -> -2, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> 0, c -> -2, d -> -1, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> 0, c -> -2, d -> 0, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> 0, c -> -2, d -> 1, m -> 0, n -> -3, p -> 1},
       {a -> -1, b -> 0, c -> -1, d -> -3, m -> 0, n -> -2, p -> -3},
       {a -> -1, b -> 0, c -> -1, d -> -2, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> 0, c -> -1, d -> -1, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> 0, c -> -1, d -> 0, m -> 0, n -> -2, p -> 0},
       {a -> -1, b -> 0, c -> -1, d -> 1, m -> 0, n -> -2, p -> 1},
       {a -> -1, b -> 0, c -> -1, d -> 9, m -> 0, n -> 0, p -> -9},
       {a -> -1, b -> 0, c -> -1, d -> 10, m -> 0, n -> 0, p -> -10},
       {a -> -1, b -> 0, c -> 0, d -> -3, m -> 0, n -> -1, p -> -3},
       {a -> -1, b -> 0, c -> 0, d -> -2, m -> 0, n -> -1, p -> -2},
       {a -> -1, b -> 0, c -> 0, d -> -1, m -> 0, n -> -1, p -> -1},
       {a -> -1, b -> 0, c -> 0, d -> 0, m -> 0, n -> -1, p -> 0},
       {a -> -1, b -> 0, c -> 0, d -> 1, m -> 0, n -> -1, p -> -1},
       {a -> -1, b -> 0, c -> 0, d -> 2, m -> 0, n -> -1, p -> -2},
       {a -> -1, b -> 0, c -> 0, d -> 3, m -> 0, n -> -1, p -> -3},
       {a -> -1, b -> 0, c -> 0, d -> 4, m -> 0, n -> -1, p -> -4},
       {a -> -1, b -> 0, c -> 0, d -> 5, m -> 0, n -> -1, p -> -5},
       {a -> -1, b -> 0, c -> 0, d -> 6, m -> 0, n -> -1, p -> -6},
       {a -> -1, b -> 0, c -> 0, d -> 7, m -> 0, n -> -1, p -> -7},
       {a -> -1, b -> 0, c -> 0, d -> 8, m -> 0, n -> -1, p -> -8},
       {a -> -1, b -> 0, c -> 0, d -> 9, m -> 0, n -> -1, p -> -9},
       {a -> -1, b -> 0, c -> 0, d -> 10, m -> 0, n -> -1, p -> -10},
       {a -> -1, b -> 0, c -> 1, d -> -1, m -> 0, n -> -2, p -> 1},
       {a -> -1, b -> 0, c -> 1, d -> 0, m -> 0, n -> -2, p -> 0},
       {a -> -1, b -> 0, c -> 1, d -> 1, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> 0, c -> 1, d -> 2, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> 0, c -> 1, d -> 3, m -> 0, n -> -2, p -> -3},
       {a -> -1, b -> 0, c -> 1, d -> 4, m -> 0, n -> -2, p -> -4},
       {a -> -1, b -> 0, c -> 1, d -> 5, m -> 0, n -> -2, p -> -5},
       {a -> -1, b -> 0, c -> 1, d -> 6, m -> 0, n -> -2, p -> -6},
       {a -> -1, b -> 0, c -> 1, d -> 7, m -> 0, n -> -2, p -> -7},
       {a -> -1, b -> 0, c -> 1, d -> 8, m -> 0, n -> -2, p -> -8},
       {a -> -1, b -> 0, c -> 1, d -> 9, m -> 0, n -> -2, p -> -9},
       {a -> -1, b -> 0, c -> 1, d -> 10, m -> 0, n -> -2, p -> -10},
       {a -> -1, b -> 0, c -> 2, d -> -1, m -> 0, n -> -3, p -> 1},
       {a -> -1, b -> 0, c -> 2, d -> 0, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> 0, c -> 2, d -> 1, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> 0, c -> 2, d -> 2, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> 0, c -> 2, d -> 3, m -> 0, n -> -3, p -> -3},
       {a -> -1, b -> 0, c -> 2, d -> 4, m -> 0, n -> -3, p -> -4},
       {a -> -1, b -> 0, c -> 2, d -> 5, m -> 0, n -> -3, p -> -5},
       {a -> -1, b -> 0, c -> 2, d -> 6, m -> 0, n -> -3, p -> -6},
       {a -> -1, b -> 0, c -> 2, d -> 7, m -> 0, n -> -3, p -> -7},
       {a -> -1, b -> 0, c -> 2, d -> 8, m -> 0, n -> -3, p -> -8},
       {a -> -1, b -> 0, c -> 2, d -> 9, m -> 0, n -> -3, p -> -9},
       {a -> -1, b -> 0, c -> 2, d -> 10, m -> 0, n -> -3, p -> -10},
       {a -> -1, b -> 1, c -> -2, d -> -3, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> 1, c -> -2, d -> -2, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> 1, c -> -2, d -> -1, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> 1, c -> -2, d -> 0, m -> 0, n -> -3, p -> 1},
       {a -> -1, b -> 1, c -> -1, d -> -3, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> 1, c -> -1, d -> -2, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> 1, c -> -1, d -> -1, m -> 0, n -> -2, p -> 0},
       {a -> -1, b -> 1, c -> -1, d -> 0, m -> 0, n -> -2, p -> 1},
       {a -> -1, b -> 1, c -> -1, d -> 9, m -> 0, n -> 0, p -> -8},
       {a -> -1, b -> 1, c -> -1, d -> 10, m -> 0, n -> 0, p -> -9},
       {a -> -1, b -> 1, c -> 0, d -> -3, m -> 0, n -> -1, p -> -2},
       {a -> -1, b -> 1, c -> 0, d -> -2, m -> 0, n -> -1, p -> -1},
       {a -> -1, b -> 1, c -> 0, d -> -1, m -> 0, n -> -1, p -> 0},
       {a -> -1, b -> 1, c -> 0, d -> 0, m -> 0, n -> -1, p -> 1},
       {a -> -1, b -> 1, c -> 0, d -> 1, m -> 0, n -> -1, p -> 0},
       {a -> -1, b -> 1, c -> 0, d -> 2, m -> 0, n -> -1, p -> -1},
       {a -> -1, b -> 1, c -> 0, d -> 3, m -> 0, n -> -1, p -> -2},
       {a -> -1, b -> 1, c -> 0, d -> 4, m -> 0, n -> -1, p -> -3},
       {a -> -1, b -> 1, c -> 0, d -> 5, m -> 0, n -> -1, p -> -4},
       {a -> -1, b -> 1, c -> 0, d -> 6, m -> 0, n -> -1, p -> -5},
       {a -> -1, b -> 1, c -> 0, d -> 7, m -> 0, n -> -1, p -> -6},
       {a -> -1, b -> 1, c -> 0, d -> 8, m -> 0, n -> -1, p -> -7},
       {a -> -1, b -> 1, c -> 0, d -> 9, m -> 0, n -> -1, p -> -8},
       {a -> -1, b -> 1, c -> 0, d -> 10, m -> 0, n -> -1, p -> -9},
       {a -> -1, b -> 1, c -> 1, d -> 0, m -> 0, n -> -2, p -> 1},
       {a -> -1, b -> 1, c -> 1, d -> 1, m -> 0, n -> -2, p -> 0},
       {a -> -1, b -> 1, c -> 1, d -> 2, m -> 0, n -> -2, p -> -1},
       {a -> -1, b -> 1, c -> 1, d -> 3, m -> 0, n -> -2, p -> -2},
       {a -> -1, b -> 1, c -> 1, d -> 4, m -> 0, n -> -2, p -> -3},
       {a -> -1, b -> 1, c -> 1, d -> 5, m -> 0, n -> -2, p -> -4},
       {a -> -1, b -> 1, c -> 1, d -> 6, m -> 0, n -> -2, p -> -5},
       {a -> -1, b -> 1, c -> 1, d -> 7, m -> 0, n -> -2, p -> -6},
       {a -> -1, b -> 1, c -> 1, d -> 8, m -> 0, n -> -2, p -> -7},
       {a -> -1, b -> 1, c -> 1, d -> 9, m -> 0, n -> -2, p -> -8},
       {a -> -1, b -> 1, c -> 1, d -> 10, m -> 0, n -> -2, p -> -9},
       {a -> -1, b -> 1, c -> 2, d -> 0, m -> 0, n -> -3, p -> 1},
       {a -> -1, b -> 1, c -> 2, d -> 1, m -> 0, n -> -3, p -> 0},
       {a -> -1, b -> 1, c -> 2, d -> 2, m -> 0, n -> -3, p -> -1},
       {a -> -1, b -> 1, c -> 2, d -> 3, m -> 0, n -> -3, p -> -2},
       {a -> -1, b -> 1, c -> 2, d -> 4, m -> 0, n -> -3, p -> -3},
       {a -> -1, b -> 1, c -> 2, d -> 5, m -> 0, n -> -3, p -> -4},
       {a -> -1, b -> 1, c -> 2, d -> 6, m -> 0, n -> -3, p -> -5},
       {a -> -1, b -> 1, c -> 2, d -> 7, m -> 0, n -> -3, p -> -6},
       {a -> -1, b -> 1, c -> 2, d -> 8, m -> 0, n -> -3, p -> -7},
       {a -> -1, b -> 1, c -> 2, d -> 9, m -> 0, n -> -3, p -> -8},
       {a -> -1, b -> 1, c -> 2, d -> 10, m -> 0, n -> -3, p -> -9}}    *)

Just use Solve instead of Reduce. We can eliminate $p$ by setting

f[x_] = Abs[a x + b] + Abs[c x + d] + m x^2 + n x;

and looking for $f(1)=f(2)=f(3)=f(4)=f(7)=f(9)$ (which is necessarily integer when all parameters are integers). As suggested by @Akku14, enlarging the search space yields solutions for $m\neq 0$:

Solve[Join[{Equal @@ f /@ {1, 2, 3, 4, 7, 9}, m != 0},
            Thread[-100 <= {a, b, c, d, n} <= 100]], 
            {a, b, c, d, m, n}, Integers]

(*    {{a -> -9, b -> 51, c -> -4, d -> 10, m -> -2, n -> 19},
       {a -> -9, b -> 51, c -> 4, d -> -10, m -> -2, n -> 19},
       {a -> -4, b -> 10, c -> -9, d -> 51, m -> -2, n -> 19},
       {a -> -4, b -> 10, c -> 9, d -> -51, m -> -2, n -> 19},
       {a -> 4, b -> -10, c -> -9, d -> 51, m -> -2, n -> 19},
       {a -> 4, b -> -10, c -> 9, d -> -51, m -> -2, n -> 19},
       {a -> 9, b -> -51, c -> -4, d -> 10, m -> -2, n -> 19},
       {a -> 9, b -> -51, c -> 4, d -> -10, m -> -2, n -> 19}}    *)
Source Link
Roman
  • 49.9k
  • 2
  • 57
  • 131
Loading