User blog comment:Wythagoras/Dollars Function/@comment-1605058-20130802100310/@comment-80.101.234.232-20130802102049

Rule 3 is for anything: [...[b#]...] where [...[ contains only brackets. it uses the less nested number. So [a[b]] = [a-1[b]][a-1[b]]...[a-1[b]][a-1[b]]