|
EXAMPLE
|
The solution for a(5):
We look through the numbers step by step and if groups with the same sum are less than 2 terms apart they are put in brackets:
1,2,4,[1],[1?] - not possible
[1,2],4,[1,2?] - not possible
1,2,[4],[1,3?] - not possible
1,2,[4],1,[4?] - not possible
1,2,[4,1],[5?] - not possible
1,[2,4],1,[6?] - not possible
1,[2,4,1],[7?] - not possible
[1,2,4,1],[8?] - not possible
1,2,4,1,9?
There are no 2 sums which contradict the definition of this sequence with a(5) = 9, so this is the next term. In this case we knew it must be the solution because the upper bound of a(n) is always the sum of all previous terms + 1.
Another example for a(8) = 21:
1,2,4,1,9,2,[1],[1?] ; 1,2,4,1,9,[2],1,[2?] ; 1,2,4,1,9,[2,1],[3?]
1,[2,4,1],9,[2,1,4?] ; [1,2,4,1],9,[2,1,5?] ; 1,2,4,1,[9],[2,1,6?]
1,2,4,[1,9],[2,1,7?] ; 1,2,4,1,[9],2,[1,8?] ; 1,2,4,[1,9],2,[1,9?]
1,2,4,1,[9,2],[1,10?] ; 1,2,4,1,[9,2],1,[11?] ; 1,2,4,1,[9,2,1],[12?]
1,2,4,[1,9,2,1],[13?] ; [1,2,4,1,9],[2,1,14?] ; 1,2,[4,1,9,2],[1,15?]
1,2,[4,1,9,2],1,[16?] ; 1,2,[4,1,9,2,1],[17?] ; 1,[2,4,1,9,2],1,[18?]
1,[2,4,1,9,2,1],[19?] ; [1,2,4,1,9,2,1],[20?] ; 1,2,4,1,9,2,1,21?
-> a(8) = 21.
|