User blog comment:Primussupremus/Ternary number./@comment-73.235.194.108-20170515155314

I made this ruleset for your notation:
 * [a,1,b] = a+b
 * [a,b,1] = a if b>1
 * [a,b,c] = [a,b-1,[a,b,c-1]] if b>1 and c>1
 * [a,b,c|1] = [a,b,c]
 * [a,b,c|d] = [a,[a,b,c|d-1],c] if d>1
 * [@ p,q+1] = [@ [@ p,q]] (@ is anything)
 * [@ p#q] = [@ p,p,...,p,p] with q p’s