ROSECODE 201
Balanced triangles
Starting with a sequence of signs + and -, we form a "pascal-like" triangle applying the following rules:
The following triangle is balanced:
Answer format : count,sequence of + and - without spaces.
PS : count is the number of sequences with that largest number of +.
For 7 signs, the anwser would be : 5,+++-++-
[My timing: 100 sec]
- the 1st row is the initial sequence
- each next row is built by combining each 2 consecutive signs from the previous row, with the classical rules ( + ⊗ + ⇒ +, + ⊗ - ⇒ - etc...)
- + - - - - + + - -Such a triangle is said balanced if it contains the same number of + and -.
The following triangle is balanced:
- + - + - - - + + +Find the number of sequences with 23 signs containing the largest number of + which produce a balanced triangle and give the last one (lexicographic order)
Answer format : count,sequence of + and - without spaces.
PS : count is the number of sequences with that largest number of +.
For 7 signs, the anwser would be : 5,+++-++-
[My timing: 100 sec]