Skip to main content
deleted 5 characters in body
Source Link

I have the following system with mixed equality and inequalities defined as:

n = 100;
eqn = (n1 + n3 + n5 == n2 + n4 + n6) && (n1 >= 
    n2) && (n1 - n2 + n3 - n4 >= 0) && (n1 <= n) && (n1 - n2 + n3 <= 
    n) && (n1 - n2 + n3 - n4 + n5 <= n) && (2 n <= 
    n1 + n2 + n3 + n4 + n5 + n6 <= 6 n) && (n1 > 0) && (n2 > 0) && (n3 > 0) && (n4 > 0) && (n5 > 0) && (n6 > 0);

0);

How can I find all the integer solutions and especially the number of all integer solutions?

It seems Reduce or Solve does not work:

sol = Reduce[eqn, {n1, n2, n3, n4, n5, n6}, Integers]

produces:

  (n1 | n2 | n3 | n4 | n5 | n6) \[Element] 
  Integers && ((1 <= n1 <= 99 && 
     0 < n2 <= 
      n1 && ((0 < n3 < 100 - n1 && 0 < n4 <= n1 - n2 + n3 && 
         100 - n1 - n3 <= n5 <= 100 - n1 + n2 - n3 + n4 && 
         n6 == n1 - n2 + n3 - n4 + n5) || (100 - n1 <= n3 <= 
          100 - n1 + n2 && 0 < n4 <= n1 - n2 + n3 && 
         0 < n5 <= 100 - n1 + n2 - n3 + n4 && 
         n6 == n1 - n2 + n3 - n4 + n5))) || (n1 == 100 && 
     1 <= n2 <= 100 && 0 < n3 <= n2 && 0 < n4 <= 100 - n2 + n3 && 
     0 < n5 <= n2 - n3 + n4 && n6 == 100 - n2 + n3 - n4 + n5))

I have the following system with mixed equality and inequalities defined as:

n = 100;
eqn = (n1 + n3 + n5 == n2 + n4 + n6) && (n1 >= 
    n2) && (n1 - n2 + n3 - n4 >= 0) && (n1 <= n) && (n1 - n2 + n3 <= 
    n) && (n1 - n2 + n3 - n4 + n5 <= n) && (2 n <= 
    n1 + n2 + n3 + n4 + n5 + n6 <= 6 n) && (n1 > 0) && (n2 > 0) && (n3 > 0) && (n4 > 0) && (n5 > 0) && (n6 > 

0);

How can I find all the integer solutions and especially the number of all integer solutions?

It seems Reduce or Solve does not work:

sol = Reduce[eqn, {n1, n2, n3, n4, n5, n6}, Integers]

produces:

  (n1 | n2 | n3 | n4 | n5 | n6) \[Element] 
  Integers && ((1 <= n1 <= 99 && 
     0 < n2 <= 
      n1 && ((0 < n3 < 100 - n1 && 0 < n4 <= n1 - n2 + n3 && 
         100 - n1 - n3 <= n5 <= 100 - n1 + n2 - n3 + n4 && 
         n6 == n1 - n2 + n3 - n4 + n5) || (100 - n1 <= n3 <= 
          100 - n1 + n2 && 0 < n4 <= n1 - n2 + n3 && 
         0 < n5 <= 100 - n1 + n2 - n3 + n4 && 
         n6 == n1 - n2 + n3 - n4 + n5))) || (n1 == 100 && 
     1 <= n2 <= 100 && 0 < n3 <= n2 && 0 < n4 <= 100 - n2 + n3 && 
     0 < n5 <= n2 - n3 + n4 && n6 == 100 - n2 + n3 - n4 + n5))

I have the following system with mixed equality and inequalities defined as:

