Find most stable combination of a vector with itself at different periods I receive a vector of varying length such as [0, 1, 2, 3, 2]. The value corresponds to the yield and its position to a time slot. Hence, at the first time slot the yield is zero, at the second period it is 1, etc.

I need a procedure that can combine this vector with itself at varying periods in order to ensure that the sum of the yields are the "most possibly" stable. Ideally it will be completely but I doubt that it is always possible.

I also need to make sure that it is indeed a periodic solution.

Below 2 examples that I solved by hand and a list of other example I don't know how to solve:

First one:

     [0, 1, 2, 3, 2]   [0, 1, 2, 3, 2]
           [0, 1, 2, 3, 2]   [0, 1, 2, 3, 2]
                 [0, 1, 2, 3, 2]   [0, 1, 2, 3, 2]
sum = 0  1  2  4  4  4  4  4  4  4  4  4...
In this example after an initialization period of length 3, we get a stable 
pattern with a yield of 4


Second one:

     [0, 0, 0, 1, 0, 1, 0, 1]            [0, 0, 0, 1, 0, 1, 0, 1]
        [0, 0, 0, 1, 0, 1, 0, 1]            [0, 0, 0, 1, 0, 1, 0, 1]
                       [0, 0, 0, 1, 0, 1, 0, 1]            [0, 0, 0, 1, 0, 1, 0, 1]
                          [0, 0, 0, 1, 0, 1, 0, 1]            [0, 0, 0, 1, 0, 1, 0, 1]
sum = 0  0  0  1  1  1  1  1  1  1  1  1  1  1  1  1  1...
In this example after an initialization period of length 3, we get a stable 
pattern with a yield of 1


However I could not find a pattern for the following vectors and I am searching for an algorithm that could identify the best pattern for any such one:

[0, 0, 2, 3, 2]
[0, 0, 2, 0, 3, 0, 4, 0, 2]


Precision 1: The vector will always start with at least a zero, but there can be many more, and it will always finish with a value above zero. 

Precision 2: The solution should be the shortest periodic design that allows a stable sum of yield. 

Retry at the problem specification: We have a production mean 'A' to grow plants. Each plant has specs as to how it grows, represented by a given vector as presented above. For a given 'A', once a plant production cycle is over, you can start a new one. We want to model a stable plant production with as few 'A' as possible.
Made up rule nr 1: Every number has to be part of the sum. Therefore the sum cannot be x, if there is a number b, such that no combination of numbers can add up to x-b.

So for [0, 0, 2, 3, 2]: 


the sum cannot be 2 (because 3 cannot be part of that)
it cannot be 3 (because 3 - 2 = 1 and there is no combination of numbers that add
up to 1 (rule 1))  
it cannot be 4 (because 4-3 = 1 again, (rule 1))
it cannot be 5 (because there are twice as many 2-s as 3-s)
it cannot be 6 (because in case of 3-s, only two rows in exactly the
same place can make up that number, and the 2-s would then form 4-s,
which cannot sum up to 6)


Therefore for the specific case of [0, 0, 2, 3, 2], the simplest solution is to have the value of 7

Perhaps this complicated reasoning helps to consider the future vectors as well :)

[0, 0, 2, 0, 3, 0, 4, 0, 2] is more difficult though. While not considering too thoroughly, it looks like for that as well, there isn't anything better than the trivial solution.

Trivial solution:

[a, b, c ....]
   [a, b, c ....]
      [a, b, c ....]
      ...