Use the following forms to get constraints suitable for framing or input into CPLEX. In either case, you can use your browser's "Save As" option to save the constraints into a file on your system.
Use this form to get the basic constraints on the variables. The basic constraints enforce the condition that no APs are present in the solution.
If you enter a size the resulting input will cause CPLEX to find an AP-free set of that size.
If you enter the number of other bounds to use you must also enter a size. The resulting input will use bounds for smaller values of n to generate some extra constraints. For example, if n=99 and size=27 then we know the following from bounds on lower values of n (for example, for n=94 the largest set is 25).
x95+x96+x97+x98 >= 1 x5+x4+x3+x2 >= 1 x92+x93+x94+x95+x96+x97+x98 >= 2 x8+x7+x6+x5+x4+x3+x2 >= 2 x84+x85+x86+x87+x88+x89+x90+x91+x92+x93+x94+x95+x96+x97+x98 >= 3 x16+x15+x14+x13+x12+x11+x10+x9+x8+x7+x6+x5+x4+x3+x2 >= 3 x82+x83+x84+x85+x86+x87+x88+x89+x90+x91+x92+x93+x94+x95+x96+x97+x98 >= 4 x18+x17+x16+x15+x14+x13+x12+x11+x10+x9+x8+x7+x6+x5+x4+x3+x2 >= 4 x74+x75+x76+x77+x78+x79+x80+x81+x82+x83+x84+x85+x86+x87+x88+x89+x90+x91+x92+x93+x94+x95+x96+x97+x98 >= 5 x26+x25+x24+x23+x22+x21+x20+x19+x18+x17+x16+x15+x14+x13+x12+x11+x10+x9+x8+x7+x6+x5+x4+x3+x2 >= 5 x71+x72+x73+x74+x75+x76+x77+x78+x79+x80+x81+x82+x83+x84+x85+x86+x87+x88+x89+x90+x91+x92+x93+x94+x95+x96+x97+x98 >= 6 x29+x28+x27+x26+x25+x24+x23+x22+x21+x20+x19+x18+x17+x16+x15+x14+x13+x12+x11+x10+x9+x8+x7+x6+x5+x4+x3+x2 >= 6 ...Entering 1 gives the first pair of constraints. Entering 2 gives the next pair as well, etc.
This form links to a Java program that you can download and run on your own machine. Assuming everything is set up correctly on your end, you can save the tar file and run the commands
tar xf cplex.tar javac *.java java MakeBasicConstraints 99 27 3where the three arguments are the three values you would enter in the form above. You can also add the argument "symmetric" at the end, which has the same effect as checking the "Use symmetry" box in the form.
Use this form to get the extra constraints on the variables. These extra constraints are obtained from bounds on the sizes of AP-free subsets of {1, ..., m} where m < n. Note that this will omit some redundant constraints: x1+x2+x3+x4+x5 <= 4 is weaker than x1+x2+x3+x4+x5+x6 <= 4 and so will be omitted if you choose constraints with 5 and 6 terms.