n = 100;
eqn = (n1 + n3 + n5 == n2 + n4 + n6) && (n1 >= 
    n2) && (n1 - n2 + n3 - n4 >= 0) && (n1 <= n) && (n1 - n2 + n3 <= 
    n) && (n1 - n2 + n3 - n4 + n5 <= n) && (2 n <= 
    n1 + n2 + n3 + n4 + n5 + n6 <= 6 n) && (n1 > 0) && (n2 > 0) && (n3 > 0) && (n4 > 0) && (n5 > 0) && (n6 > 0);

How can I find all the integer solutions and especially the number of all integer solutions?

It seems Reduce or Solve does not work:

sol = Reduce[eqn, {n1, n2, n3, n4, n5, n6}, Integers]

produces:

  (n1 | n2 | n3 | n4 | n5 | n6) \[Element] 
  Integers && ((1 <= n1 <= 99 && 
     0 < n2 <= 
      n1 && ((0 < n3 < 100 - n1 && 0 < n4 <= n1 - n2 + n3 && 
         100 - n1 - n3 <= n5 <= 100 - n1 + n2 - n3 + n4 && 
         n6 == n1 - n2 + n3 - n4 + n5) || (100 - n1 <= n3 <= 
          100 - n1 + n2 && 0 < n4 <= n1 - n2 + n3 && 
         0 < n5 <= 100 - n1 + n2 - n3 + n4 && 
         n6 == n1 - n2 + n3 - n4 + n5))) || (n1 == 100 && 
     1 <= n2 <= 100 && 0 < n3 <= n2 && 0 < n4 <= 100 - n2 + n3 && 
     0 < n5 <= n2 - n3 + n4 && n6 == 100 - n2 + n3 - n4 + n5))
added 77 characters in body
Source Link
n = 100;
eqn = (n1 + n3 + n5 == n2 + n4 + n6) && (n1 >= 
    n2) && (n1 - n2 + n3 - n4 >= 0) && (n1 <= n) && (n1 - n2 + n3 <= 
    n) && (n1 - n2 + n3 - n4 + n5 <= n) && (2 n <= 
    n1 + n2 + n3 + n4 + n5 + n6 <= 6 n); && (n1 > 0) && (n2 > 0) && (n3 > 0) && (n4 > 0) && (n5 > 0) && (n6 > 

0);

