3.7.26. Autoref

A constraint that allows for modelling the autoref problem with a single constraint. The autoref problem is a generalisation of the problem of finding a magic serie and can be defined in the following way. Given an integer n>0 and an integer mโ‰ฅ0, the problem is to find a non-empty finite series S=(s 0 ,s 1 ,โ‹ฏ,s n ,s n+1 ) such that (1)ย there are s i occurrences of i in S for each integer i ranging from 0 to n, and (2)ย s n+1 =m. This leads to the following model:

๐š๐š•๐š˜๐š‹๐šŠ๐š•_๐šŒ๐šŠ๐š›๐š๐š’๐š—๐šŠ๐š•๐š’๐š๐šข๐šŸ๐šŠ๐š›-s 0 ,๐šŸ๐šŠ๐š›-s 1 ,โ‹ฏ,๐šŸ๐šŠ๐š›-s n ,๐šŸ๐šŠ๐š›-m,๐šŸ๐šŠ๐š•-0๐š—๐š˜๐šŒ๐šŒ๐šž๐š›๐š›๐šŽ๐š—๐šŒ๐šŽ-s 0 ,๐šŸ๐šŠ๐š•-1๐š—๐š˜๐šŒ๐šŒ๐šž๐š›๐š›๐šŽ๐š—๐šŒ๐šŽ-s 1 ,โ‹ฎ๐šŸ๐šŠ๐š•-n๐š—๐š˜๐šŒ๐šŒ๐šž๐š›๐š›๐šŽ๐š—๐šŒ๐šŽ-s n

23, 2, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 5 and 23, 3, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 5 are the two unique solutions for n=27 and m=5.