### 3.7.24. Autoref

A constraint that allows for modelling the autoref problem with one 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=\left({s}_{0},{s}_{1},...,{s}_{n},{s}_{n+1}\right)$ 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:

$\mathrm{๐๐๐๐๐๐}_\mathrm{๐๐๐๐๐๐๐๐๐๐๐ข}$$\left(\begin{array}{c}โฉ\begin{array}{c}\mathrm{๐๐๐}-{s}_{0},\mathrm{๐๐๐}-{s}_{1},...,\mathrm{๐๐๐}-{s}_{n},\mathrm{๐๐๐}-m\hfill \end{array}โช,\hfill \\ โฉ\begin{array}{cc}\mathrm{๐๐๐}-0\hfill & \mathrm{๐๐๐๐๐๐๐๐๐๐๐}-{s}_{0},\hfill \\ \mathrm{๐๐๐}-1\hfill & \mathrm{๐๐๐๐๐๐๐๐๐๐๐}-{s}_{1},\hfill \\ & โฎ\hfill \\ \mathrm{๐๐๐}-n\hfill & \mathrm{๐๐๐๐๐๐๐๐๐๐๐}-{s}_{n}\hfill \end{array}โช\hfill \end{array}\right)$

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$.