How can I find all the integer solutions and especially the number of all integer solutions?

  (n1 | n2 | n3 | n4 | n5 | n6) \[Element] 
  Integers && -100((1 <= n1 <= 99 && 
  100 && (( 0 < n2 ==<= -100
      n1 && ((0 < n3 ==< 100 - n1 && 0 < n4 ==<= 100n1 &&- n5n2 ==+ 100n3 && 
     n6 == 100) || (-100 <- n2n1 <=- 
 n3 <= n5 <= 100 - n1 &&+ ((n2 - n3 ==+ -n1n4 && n4 
 == -n2 && n5 == 100 && 
  n6 == n1 - n2 + n3 - n6n4 ==+ 100n5) || (100 - n1 <<= n3 <= 
          100 - n1 + 
 n2 && 0 < n4 <= n1 - n2 + n2n3 && ((n4 
 == -n2 &&      0 < n5 ==<= 100 - n1 -+ n3n2 &&- 
 n3 + n4 &&  
         n6 == 100) ||n1 (-n2 < n4n2 <=+ n1n3 - n2n4 + n3n5))) &&|| 
 (n1 == 100 &&  
     1 <= n2 <= 100 -&& n10 -< n3 <= n5n2 <=&& 1000 -< n1n4 +<= n2100 - n3n2 + n4n3 && 
     0 < n5 <= n2 - n3 + n4 && n6 == n1100 - n2 + n3 - n4 + n5))))))
n = 100;
eqn = (n1 + n3 + n5 == n2 + n4 + n6) && (n1 >= 
    n2) && (n1 - n2 + n3 - n4 >= 0) && (n1 <= n) && (n1 - n2 + n3 <= 
    n) && (n1 - n2 + n3 - n4 + n5 <= n) && (2 n <= 
    n1 + n2 + n3 + n4 + n5 + n6 <= 6 n);

How can I find all the integer solutions and especially the number of all integer solutions?

(n1 | n2 | n3 | n4 | n5 | n6) \[Element] Integers && -100 <= n1 <= 
  100 && ((n2 == -100 && n3 == -n1 && n4 == 100 && n5 == 100 && 
     n6 == 100) || (-100 < n2 <= 
       n1 && ((n3 == -n1 && n4 == -n2 && n5 == 100 && 
          n6 == 100) || (-n1 < n3 <= 
          100 - n1 + 
           n2 && ((n4 == -n2 && n5 == 100 - n1 - n3 && 
              n6 == 100) || (-n2 < n4 <= n1 - n2 + n3 && 
              100 - n1 - n3 <= n5 <= 100 - n1 + n2 - n3 + n4 && 
             n6 == n1 - n2 + n3 - n4 + n5))))))
n = 100;
eqn = (n1 + n3 + n5 == n2 + n4 + n6) && (n1 >= 
    n2) && (n1 - n2 + n3 - n4 >= 0) && (n1 <= n) && (n1 - n2 + n3 <= 
    n) && (n1 - n2 + n3 - n4 + n5 <= n) && (2 n <= 
    n1 + n2 + n3 + n4 + n5 + n6 <= 6 n) && (n1 > 0) && (n2 > 0) && (n3 > 0) && (n4 > 0) && (n5 > 0) && (n6 > 

0);

How can I find all the integer solutions and especially the number of all integer solutions?

  (n1 | n2 | n3 | n4 | n5 | n6) \[Element] 
  Integers && ((1 <= n1 <= 99 && 
     0 < n2 <= 
      n1 && ((0 < n3 < 100 - n1 && 0 < n4 <= n1 - n2 + n3 && 
         100 - n1 - n3 <= n5 <= 100 - n1 + n2 - n3 + n4 &&  
         n6 == n1 - n2 + n3 - n4 + n5) || (100 - n1 <= n3 <= 
          100 - n1 + n2 && 0 < n4 <= n1 - n2 + n3 &&  
         0 < n5 <= 100 - n1 + n2 - n3 + n4 &&  
         n6 == n1 - n2 + n3 - n4 + n5))) || (n1 == 100 &&  
     1 <= n2 <= 100 && 0 < n3 <= n2 && 0 < n4 <= 100 - n2 + n3 && 
     0 < n5 <= n2 - n3 + n4 && n6 == 100 - n2 + n3 - n4 + n5))
Source Link

How to find the integer solution number of a linear system with inequalities?

I have the following system with mixed equality and inequalities defined as:

n = 100;
eqn = (n1 + n3 + n5 == n2 + n4 + n6) && (n1 >= 
    n2) && (n1 - n2 + n3 - n4 >= 0) && (n1 <= n) && (n1 - n2 + n3 <= 
    n) && (n1 - n2 + n3 - n4 + n5 <= n) && (2 n <= 
    n1 + n2 + n3 + n4 + n5 + n6 <= 6 n);

How can I find all the integer solutions and especially the number of all integer solutions?

It seems Reduce or Solve does not work:

sol = Reduce[eqn, {n1, n2, n3, n4, n5, n6}, Integers]

produces:

(n1 | n2 | n3 | n4 | n5 | n6) \[Element] Integers && -100 <= n1 <= 
  100 && ((n2 == -100 && n3 == -n1 && n4 == 100 && n5 == 100 && 
     n6 == 100) || (-100 < n2 <= 
      n1 && ((n3 == -n1 && n4 == -n2 && n5 == 100 && 
         n6 == 100) || (-n1 < n3 <= 
          100 - n1 + 
           n2 && ((n4 == -n2 && n5 == 100 - n1 - n3 && 
             n6 == 100) || (-n2 < n4 <= n1 - n2 + n3 && 
             100 - n1 - n3 <= n5 <= 100 - n1 + n2 - n3 + n4 && 
             n6 == n1 - n2 + n3 - n4 + n5))))))