Your task is to choose integers for the sectors such that the largest number (i) in the sequence is as high as possible. Figure 1 below shows how to generate all numbers from 2 to 21 (for n=5, m=2, k=1). The ^-sign below the sectors shows which sectors to add together to make numbers in the sequence.
5 2 1
The output for the example above might be:
21 1 3 10 2 5 1 5 2 10 3 2 4 9 3 5 2 5 3 9 4
FIGURE 1 (all circles have been cut open as indicated by arrow): |----------| |----------| |----------| |----------| .->|1|3|10|2|5|-. |1|3|10|2|5| |1|3|10|2|5| |1|3|10|2|5| | |----------| | |----------| |----------| |----------| | ^ | ^ ^ ^ ^ "---------------" |----------| |----------| |----------| |----------| .->|1|3|10|2|5|-. |1|3|10|2|5| |1|3|10|2|5| |1|3|10|2|5| | |----------| | |----------| |----------| |----------| | ^ ^ | ^ ^ ^ ^ ^ ^ ^ ^ "---------------" |----------| |----------| |----------| |----------| .->|1|3|10|2|5|-. |1|3|10|2|5| |1|3|10|2|5| |1|3|10|2|5| | |----------| | |----------| |----------| |----------| | ^ | ^ ^ ^ ^ ^ ^ ^ ^ ^ "---------------" |----------| |----------| |----------| |----------| .->|1|3|10|2|5|-. |1|3|10|2|5| |1|3|10|2|5| |1|3|10|2|5| | |----------| | |----------| |----------| |----------| | ^ ^ | ^ ^ ^ ^ ^ ^ ^ ^ "---------------" |----------| |----------| |----------| |----------| .->|1|3|10|2|5|-. |1|3|10|2|5| |1|3|10|2|5| |1|3|10|2|5| | |----------| | |----------| |----------| |----------| | ^ ^ ^ ^ | ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ "---------------" |----------| |----------| .->|1|3|10|2|5|-. |1|3|10|2|5| | |----------| | |----------| | ^ ^ ^ ^ | ^ ^ ^ ^ ^ "---------------"