Encontre os números de colchete mais curtos

15

Os números de colchete fornecem uma maneira simples de expressar números inteiros grandes usando apenas colchete esquerdo, espaço e colchete direito ( [ ]).

Um número de colchete é definido como uma sequência de um ou mais pares de colchetes [...]chamados chunks , cada um separado dos vizinhos por zero ou mais espaços.

O número de espaços entre cada pedaço define a hiperoperação entre eles. Nenhum espaço significa adição, 1 espaço significa multiplicação, 2 espaços significa exponenciação, 3 espaços significa tetração e assim por diante. As hiperoperações de ordem superior têm precedência; portanto, a tetração ocorre antes da exponenciação, a exponenciação ocorre antes da multiplicação, etc. Elas também são associativas à direita, e a^b^csão computadas como a^(b^c). (Mas a^b*cainda é (a^b)*c.)

Cada pedaço pode estar vazio ( []) ou conter outro número de colchete. Os pedaços vazios têm o valor 0. Os pedaços não vazios têm o valor do seu número de colchete contido mais 1.

Exemplos: ( ^^é tetração, ^^^é pentação )

  • [[]]tem o valor 1 porque é 0 ( []) incrementado por 1
  • [[[]]]tem valor 2, mas o mesmo acontece [[]][[]]desde que os dois ( [[]]) são adicionados
  • [[[]]] [[[[]]] [[[[]]]]][[[]]] tem o valor 20 = (2 * ((2 ^ 3) +1)) + 2
  • [[[]]] [[[[]]]] tem o valor 65536 = 2 ^^^ 3 = 2 ^^ (2 ^^ 2) = 2 ^^ 4 == 2 ^ (2 ^ (2 ^ 2))
  • [[[[]]]] [[[]]] [[]] tem valor 7625597484987 = 3 ^^^ (2 ^^^ 1) = 3 ^^^ 2 = 3 ^^ 3 = 3 ^ (3 ^ 3)

Em números de colchete válidos:

  • Nunca haverá espaços à esquerda ou à direita.
  • Sempre haverá pelo menos um par de colchetes correspondentes.
  • Todos os colchetes esquerdos terão um colchete direito correspondente.
  • Um espaço nunca aparecerá diretamente à direita [ou à esquerda de ].
  • O valor é sempre um número inteiro não negativo.

Desafio

Observe que pode haver muitos formulários para um número de colchete que dão o mesmo valor. [[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]e [[[]]] [[[[]]]]ambos representam 16, mas o último é muito mais curto.

Seu desafio é escrever um algoritmo que tente encontrar a menor representação de número de colchete de um determinado valor. Por exemplo, acredito que a maneira mais curta de representar 16 é com 17 caracteres como [[[]]] [[[[]]]].

Pontuação (atualizada)

Seja S o conjunto de números inteiros de 1 a 256 (inclusive), além dos dez valores a seguir:

8191 13071 524287 2147483647 1449565302 1746268229 126528612 778085967 1553783038 997599288

(Os quatro primeiros são primos de Mersenne, o resto é aleatório.)

A submissão que gerar o menor conjunto de números de colchetes para tudo em S vencerá. Sua pontuação é a soma dos comprimentos dos números de colchetes para todos os valores em S ( quanto menor, melhor).

Com seu código, envie uma lista de seus números de colchete para todos os números S , a ordem exata não é muito importante. por exemplo:

1=[[]]
2=[[[]]]
3=[[[[]]]]
...
2147483647=[...]
...

(Eu sei que esse não é o método de pontuação ideal, mas não estou configurado para executar vários testes heurísticos aleatórios em cada envio. Desculpe :()

Regras

  • Você não pode codificar nenhum número de colchete além das soluções incrementais triviais ( [], [[]], [[[]]], ...). Seu programa deve realmente estar procurando representações otimamente curtas. (Embora os resultados possam ser abaixo do ideal.)
  • Seu algoritmo deve funcionar para todos os números inteiros não negativos abaixo de 2.147.483.648 (2 ^ 31). Você não pode se concentrar especificamente sobre os valores em S .
  • Para qualquer entrada em particular, seu algoritmo deve rodar no máximo 10 minutos em um computador moderno decente (~ processador de 2,5 Ghz, ~ 6 GB de RAM).
  • Na (aparentemente) rara chance de empate, a finalização mais votada vence.
  • Se você copiar outra solução ou revisá-la sem atribuição, será desqualificado.
Passatempos de Calvin
fonte
Eu acho que 256 pode ser um pouco baixo demais. Você nem chega muito longe com as hiperoperações nesses números. Mas posso estar errado, não consigo descobrir quantas possibilidades existem para representar 256 que não podem ser facilmente descartadas.
Martin Ender
@ MartinBüttner eu sei. Eu tinha considerado 512 ou 1024, mas estava preocupada em forçar as pessoas a enviar grandes blocos de texto para suas listas de números entre colchetes. O que alguém mais pensa?
Calvin's Hobbies
@ Calvin'sHobbies: Que tal pedir um número grande e selecionado além do 1..256? Digamos, o primo de Mersenne 2 ^ 31 - 1.
Charles
@ Calvin'sHobbies Escolha de 10 a 20 números maiores específicos, além do seu alcance?
hmatt1
9
Ok, nome de usuário atualizada .... Eu não quero que o meu mau comportamento a ser misattributed
Não que Charles

Respostas:

5

Python 11455b

Esta solução adota uma abordagem gananciosa para encontrar maneiras de quebrar os números primos, em vez de uma abordagem exaustiva. Preciso de 9875b para 1-256 em comparação com 8181 para a solução provavelmente ótima de Martin nesse espaço.

Uma tabela maior de resultados de multiplicação e exponenciação produz pequenas melhorias nos casos de teste maiores. A solução abaixo levou cerca de 7 minutos. Aumentar o tempo de execução além de 30 minutos tem um impacto mínimo na saída.

Eu, como Martin, tive um problema com precedência. Minha solução para restringir a seleção de operações pode não ser a ideal.

#!/usr/bin/env python

# http://codegolf.stackexchange.com/questions/35480/find-the-shortest-bracket-numbers

import sys, math

reps = {}
forwards = {}
backwards = {}

MAX = 2**31

TABLE_SIZE = 2**12

def op_dec(op):
    if op>1:
        return op-1
    return op

def rep_op(a,op,b):
    return rep_num(a) +  (" "*op) + rep_num(b)
def min_rep_op(a,op,b,op_max):
    return min_rep(a,op_max) +  (" "*op) + min_rep(b,op_dec(op_max))

def rep_num(a):
    return ("["*(a+1)) + ("]"*(a+1))

def min_rep(n,op_max):
    if n < 9:
        return ("["*(n+1))+("]"*(n+1))
    for op in range(op_max,-1,-1):
        if (n, op) in reps:
            return reps[(n, op)]
    for op in range(op_max,-1,-1):
        if (n, op) in backwards:
            a,op,b = backwards[(n, op)]
            return min_rep_op(a,op,b,op_max)
    else:
        for m in rep_list:
            c = m[0]
            if c < n:
                r = n - c
                for op in range(op_max,-1,-1):
                    if (c, op) in backwards:
                        a,op,b = backwards[(c, op)]
                        if r<10:
                            return ("["*r) + min_rep_op(a,op,b,op_max) + ("]"*r)
                        else:
                            return "[" + min_rep(r-1,op_max) + min_rep_op(a,op,b,op_max) + "]"
                break

def expand(a,op,b):
    if op == 0:
        n = a+b
    elif op == 1:
        n = a*b
    elif op == 2:
        if b*math.log10(a) > math.log10(MAX):
            n = MAX
        else: 
            n = a**b
    elif (a,op,b) in forwards:
        n = forwards[(a,op,b)]
    else: # tetration and higher
        t = a
        for i in xrange(b-1):
            t = expand(a,op-1,t)
            if t>=MAX:
                break
        n = t

    if n > MAX-1:
        n = MAX
    forwards[(a,op,b)] = n

    if (n, op) in backwards:
        c = len(rep_op(*backwards[(n, op)]))
        if c > (a*2+op+b*2):
            backwards[(n, op)] = (a,op,b)
    else:
        backwards[(n, op)] = (a,op,b)

    return n

t = 0

# populate the multiplication, exponentiation, and tetration tables
for op in range(1,4):
    for a in range((1,2,2,2)[op],TABLE_SIZE):
        for b in range((1,2,2,2)[op],TABLE_SIZE):
            t = expand(a,op,b)
            if t == MAX:
                break
rep_list = sorted(backwards.keys(),key=lambda x: x[0]*4-x[1],reverse=True)

for i in list(range(1, 257))+[8191,13071,524287,2147483647,1449565302,1746268229,126528612,778085967,1553783038,997599288]:
    t = min_rep(i,3)
    reps[i] = t
    print i, t

Resultado:

1 [[]]
2 [[[]]]
3 [[[[]]]]
4 [[[[[]]]]]
5 [[[[[[]]]]]]
6 [[[[[[[]]]]]]]
7 [[[[[[[[]]]]]]]]
8 [[[[[[[[[]]]]]]]]]
9 [[[[]]]]  [[[]]]
10 [[[[[[]]]]]] [[[]]]
11 [[[[[[[]]]]]] [[[]]]]
12 [[[[[[[]]]]]]] [[[]]]
13 [[[[[[[[]]]]]]] [[[]]]]
14 [[[[[[[[]]]]]]]] [[[]]]
15 [[[[[[]]]]]] [[[[]]]]
16 [[[]]]   [[[[]]]]
17 [[[[]]]   [[[[]]]]]
18 [[[[[[[]]]]]]] [[[[]]]]
19 [[[[[[[[]]]]]]] [[[[]]]]]
20 [[[[[[]]]]]] [[[[[]]]]]
21 [[[[[[[[]]]]]]]] [[[[]]]]
22 [[[[[[[]]]]]] [[[]]]] [[[]]]
23 [[[[[[[[]]]]]] [[[]]]] [[[]]]]
24 [[[[[[[[[]]]]]]]]] [[[[]]]]
25 [[[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[[[[]]]]]]]] [[[]]]
87 [[[[[[[[[]]]]]]]] [[[[[]]]]]] [[[[]]]]
88 [[[[[[[]]]]]] [[[]]]] [[[[[[[[[]]]]]]]]]
89 [[[[[[[[]]]]]] [[[]]]] [[[[[[[[[]]]]]]]]]]
90 [[[[[[]]]]]] [[[]]] [[[[]]]]  [[[]]]
91 [[[[[[[[]]]]]]] [[[]]]] [[[[[[[[]]]]]]]]
92 [[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[[[]]]]]
93 [[[[[[[[]]]]]]] [[[[[[]]]]]]] [[[[]]]]
94 [[[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[]]]] [[[]]]
95 [[[[[[[[]]]]]]] [[[[]]]]] [[[[[[]]]]]]
96 [[[[[[[]]]]]]] [[[]]] [[[[[[[[[]]]]]]]]]
97 [[[[[[[[]]]]]]] [[[]]] [[[[[[[[[]]]]]]]]]]
98 [[[[[[[[]]]]]]]] [[[]]] [[[[[[[[]]]]]]]]
99 [[[[[[[]]]]]] [[[]]]] [[[[]]]]  [[[]]]
100 [[[[[[]]]]]] [[[]]]  [[[]]]
101 [[[[[[[]]]]]] [[[]]]  [[[]]]]
102 [[[[]]]   [[[[]]]]] [[[[[[[]]]]]]]
103 [[[[[]]]   [[[[]]]]] [[[[[[[]]]]]]]]
104 [[[[[[[[]]]]]]] [[[]]]] [[[[[[[[[]]]]]]]]]
105 [[[[[[]]]]]] [[[[]]]] [[[[[[[[]]]]]]]]
106 [[[[[[[[[]]]]]]] [[[]]]] [[[[[]]]]]] [[[]]]
107 [[[[[[[[[[]]]]]]] [[[]]]] [[[[[]]]]]] [[[]]]]
108 [[[[[[[]]]]]]] [[[]]] [[[[]]]]  [[[]]]
109 [[[[[[[[]]]]]]] [[[]]] [[[[]]]]  [[[]]]]
110 [[[[[[[]]]]]] [[[]]]] [[[[[[]]]]]] [[[]]]
111 [[[[[[[[]]]]]]]  [[[]]]] [[[[]]]]
112 [[[]]]   [[[[]]]] [[[[[[[[]]]]]]]]
113 [[[[]]]   [[[[]]]] [[[[[[[[]]]]]]]]]
114 [[[[[[[[]]]]]]] [[[[]]]]] [[[[[[[]]]]]]]
115 [[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[[[[]]]]]]
116 [[[[[[[[[]]]]]]]] [[[[[]]]]]] [[[[[]]]]]
117 [[[[[[[[]]]]]]] [[[]]]] [[[[]]]]  [[[]]]
118 [[[[[[[[[[]]]]]]]] [[[[[]]]]]] [[[]]]] [[[]]]
119 [[[[]]]   [[[[]]]]] [[[[[[[[]]]]]]]]
120 [[[[[[]]]]]] [[[[]]]] [[[[[[[[[]]]]]]]]]
121 [[[[[[[]]]]]] [[[]]]]  [[[]]]
122 [[[[[[[[]]]]]]] [[[]]] [[[[[[]]]]]]] [[[]]]
123 [[[[[[[]]]]]] [[[]]] [[[[[]]]]]] [[[[]]]]
124 [[[[[[[[]]]]]]] [[[[[[]]]]]]] [[[[[]]]]]
125 [[[[[[]]]]]]  [[[[]]]]
126 [[[[[[[[]]]]]]]] [[[]]] [[[[]]]]  [[[]]]
127 [[[[[[[[[]]]]]]]] [[[]]] [[[[]]]]  [[[]]]]
128 [[[]]]  [[[[[[[[]]]]]]]]
129 [[[[[[[[[]]]]]]]] [[[[[[[]]]]]]]] [[[[]]]]
130 [[[[[[[[]]]]]]] [[[]]]] [[[[[[]]]]]] [[[]]]
131 [[[[[[[[[]]]]]]] [[[]]]] [[[[[[]]]]]] [[[]]]]
132 [[[[[[[]]]]]]] [[[]]] [[[[[[[]]]]]] [[[]]]]
133 [[[[[[[[]]]]]]] [[[[]]]]] [[[[[[[[]]]]]]]]
134 [[[[[[[[]]]]]] [[[]]]] [[[[[[[]]]]]]]] [[[]]]
135 [[[[[[]]]]]] [[[[]]]] [[[[]]]]  [[[]]]
136 [[[[]]]   [[[[]]]]] [[[[[[[[[]]]]]]]]]
137 [[[[[]]]   [[[[]]]]] [[[[[[[[[]]]]]]]]]]
138 [[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[[[[[]]]]]]]
139 [[[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[[[[[]]]]]]]]
140 [[[[[[[[]]]]]]]] [[[]]] [[[[[[]]]]]] [[[]]]
141 [[[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[]]]] [[[[]]]]
142 [[[[[[[]]]]]] [[[]]] [[[[[[[[]]]]]]]]] [[[]]]
143 [[[[[[[[]]]]]]] [[[]]]] [[[[[[[]]]]]] [[[]]]]
144 [[[[[[[]]]]]]] [[[]]]  [[[]]]
145 [[[[[[[[[]]]]]]]] [[[[[]]]]]] [[[[[[]]]]]]
146 [[[[[[[[]]]]]]] [[[]]] [[[[[[[]]]]]]]] [[[]]]
147 [[[[[[[[]]]]]]]] [[[[]]]] [[[[[[[[]]]]]]]]
148 [[[[[[[[]]]]]]]  [[[]]]] [[[[[]]]]]
149 [[[[[[[[[]]]]]]]  [[[]]]] [[[[[]]]]]]
150 [[[[[[]]]]]] [[[[]]]] [[[[[[]]]]]] [[[]]]
151 [[[[[[[]]]]]] [[[[]]]] [[[[[[]]]]]] [[[]]]]
152 [[[[[[[[]]]]]]] [[[[]]]]] [[[[[[[[[]]]]]]]]]
153 [[[[]]]   [[[[]]]]] [[[[]]]]  [[[]]]
154 [[[[[[[[]]]]]]]] [[[]]] [[[[[[[]]]]]] [[[]]]]
155 [[[[[[[[]]]]]]] [[[[[[]]]]]]] [[[[[[]]]]]]
156 [[[[[[[[]]]]]]] [[[]]]] [[[[[[[]]]]]]] [[[]]]
157 [[[[[[[[[]]]]]]] [[[]]]] [[[[[[[]]]]]]] [[[]]]]
158 [[[[[[[[[]]]]]]] [[[]]]] [[[[[[[]]]]]]]] [[[]]]
159 [[[[[[[[[]]]]]]] [[[]]]] [[[[[]]]]]] [[[[]]]]
160 [[[]]]   [[[[]]]] [[[[[[]]]]]] [[[]]]
161 [[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[[[[[[]]]]]]]]
162 [[[[[[[]]]]]]] [[[[]]]] [[[[]]]]  [[[]]]
163 [[[[[[[[]]]]]]] [[[[]]]] [[[[]]]]  [[[]]]]
164 [[[[[[[]]]]]] [[[]]] [[[[[]]]]]] [[[[[]]]]]
165 [[[[[[]]]]]] [[[[]]]] [[[[[[[]]]]]] [[[]]]]
166 [[[[[[[[]]]]]] [[[]]] [[[[[]]]]]] [[[]]]] [[[]]]
167 [[[[[[[[[]]]]]] [[[]]] [[[[[]]]]]] [[[]]]] [[[]]]]
168 [[[[[[[[]]]]]]]] [[[]]] [[[[[[[]]]]]]] [[[]]]
169 [[[[[[[[]]]]]]] [[[]]]]  [[[]]]
170 [[[[]]]   [[[[]]]]] [[[[[[]]]]]] [[[]]]
171 [[[[[[[[]]]]]]] [[[[]]]]] [[[[]]]]  [[[]]]
172 [[[[[[[[[]]]]]]]] [[[[[[[]]]]]]]] [[[[[]]]]]
173 [[[[[[[[[[]]]]]]]] [[[[[[[]]]]]]]] [[[[[]]]]]]
174 [[[[[[[[[]]]]]]]] [[[[[]]]]]] [[[[[[[]]]]]]]
175 [[[[[[]]]]]]  [[[]]] [[[[[[[[]]]]]]]]
176 [[[]]]   [[[[]]]] [[[[[[[]]]]]] [[[]]]]
177 [[[[[[[[[[]]]]]]]] [[[[[]]]]]] [[[]]]] [[[[]]]]
178 [[[[[[[[]]]]]] [[[]]]] [[[[[[[[[]]]]]]]]]] [[[]]]
179 [[[[[[[[[]]]]]] [[[]]]] [[[[[[[[[]]]]]]]]]] [[[]]]]
180 [[[[[[]]]]]] [[[[[]]]]] [[[[]]]]  [[[]]]
181 [[[[[[[]]]]]] [[[[[]]]]] [[[[]]]]  [[[]]]]
182 [[[[[[[[]]]]]]]] [[[]]] [[[[[[[[]]]]]]] [[[]]]]
183 [[[[[[[[]]]]]]] [[[]]] [[[[[[]]]]]]] [[[[]]]]
184 [[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[[[[[[[]]]]]]]]]
185 [[[[[[[[]]]]]]]  [[[]]]] [[[[[[]]]]]]
186 [[[[[[[[]]]]]]] [[[[[[]]]]]]] [[[[[[[]]]]]]]
187 [[[[]]]   [[[[]]]]] [[[[[[[]]]]]] [[[]]]]
188 [[[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[]]]] [[[[[]]]]]
189 [[[[[[[[]]]]]]]] [[[[]]]] [[[[]]]]  [[[]]]
190 [[[[[[[[]]]]]]] [[[[]]]]] [[[[[[]]]]]] [[[]]]
191 [[[[[[[[[]]]]]]] [[[[]]]]] [[[[[[]]]]]] [[[]]]]
192 [[[]]]   [[[[]]]] [[[[[[[]]]]]]] [[[]]]
193 [[[[]]]   [[[[]]]] [[[[[[[]]]]]]] [[[]]]]
194 [[[[[[[[]]]]]]] [[[]]] [[[[[[[[[]]]]]]]]]] [[[]]]
195 [[[[[[]]]]]] [[[[]]]] [[[[[[[[]]]]]]] [[[]]]]
196 [[[[[[[[]]]]]]]] [[[]]]  [[[]]]
197 [[[[[[[[[]]]]]]]] [[[]]]  [[[]]]]
198 [[[[[[[]]]]]]] [[[[]]]] [[[[[[[]]]]]] [[[]]]]
199 [[[[[[[[]]]]]]] [[[[]]]] [[[[[[[]]]]]] [[[]]]]]
200 [[[[[[]]]]]] [[[[[]]]]] [[[[[[]]]]]] [[[]]]
201 [[[[[[[[]]]]]] [[[]]]] [[[[[[[]]]]]]]] [[[[]]]]
202 [[[[[[[]]]]]] [[[]]]  [[[]]]] [[[]]]
203 [[[[[[[[[]]]]]]]] [[[[[]]]]]] [[[[[[[[]]]]]]]]
204 [[[[]]]   [[[[]]]]] [[[[[[[]]]]]]] [[[]]]
205 [[[[[[[]]]]]] [[[]]] [[[[[]]]]]] [[[[[[]]]]]]
206 [[[[[]]]   [[[[]]]]] [[[[[[[]]]]]]]] [[[]]]
207 [[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[[]]]]  [[[]]]
208 [[[]]]   [[[[]]]] [[[[[[[[]]]]]]] [[[]]]]
209 [[[[[[[[]]]]]]] [[[[]]]]] [[[[[[[]]]]]] [[[]]]]
210 [[[[[[]]]]]] [[[[]]]] [[[[[[[[]]]]]]]] [[[]]]
211 [[[[[[[]]]]]] [[[[]]]] [[[[[[[[]]]]]]]] [[[]]]]
212 [[[[[[[[[]]]]]]] [[[]]]] [[[[[]]]]]] [[[[[]]]]]
213 [[[[[[[]]]]]] [[[]]] [[[[[[[[]]]]]]]]] [[[[]]]]
214 [[[[[[[[[[]]]]]]] [[[]]]] [[[[[]]]]]] [[[]]]] [[[]]]
215 [[[[[[[[[]]]]]]]] [[[[[[[]]]]]]]] [[[[[[]]]]]]
216 [[[[[[[]]]]]]]  [[[[]]]]
217 [[[[[[[[]]]]]]] [[[[[[]]]]]]] [[[[[[[[]]]]]]]]
218 [[[[[[[[]]]]]]] [[[]]] [[[[]]]]  [[[]]]] [[[]]]
219 [[[[[[[[]]]]]]] [[[]]] [[[[[[[]]]]]]]] [[[[]]]]
220 [[[[[[[]]]]]] [[[]]]] [[[]]] [[[[[[]]]]]] [[[]]]
221 [[[[]]]   [[[[]]]]] [[[[[[[[]]]]]]] [[[]]]]
222 [[[[[[[[]]]]]]]  [[[]]]] [[[[[[[]]]]]]]
223 [[[[[[[[[]]]]]]]  [[[]]]] [[[[[[[]]]]]]]]
224 [[[]]]   [[[[]]]] [[[[[[[[]]]]]]]] [[[]]]
225 [[[[[[]]]]]] [[[[]]]]  [[[]]]
226 [[[[]]]   [[[[]]]] [[[[[[[[]]]]]]]]] [[[]]]
227 [[[[[]]]   [[[[]]]] [[[[[[[[]]]]]]]]] [[[]]]]
228 [[[[[[[[]]]]]]] [[[[]]]]] [[[[[[[]]]]]]] [[[]]]
229 [[[[[[[[[]]]]]]] [[[[]]]]] [[[[[[[]]]]]]] [[[]]]]
230 [[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[[[[]]]]]] [[[]]]
231 [[[[[[[[]]]]]]]] [[[[]]]] [[[[[[[]]]]]] [[[]]]]
232 [[[[[[[[[]]]]]]]] [[[[[]]]]]] [[[[[[[[[]]]]]]]]]
233 [[[[[[[[[[]]]]]]]] [[[[[]]]]]] [[[[[[[[[]]]]]]]]]]
234 [[[[[[[]]]]]]] [[[[]]]] [[[[[[[[]]]]]]] [[[]]]]
235 [[[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[]]]] [[[[[[]]]]]]
236 [[[[[[[[[[]]]]]]]] [[[[[]]]]]] [[[]]]] [[[[[]]]]]
237 [[[[[[[[[]]]]]]] [[[]]]] [[[[[[[]]]]]]]] [[[[]]]]
238 [[[[]]]   [[[[]]]]] [[[[[[[[]]]]]]]] [[[]]]
239 [[[[[]]]   [[[[]]]]] [[[[[[[[]]]]]]]] [[[]]]]
240 [[[[[[]]]]]] [[[[[]]]]] [[[[[[[]]]]]]] [[[]]]
241 [[[[[[[]]]]]] [[[[[]]]]] [[[[[[[]]]]]]] [[[]]]]
242 [[[[[[[]]]]]] [[[]]]] [[[]]] [[[[[[[]]]]]] [[[]]]]
243 [[[[]]]]  [[[[[[]]]]]]
244 [[[[[[[[]]]]]]] [[[]]] [[[[[[]]]]]]] [[[[[]]]]]
245 [[[[[[[[]]]]]]]] [[[[[[]]]]]] [[[[[[[[]]]]]]]]
246 [[[[[[[]]]]]] [[[]]] [[[[[]]]]]] [[[[[[[]]]]]]]
247 [[[[[[[[]]]]]]] [[[[]]]]] [[[[[[[[]]]]]]] [[[]]]]
248 [[[[[[[[]]]]]]] [[[[[[]]]]]]] [[[[[[[[[]]]]]]]]]
249 [[[[[[[[]]]]]] [[[]]] [[[[[]]]]]] [[[]]]] [[[[]]]]
250 [[[[[[]]]]]]  [[[]]] [[[[[[]]]]]] [[[]]]
251 [[[[[[[]]]]]]  [[[]]] [[[[[[]]]]]] [[[]]]]
252 [[[[[[[[]]]]]]]] [[[[]]]] [[[[[[[]]]]]]] [[[]]]
253 [[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[[[[[]]]]]] [[[]]]]
254 [[[[[[[[[]]]]]]]] [[[]]] [[[[]]]]  [[[]]]] [[[]]]
255 [[[[]]]   [[[[]]]]] [[[[[[]]]]]] [[[[]]]]
256 [[[[[]]]]]   [[[]]]
8191 [[[[[[[[[]]]]]]] [[[]]]] [[[[[[[[]]]]]]]] [[[[[[]]]]]] [[[]]] [[[[]]]] [[[[]]]]]
13071 [[[[[[[[[[[]]]]]]] [[[[]]]] [[[[]]]]  [[[]]]] [[[[[]]]]]] [[[]]]] [[[[[[]]]]]] [[[]]]]
524287 [[[[[[[[[]]]]]]] [[[[]]]]] [[[]]] [[[[[[[[]]]]]]]] [[[[]]]] [[[[[[[[]]]]]]] [[[]]] [[[[[[[]]]]]]]] [[[[]]]] [[[[]]]]]
2147483647 [[[[[[[[[[[]]]]]]]]] [[[[]]]] [[[[[[[[]]]]]]]] [[[]]]] [[[[]]]] [[[[[[[[[]]]]]]] [[[]]]] [[[[[[]]]]]] [[[]]]] [[[[[[[]]]]]]][[[[[[[[[]]]]]]]] [[[[[[[]]]]]]]] [[[[[[[]]]]]]] [[[[[[]]]]]]  [[[[]]]]]
1449565302 [[[[[[[[[[[[[]]]]]]]] [[[]]] [[[[]]]]  [[[]]]] [[[[[]]]]]] [[[]]]] [[[]]]] [[[[[[[[[]]]]]] [[[]]]] [[[]]]] [[[[[[[]]]]]]]] [[[[[[]]]]]] [[[]]][[[[[[[[]]]]]]] [[[]]]] [[[[]]]] [[[[[[[[[]]]]]]]] [[[[[]]]]]]  [[[[]]]]]
1746268229 [[[[[[[[[[]]]]]] [[[]]]] [[[[[[[]]]]]]]] [[[[]]]  [[[[[]]]]]] [[[[[[[[[]]]]]]]] [[[[[[[]]]]]]]] [[[[[[[[]]]]]]] [[[[]]]]]][[[[[[[[[]]]]]]]] [[[[[[[]]]]]]]] [[[[[[[[]]]]]]]] [[[[[]]]]]  [[[[]]]]]
126528612 [[[[[[[[[[[]]]]]] [[[]]]] [[[[[[[]]]]]]]] [[[[[]]]]]] [[[[[[[]]]]]]] [[[]]]] [[[[[[[[]]]]]]]][[[[[[[]]]]]]  [[[]]] [[[[[[]]]]]] [[[]]]] [[[]]]  [[[[]]]]]
778085967 [[[[[[[[[[]]]]]]]] [[[[[[[]]]]]]] [[[[[[[[]]]]]]] [[[]]]] [[[]]]] [[[[[[[[[]]]]]]] [[[]]]] [[[[[]]]]]] [[[[[[]]]]]][[[[[[[[[]]]]]] [[[]]] [[[[[]]]]]] [[[]]]] [[[]]]]  [[[[[]]]]]]
1553783038 [[[[[[[[[]]]]]]] [[[]]]] [[[[]]]] [[[[[[]]]]]]  [[[]]] [[[[[[[[[]]]]]]] [[[]]] [[[[[[[[[]]]]]]]]]] [[[[[[]]]]]] [[[]]]][[[[]]]   [[[[]]]] [[[[[[[]]]]]]] [[[]]]] [[[[[[[]]]]]]]  [[[[]]]]]
997599288 [[[[[[[[]]]]]] [[[]]]] [[[[[[[[]]]]]]]] [[[[[[[]]]]]] [[[]]]] [[[]]]  [[[[[[]]]]]] [[[[[[[]]]]]] [[[]]]] [[[]]][[[[[[[[]]]]]]]  [[[]]]] [[[[]]]]  [[[[]]]]  [[[[]]]]]
Sparr
fonte
7

Mathematica

Nota: Esse algoritmo nunca poderá chegar nem perto dos números de teste maiores. Eu precisaria de uma abordagem substancialmente diferente, portanto, deixarei como está para outros verificarem seus números mais baixos. Você pode considerar este envio inválido.

Aqui está um começo para os primeiros 256 números (os outros foram adicionados depois que eu comecei, e provavelmente preciso encontrar uma solução separada para eles)

1=[[]]
2=[[[]]]
3=[[[[]]]]
4=[[[[[]]]]]
5=[[[[[[]]]]]]
6=[[[[[[[]]]]]]]
7=[[[[[[[[]]]]]]]]
8=[[[]]]  [[[[]]]]
9=[[[[]]]]  [[[]]]
10=[[[[[]]]]  [[[]]]]
11=[[[[[[]]]]  [[[]]]]]
12=[[[[[]]]]] [[[[]]]]
13=[[[[[[]]]]] [[[[]]]]]
14=[[[[[[[]]]]] [[[[]]]]]]
15=[[[[[[]]]]]] [[[[]]]]
16=[[[]]]   [[[[]]]]
17=[[[[]]]   [[[[]]]]]
18=[[[[[]]]   [[[[]]]]]]
19=[[[[[[]]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[[[[[[[]]]]   [[[]]]]]] [[[[]]]]]
92=[[[[[[[[[]]]]   [[[]]]]]] [[[[]]]]]]
93=[[[[[[[[]]]]   [[[]]]]]]] [[[[]]]]
94=[[[[[[[[[]]]]   [[[]]]]]]] [[[[]]]]]
95=[[[[[[]]]   [[[[]]]]]]] [[[[[[]]]]]]
96=[[[]]]  [[[[[[]]]]]] [[[[]]]]
97=[[[[]]]  [[[[[[]]]]]] [[[[]]]]]
98=[[[[[[[[]]]]]]]]  [[[]]] [[[]]]
99=[[[[]]]  [[[[[[]]]]]]] [[[[]]]]
100=[[[[[]]]]  [[[]]]]  [[[]]]
101=[[[[[[]]]]  [[[]]]]  [[[]]]]
102=[[[[[[[]]]]  [[[]]]]  [[[]]]]]
103=[[[[[[[[]]]]  [[[]]]]  [[[]]]]]]
104=[[[[[[[]]]]]]  [[[]]]] [[[[[]]]]]
105=[[[[[[[[]]]]]]  [[[]]]] [[[[[]]]]]]
106=[[[[[[[[[]]]]]]  [[[]]]] [[[[[]]]]]]]
107=[[[[[[[[[[]]]]]]  [[[]]]] [[[[[]]]]]]]]
108=[[[[]]]]   [[[]]] [[[[[]]]]]
109=[[[[[]]]]   [[[]]] [[[[[]]]]]]
110=[[[[[[]]]]   [[[]]] [[[[[]]]]]]]
111=[[[[[[[[]]]]]]]  [[[]]]] [[[[]]]]
112=[[[[[]]]]   [[[]]]] [[[[[]]]]]
113=[[[[[[]]]]   [[[]]]] [[[[[]]]]]]
114=[[[[[[[]]]]   [[[]]]] [[[[[]]]]]]]
115=[[[[[[[[]]]]   [[[]]]] [[[[[]]]]]]]]
116=[[[[[[]]]]   [[[]]]]] [[[[[]]]]]
117=[[[[[[[]]]]   [[[]]]]] [[[[[]]]]]]
118=[[[[[[[[]]]]   [[[]]]]] [[[[[]]]]]]]
119=[[[[]]]   [[[[]]]]] [[[[[[[[]]]]]]]]
120=[[[[[[[]]]]   [[[]]]]]] [[[[[]]]]]
121=[[[[[[]]]]  [[[]]]]]  [[[]]]
122=[[[[[[[]]]]  [[[]]]]]  [[[]]]]
123=[[[[[[[[]]]]  [[[]]]]]  [[[]]]]]
124=[[[[[[[[[]]]]  [[[]]]]]  [[[]]]]]]
125=[[[[[[]]]]]]  [[[[]]]]
126=[[[[[[[]]]]]]  [[[[]]]]]
127=[[[[[[[[]]]]]]  [[[[]]]]]]
128=[[[]]]  [[[[[[[[]]]]]]]]
129=[[[[]]]  [[[[[[[[]]]]]]]]]
130=[[[[[]]]  [[[[[[[[]]]]]]]]]]
131=[[[[[[]]]  [[[[[[[[]]]]]]]]]]]
132=[[[[[[[]]]]]  [[[[]]]]]] [[[]]]
133=[[[[[[[[]]]]]  [[[[]]]]]] [[[]]]]
134=[[[[[[[[]]]]]  [[[[]]]]]]] [[[]]]
135=[[[[]]]]   [[[]]] [[[[[[]]]]]]
136=[[[[[]]]]   [[[]]] [[[[[[]]]]]]]
137=[[[[[[]]]]   [[[]]] [[[[[[]]]]]]]]
138=[[[[[[[]]]]   [[[]]] [[[[[[]]]]]]]]]
139=[[[[[[[[]]]]   [[[]]] [[[[[[]]]]]]]]]]
140=[[[[[]]]]   [[[]]]] [[[[[[]]]]]]
141=[[[[[[]]]]   [[[]]]] [[[[[[]]]]]]]
142=[[[[[[[]]]]   [[[]]]] [[[[[[]]]]]]]]
143=[[[[[[[[]]]]   [[[]]]] [[[[[[]]]]]]]]]
144=[[[[[[[]]]]]]]  [[[]]] [[[[[]]]]]
145=[[[[[[]]]]   [[[]]]]] [[[[[[]]]]]]
146=[[[[[[[]]]]   [[[]]]]] [[[[[[]]]]]]]
147=[[[[[[[[]]]]]]]]  [[[]]] [[[[]]]]
148=[[[[[[[[[]]]]]]]]  [[[]]] [[[[]]]]]
149=[[[[[[[[[[]]]]]]]]  [[[]]] [[[[]]]]]]
150=[[[[[[]]]]]]  [[[]]] [[[[[[[]]]]]]]
151=[[[[[[[]]]]]]  [[[]]] [[[[[[[]]]]]]]]
152=[[[[[[[[[]]]]]]]  [[[]]]]] [[[[[]]]]]
153=[[[[]]]   [[[[]]]]] [[[[]]]]  [[[]]]
154=[[[[[]]]   [[[[]]]]] [[[[]]]]  [[[]]]]
155=[[[[[[[[]]]]   [[[]]]]]]] [[[[[[]]]]]]
156=[[[[[[[]]]]]]  [[[]]]] [[[[[[[]]]]]]]
157=[[[[[[[[]]]]]]  [[[]]]] [[[[[[[]]]]]]]]
158=[[[[[[[[]]]]]]  [[[]]]] [[[[]]]]] [[[]]]
159=[[[[[[[[]]]]]]  [[[]]]] [[[]]]] [[[[]]]]
160=[[[]]]  [[[[[[]]]]]] [[[[[[]]]]]]
161=[[[[]]]  [[[[[[]]]]]] [[[[[[]]]]]]]
162=[[[[]]]]  [[[[[]]]]] [[[]]]
163=[[[[[]]]]  [[[[[]]]]] [[[]]]]
164=[[[[[]]]]  [[[[[]]]]]] [[[]]]
165=[[[[[[]]]]  [[[[[]]]]]] [[[]]]]
166=[[[[[[]]]]  [[[[[]]]]]]] [[[]]]
167=[[[[[[[]]]]  [[[[[]]]]]]] [[[]]]]
168=[[[[[[[]]]]  [[[[[]]]]]]]] [[[]]]
169=[[[[[[]]]]] [[[[]]]]]  [[[]]]
170=[[[[[[[]]]]] [[[[]]]]]  [[[]]]]
171=[[[[[[[[]]]]] [[[[]]]]]  [[[]]]]]
172=[[[[[[[[[]]]]] [[[[]]]]]  [[[]]]]]]
173=[[[[[[[[[[]]]]] [[[[]]]]]  [[[]]]]]]]
174=[[[[[[]]]]   [[[]]]]] [[[[[[[]]]]]]]
175=[[[[[[]]]]]]  [[[]]] [[[[[[[[]]]]]]]]
176=[[[]]]   [[[[]]]] [[[[[[]]]]  [[[]]]]]
177=[[[[[[[]]]]   [[[]]]]] [[[]]]] [[[[]]]]
178=[[[[[[[[]]]]   [[[]]]]] [[[]]]] [[[[]]]]]
179=[[[[[[[[[]]]]   [[[]]]]] [[[]]]] [[[[]]]]]]
180=[[[[[[[]]]]]]]  [[[]]] [[[[[[]]]]]]
181=[[[[[[[[]]]]]]]  [[[]]] [[[[[[]]]]]]]
182=[[[[[[[[[]]]]]]]  [[[]]] [[[[[[]]]]]]]]
183=[[[[[[[[[[]]]]]]]  [[[]]] [[[[[[]]]]]]]]]
184=[[[[[]]]]  [[[]]] [[[[[[]]]]]]] [[[[[]]]]]
185=[[[[[[[[]]]]]]]  [[[]]]] [[[[[[]]]]]]
186=[[[[[[[[[]]]]]]]  [[[]]]] [[[[[[]]]]]]]
187=[[[[]]]   [[[[]]]]] [[[[[[]]]]  [[[]]]]]
188=[[[[[]]]   [[[[]]]]] [[[[[[]]]]  [[[]]]]]]
189=[[[[]]]]   [[[]]] [[[[[[[[]]]]]]]]
190=[[[[[]]]]   [[[]]] [[[[[[[[]]]]]]]]]
191=[[[[[[]]]]   [[[]]] [[[[[[[[]]]]]]]]]]
192=[[[[[]]]]]  [[[[]]]] [[[[]]]]
193=[[[[[[]]]]]  [[[[]]]] [[[[]]]]]
194=[[[[[[[]]]]]  [[[[]]]] [[[[]]]]]]
195=[[[[[[]]]]]  [[[[]]]]] [[[[]]]]
196=[[[[[[[]]]]] [[[[]]]]]]  [[[]]]
197=[[[[[[[[]]]]] [[[[]]]]]]  [[[]]]]
198=[[[[[[[]]]]]  [[[[]]]]]] [[[[]]]]
199=[[[[[[[[]]]]]  [[[[]]]]]] [[[[]]]]]
200=[[[[[]]]]  [[[]]]]  [[[]]] [[[]]]
201=[[[[[[]]]]  [[[]]]]  [[[]]] [[[]]]]
202=[[[[[[]]]]  [[[]]]]  [[[]]]] [[[]]]
203=[[[[[[[]]]]  [[[]]]]  [[[]]]] [[[]]]]
204=[[[[[[[[[]]]]]  [[[[]]]]]]]] [[[[]]]]
205=[[[[[[[[[[]]]]]  [[[[]]]]]]]] [[[[]]]]]
206=[[[[[[[[]]]]  [[[]]]]  [[[]]]]]] [[[]]]
207=[[[[[[[[[[]]]]]  [[[[]]]]]]]]] [[[[]]]]
208=[[[]]]   [[[[]]]] [[[[[[]]]]] [[[[]]]]]
209=[[[[]]]   [[[[]]]] [[[[[[]]]]] [[[[]]]]]]
210=[[[[[[[]]]]   [[[]]]]]] [[[[[[[[]]]]]]]]
211=[[[[[[[[]]]]   [[[]]]]]] [[[[[[[[]]]]]]]]]
212=[[[[[[[[]]]]]]  [[[]]]] [[[]]]] [[[[[]]]]]
213=[[[[[[[[[[[[]]]]]  [[[[]]]]]]]]]]] [[[[]]]]
214=[[[[[[[[[[[[[]]]]]  [[[[]]]]]]]]]]] [[[[]]]]]
215=[[[[[[[[[]]]]]]]] [[[[[[[]]]]]]]] [[[[[[]]]]]]
216=[[[[[[[]]]]]]]  [[[[]]]]
217=[[[[[[[[]]]]]]]  [[[[]]]]]
218=[[[[[[[[[]]]]]]]  [[[[]]]]]]
219=[[[[[[[[[[]]]]]]]  [[[[]]]]]]]
220=[[[[[[[[[[[]]]]]]]  [[[[]]]]]]]]
221=[[[[[[[[[[[[]]]]]]]  [[[[]]]]]]]]]
222=[[[[[[[[[[[[[]]]]]]]  [[[[]]]]]]]]]]
223=[[[[[[[[[[[[[[]]]]]]]  [[[[]]]]]]]]]]]
224=[[[[[]]]]   [[[]]]] [[[]]]  [[[[]]]]
225=[[[[[[]]]]]]  [[[]]] [[[[]]]]  [[[]]]
226=[[[[[[[]]]]]]  [[[]]] [[[[]]]]  [[[]]]]
227=[[[[[[[[]]]]]]  [[[]]] [[[[]]]]  [[[]]]]]
228=[[[[[[]]]]   [[[]]]] [[[]]]] [[[[[]]]]]
229=[[[[[[[]]]]   [[[]]]] [[[]]]] [[[[[]]]]]]
230=[[[[[[[[]]]]   [[[]]]] [[[]]]] [[[[[]]]]]]]
231=[[[[]]]  [[[[[[]]]]]]] [[[[[[[[]]]]]]]]
232=[[[[[[]]]]   [[[]]]]] [[[]]]  [[[[]]]]
233=[[[[[[[]]]]   [[[]]]]] [[[]]]  [[[[]]]]]
234=[[[[[[[]]]]]]  [[[]]]] [[[[]]]]  [[[]]]
235=[[[[[[[[]]]]]]  [[[]]]] [[[[]]]]  [[[]]]]
236=[[[[[[[]]]]   [[[]]]]] [[[]]]] [[[[[]]]]]
237=[[[[[[[[]]]]]]  [[[]]]] [[[[]]]]] [[[[]]]]
238=[[[[[]]]  [[[[[[]]]]]]]] [[[[[[[[]]]]]]]]
239=[[[[[[]]]  [[[[[[]]]]]]]] [[[[[[[[]]]]]]]]]
240=[[[]]]   [[[[]]]] [[[[[[]]]]]] [[[[]]]]
241=[[[[]]]   [[[[]]]] [[[[[[]]]]]] [[[[]]]]]
242=[[[[[[]]]]  [[[]]]]]  [[[]]] [[[]]]
243=[[[[]]]]  [[[[[[]]]]]]
244=[[[[[]]]]  [[[[[[]]]]]]]
245=[[[[[[]]]]  [[[[[[]]]]]]]]
246=[[[[[[[]]]]  [[[[[[]]]]]]]]]
247=[[[[[[[[]]]]  [[[[[[]]]]]]]]]]
248=[[[[[[[[[]]]]  [[[[[[]]]]]]]]]]]
249=[[[[[[]]]]  [[[[[]]]]]]] [[[[]]]]
250=[[[[[[]]]]]]  [[[[]]]] [[[]]]
251=[[[[[[[]]]]]]  [[[[]]]] [[[]]]]
252=[[[[[[[]]]]]]  [[[[]]]]] [[[]]]
253=[[[[[[[[]]]]]]  [[[[]]]]] [[[]]]]
254=[[[[[[[[]]]]]]  [[[[]]]]]] [[[]]]
255=[[[[[[[[[]]]]]]  [[[[]]]]]] [[[]]]]
256=[[[[[]]]]]   [[[]]]

O comprimento total dos primeiros 256 números é 7963 caracteres. Não sei se isso é ótimo.

Ignorando a adição, os resultados para 8191 e 13071 foram encontrados em alguns segundos e 524387 em alguns minutos, como

8191=[[[[[[[[]]]]]]  [[[[]]]]] [[[[[[]]]]]  [[[[]]]]]]
13071=[[[[[[[[]]]]]  [[[[]]]]]]  [[[]]]] [[[[]]]]
524387=[[[[[[[[]]]]]  [[[[]]]]] [[[[[]]]]]  [[[[]]]]] [[[[[[[]]]]]]  [[[[]]]]]]

com 164 caracteres juntos.

Aqui está o código:

ClearAll[repr, sl, i, j, op, re, frontop, rearop, lastop];
repr[n_] = "";
repr[0] = "[]";
(*Hard-code higher-order solutions*)
repr[65536] = "[[[]]]    [[[[]]]]";
repr[16] = "[[[]]]   [[[[]]]]";
repr[27] = "[[[[]]]]   [[[]]]";
repr[256] = "[[[[[]]]]]   [[[]]]";
repr[3125] = "[[[[[[]]]]]]   [[[]]]";
repr[46656] = "[[[[[[[]]]]]]]   [[[]]]";
repr[823543] = "[[[[[[[[]]]]]]]]   [[[]]]";
repr[16777216] = "[[[[[[[[[]]]]]]]]]   [[[]]]";
repr[387420489] = "[[[[[[[[[[]]]]]]]]]]   [[[]]]";
frontop[n_] = 2;
rearop[n_] = 2;
sl[n_] := If[repr[n] == "", Infinity, StringLength@repr@n];
n = 256;
op[0] := (# + #2) &
op[1] := (#*#2) &
op[2] := (#^#2) &
re[0] := (repr@# <> repr@#2) &
re[1] := (repr@# <> " " <> repr@#2) &
re[2] := (repr@# <> "  " <> repr@#2) &
For[i = 0, i < n, ++i,
  If[sl[i + 1] >= sl[i] + 2,
   repr[i + 1] = "[" <> repr[i] <> "]";
   frontop[i + 1] = 2; rearop[i + 1] = 2
   ];
  For[m = 0, m < 3, ++m,
   If[rearop[i] >= m,
    For[j = 1, j <= i, ++j,
     If[frontop[j] < m || (res = op[m][i, j]) > n, Break[]];
     rep = re[m][i, j];
     If[sl[res] > StringLength@rep ||
       sl[res] == StringLength@rep && m > frontop[res],
      repr[res] = rep;
      If[m == 2,
       frontop[res] = 2; rearop[res] = 1,
       frontop[res] = m;
       rearop[res] = m
       ]
      ]
     ]
    ];
   If[frontop[i] >= m,
    For[j = 1, j <= i, ++j,
     If[rearop[j] < m || (res = op[m][j, i]) > n, Break[]];
     rep = re[m][j, i];
     If[sl[res] > StringLength@rep ||
       sl[res] == StringLength@rep && m > frontop[res],
      repr[res] = rep;
      If[m == 2,
       frontop[res] = 2; rearop[res] = 1,
       frontop[res] = m;
       rearop[res] = m
       ]
      ]
     ]
    ]
   ];
  ];

Eu usei uma pesquisa exaustiva até a exponenciação. Não há operações de ordem ou de ordem superior. Eu apenas tentei as operações de ordem superior manualmente, e há apenas algumas combinações que realmente produzem números abaixo de 2 31 , então eu apenas codifiquei as que funcionam.

Edit: Minha solução anterior não se preocupou com precedência, apenas jogou as coisas juntas. Agora, acho que meu novo código corrige isso, mas nenhum dos primeiros 256 números mudou, nem o 8191 (que era válido antes, verifiquei) ... e é muito tarde para eu dizer agora se meu código realmente o corrigiu. . Vou dar outra olhada amanhã e também adicionar uma explicação, porque agora com a verificação de precedência é um pouco complicado (espero que deva reduzir o tempo de pesquisa).

Edit: Ok, houve alguns bugs conforme o esperado. Acho que o corrigi agora, aumentando o comprimento total de 1 a 256 para 7963 . Não tenho certeza se isso é ideal por mais tempo, porque pode ser possível encontrar soluções mais curtas de partes abaixo do ideal se elas permitirem operações de ordem superior. Uma explicação se seguirá quando eu conseguir limpar um pouco o código.

Martin Ender
fonte
2
Desculpe por continuar mudando as coisas, mas atualizei o formato da lista para algo mais legível. Última grande mudança, eu juro!
Calvin's Hobbies
1
Também parece que você está perdendo 256.
Calvin's Hobbies
1
@ Calvin'sHobbies Corrigida e adicionada tetração. Acredito que resolvi o intervalo de 1 a 256 de maneira ideal.
Martin Ender
seu 1-256 parece ter 8181 caracteres com uma nova linha ou ponto e vírgula entre cada um. bom trabalho, em geral!
Sparr
Seus 16 parecem estar abaixo do ideal. Você está expressando 16 como 4 ^ 2, que tem 18 caracteres, enquanto que com 2 ^^ 3, seriam 17 caracteres.
Isaacg
1

Python 9219b

Esta é a minha segunda entrada. Comecei do zero e tentei um novo arranjo dos dados, incluindo o uso do pacote blist para listas e ditados classificados e algumas novas abordagens para encontrar grandes soluções. Eu acho que tenho um 1-256 ideal. O aumento do tempo de execução de 30s para 4m reduziu os grandes casos de teste em cerca de 30 bytes.

# https://pypi.python.org/pypi/blist/
# provides sorteddict
from blist import *

import math, sys

TABLE_SIZE=2**8
MAX_INT = 2**31

repr = sorteddict()

for i in range(12):
    repr[i] = sorteddict({(i*2+2,-1,-1):("["*(i+1)+"]"*(i+1), str(i))});

repr    [65536] = sorteddict({(18, 4, 4):("[[[]]]    [[[[]]]]", "2^^^3")}); # 2^^^3 = 2^^(2^^2) = 2^(2^(2^2))
repr       [16] = sorteddict({(17, 3, 3):("[[[]]]   [[[[]]]]", "2^^3")}); # 2^^3 = 2^(2^2)
repr       [27] = sorteddict({(17, 3, 3):("[[[[]]]]   [[[]]]", "3^^2")}); # 3^^2 = 3^3
repr      [256] = sorteddict({(19, 3, 3):("[[[[[]]]]]   [[[]]]", "4^^2")}); # 4^^2 = 4^4
repr     [3125] = sorteddict({(21, 3, 3):("[[[[[[]]]]]]   [[[]]]", "5^^2")}); # 5^^2 = 5^5
repr    [46656] = sorteddict({(23, 3, 3):("[[[[[[[]]]]]]]   [[[]]]", "6^^2")}); # 6^^2 = 6^6
repr   [823543] = sorteddict({(25, 3, 3):("[[[[[[[[]]]]]]]]   [[[]]]", "7^^2")}); # 7^^2 = 7^7
repr [16777216] = sorteddict({(27, 3, 3):("[[[[[[[[[]]]]]]]]]   [[[]]]", "8^^2")}); # 8^^2 = 8^8
repr[387420489] = sorteddict({(29, 3, 3):("[[[[[[[[[[]]]]]]]]]]   [[[]]]", "9^^2")}); # 9^^2 = 9^9

def expr_to_repr(a,op,b):
    rep_a = None
    for d,r in repr[a].iteritems():
        op_min, op_max = ((0,9),(1,9),(3,9))[op]
        if (d[1]==-1 or d[1]>=op_min) and d[2]<=op_max:
            rep_a = (d,r)
            break
    if not rep_a:
        rep_a = ((a*2+2,-1,-1),("["*(a+1)+"]"*(a+1), str(a)));

    rep_b = None
    for d,r in repr[b].iteritems():
        op_min, op_max = ((0,9),(1,9),(3,9))[op]
        if (d[1]==-1 or d[1]>=op_min) and d[2]<=op_max:
            rep_b = (d,r)
            break
    if not rep_b:
        rep_b = ((b*2+2,-1,-1),("["*(b+1)+"]"*(b+1), str(b)));

    r = rep_a[1][0] + " "*op + rep_b[1][0]

    return (
            (
                len(r),
                min(op, rep_a[0][1] if rep_a[0][1]!=-1 else op, rep_b[0][1] if rep_b[0][1]!=-1 else op), 
                max(op, rep_a[0][2], rep_b[0][2])
            ),
            ( 
                r, 
                expr_to_string(rep_a[1][1],op,rep_b[1][1])
            )
        );

def opsym(op):
    return ("+","*","^","^^")[op]

def expr_to_string(a,op,b):
    return str(a) + opsym(op) + str(b)

def calc(a,op,b):
    if op == 0:
        return min(a+b,MAX_INT)
    elif op == 1:
        return min(a*b,MAX_INT)
    elif op == 2:
        if (b*math.log10(a)>math.log10(MAX_INT)):
            return MAX_INT
        return min(a**b,MAX_INT)
    else:
        t = a
        for h in range(b):
            t = calc(a,op-1,t)
            if t>=MAX_INT:
                t = MAX_INT
                break
        return t

def populate_repr(a,op,b):
    o = (a,op,b)
    n = calc(*o)
    if n == MAX_INT:
        return n
    if n not in repr:
        repr[n] = sorteddict()
    r = expr_to_repr(*o)
    if conditional_replace_repr(n,r):
        for i in range(1,11):
            conditional_replace_repr(n+i,
                (
                    (
                        r[0][0]+i*2,
                        -1,
                        -1
                    ),
                    (
                        "["*i + r[1][0] + "]"*i,
                        "(" + r[1][1] + "+" + str(i) + ")"
                    )
                )
            )
    return n

def conditional_replace_repr(n,new_rep):
    if n not in repr:
        repr[n] = sorteddict()
        repr[n][new_rep[0]] = new_rep[1]
        return True
    found = None
    repl = False
    for d, r in repr[n].iteritems():
        if d[1] == new_rep[0][1] and d[2] == new_rep[0][2]:
            found = d
            if d[0] > new_rep[0][0]:
                repl = True
            break
    if (not found) or (found and repl):
        repr[n][new_rep[0]] = new_rep[1]
        if found:
            del repr[n][found]
        return True
    return False

def vaguely_decent_repr(n):
    if n <= TABLE_SIZE:
        return repr[n].iteritems().next()[1][0]
    if n in repr:
        return repr[n].iteritems().next()[1][0]
    else:
        keys = sorted(repr.keys(),reverse=True)
        best_rep = None
        tested = 0
        for i in keys:
            if i>n:
                continue
            if tested > 10:
                break
            tested += 1
            cand_rep = vaguely_decent_repr(n-i) + repr[i].iteritems().next()[1][0]
            if (not best_rep) or len(cand_rep) < len(best_rep):
                best_rep = cand_rep
        return best_rep



keys = repr.keys()
for k in keys:
    for d,r in repr[k].iteritems():
        for i in range(1,11):
            conditional_replace_repr(k+i,
                (
                    (
                        d[0]+i*2,
                        -1,
                        -1
                    ),
                    (
                        "["*i + r[0] + "]"*i,
                        "(" + r[1] + "+" + str(i) + ")"
                    )
                )
            )

# initialize the repr array with results of 1..256, 2+2 up to TABLE_SIZE^TABLE_SIZE
for row in range(2,TABLE_SIZE+1):
    for col in range(2,row):
        for op in range(1,3):
            populate_repr(row,op,col)
            if op > 1:
                populate_repr(col,op,row)
    for op in range(1,3):
        populate_repr(row,op,row)
    if row > 10:
        for frac in range(1,10):
            rep_a = repr[row-frac].iteritems().next()
            conditional_replace_repr(row,
                (
                    (
                        rep_a[0][0] + frac*2,
                        -1,
                        -1
                    ),
                    (
                        "["*frac + rep_a[1][0] + "]"*frac,
                        "(" + rep_a[1][1] + "+" + str(frac) + ")"
                    )
                )
            )
        for frac in range(10,row/2):
            rep_a = repr[frac].iteritems().next()
            rep_b = repr[row-frac].iteritems().next()
            conditional_replace_repr(row,
                (
                    (
                        rep_a[0][0]+rep_b[0][0],
                        min(rep_a[0][1],rep_b[0][1]),
                        max(rep_a[0][2],rep_b[0][2])
                    ),
                    (
                        rep_a[1][0] + rep_b[1][0],
                        rep_a[1][1] + "+" + rep_b[1][1]
                    )
                )
            )



# for n,reps in repr.iteritems():
#   for d,r in reps.iteritems():

for n in range(1,257):
    print str(n)+"="+repr[n].iteritems().next()[1][0]

for n in (8191,13071,524287,2147483647,1449565302,1746268229,126528612,778085967,1553783038,997599288):
    print str(n)+"="+vaguely_decent_repr(n)

Resultado:

1=[[]]
2=[[[]]]
3=[[[[]]]]
4=[[[[[]]]]]
5=[[[[[[]]]]]]
6=[[[[[[[]]]]]]]
7=[[[[[[[[]]]]]]]]
8=[[[]]]  [[[[]]]]
9=[[[[]]]]  [[[]]]
10=[[[[[]]]]  [[[]]]]
11=[[[[[[]]]]  [[[]]]]]
12=[[[[[]]]]] [[[[]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[[[]]]]]]]]]]
87=[[[[[[]]]]   [[[]]]]] [[[[]]]]
88=[[[[[[[]]]]   [[[]]]]] [[[[]]]]]
89=[[[[[[[[]]]]   [[[]]]]] [[[[]]]]]]
90=[[[[[[[]]]]   [[[]]]]]] [[[[]]]]
91=[[[[[[[[]]]]   [[[]]]]]] [[[[]]]]]
92=[[[[[[[[[]]]]   [[[]]]]]] [[[[]]]]]]
93=[[[[[[[[]]]]   [[[]]]]]]] [[[[]]]]
94=[[[[[[[[[]]]]   [[[]]]]]]] [[[[]]]]]
95=[[[[[[]]]   [[[[]]]]]]] [[[[[[]]]]]]
96=[[[]]]  [[[[[[]]]]]] [[[[]]]]
97=[[[[]]]  [[[[[[]]]]]] [[[[]]]]]
98=[[[[[[[[]]]]]]]]  [[[]]] [[[]]]
99=[[[[]]]  [[[[[[]]]]]]] [[[[]]]]
100=[[[[[]]]]  [[[]]]]  [[[]]]
101=[[[[[[]]]]  [[[]]]]  [[[]]]]
102=[[[[[[[]]]]  [[[]]]]  [[[]]]]]
103=[[[[[[[[]]]]  [[[]]]]  [[[]]]]]]
104=[[[[[[[]]]]]]  [[[]]]] [[[[[]]]]]
105=[[[[[[[[]]]]]]  [[[]]]] [[[[[]]]]]]
106=[[[[[[[[[]]]]]]  [[[]]]] [[[[[]]]]]]]
107=[[[[[[[[[[]]]]]]  [[[]]]] [[[[[]]]]]]]]
108=[[[[]]]]   [[[]]] [[[[[]]]]]
109=[[[[[]]]]   [[[]]] [[[[[]]]]]]
110=[[[[[[]]]]   [[[]]] [[[[[]]]]]]]
111=[[[[[[[[]]]]]]]  [[[]]]] [[[[]]]]
112=[[[[[]]]]   [[[]]]] [[[[[]]]]]
113=[[[[[[]]]]   [[[]]]] [[[[[]]]]]]
114=[[[[[[[]]]]   [[[]]]] [[[[[]]]]]]]
115=[[[[[[[[]]]]   [[[]]]] [[[[[]]]]]]]]
116=[[[[[[]]]]   [[[]]]]] [[[[[]]]]]
117=[[[[[[[]]]]   [[[]]]]] [[[[[]]]]]]
118=[[[[[[[[]]]]   [[[]]]]] [[[[[]]]]]]]
119=[[[[]]]   [[[[]]]]] [[[[[[[[]]]]]]]]
120=[[[[[[[]]]]   [[[]]]]]] [[[[[]]]]]
121=[[[[[[]]]]  [[[]]]]]  [[[]]]
122=[[[[[[[]]]]  [[[]]]]]  [[[]]]]
123=[[[[[[[[]]]]  [[[]]]]]  [[[]]]]]
124=[[[[[[[[[]]]]  [[[]]]]]  [[[]]]]]]
125=[[[[[[]]]]]]  [[[[]]]]
126=[[[[[[[]]]]]]  [[[[]]]]]
127=[[[[[[[[]]]]]]  [[[[]]]]]]
128=[[[]]]  [[[[[[[[]]]]]]]]
129=[[[[]]]  [[[[[[[[]]]]]]]]]
130=[[[[[]]]  [[[[[[[[]]]]]]]]]]
131=[[[[[[]]]  [[[[[[[[]]]]]]]]]]]
132=[[[[[[[]]]]]  [[[[]]]]]] [[[]]]
133=[[[[[[[[]]]]]  [[[[]]]]]] [[[]]]]
134=[[[[[[[[]]]]]  [[[[]]]]]]] [[[]]]
135=[[[[]]]]   [[[]]] [[[[[[]]]]]]
136=[[[[[]]]]   [[[]]] [[[[[[]]]]]]]
137=[[[[[[]]]]   [[[]]] [[[[[[]]]]]]]]
138=[[[[[[[]]]]   [[[]]] [[[[[[]]]]]]]]]
139=[[[[[[[[]]]]   [[[]]] [[[[[[]]]]]]]]]]
140=[[[[[]]]]   [[[]]]] [[[[[[]]]]]]
141=[[[[[[]]]]   [[[]]]] [[[[[[]]]]]]]
142=[[[[[[[]]]]   [[[]]]] [[[[[[]]]]]]]]
143=[[[[[[[[]]]]   [[[]]]] [[[[[[]]]]]]]]]
144=[[[[[[[]]]]  [[[]]]]]]  [[[]]]
145=[[[[[[[[]]]]  [[[]]]]]]  [[[]]]]
146=[[[[[[[[[]]]]  [[[]]]]]]  [[[]]]]]
147=[[[[[[[[]]]]]]]]  [[[]]] [[[[]]]]
148=[[[[[[[[[]]]]]]]]  [[[]]] [[[[]]]]]
149=[[[[[[[[[]]]]]]]  [[[]]]] [[[[[]]]]]]
150=[[[[[[[[[]]]]]]]]  [[[]]]] [[[[]]]]
151=[[[[[[[]]]]]]  [[[]]] [[[[[[[]]]]]]]]
152=[[[[[[[[[]]]]]]]  [[[]]]]] [[[[[]]]]]
153=[[[[]]]   [[[[]]]]] [[[[]]]]  [[[]]]
154=[[[[[]]]   [[[[]]]]] [[[[]]]]  [[[]]]]
155=[[[[[[[[]]]]   [[[]]]]]]] [[[[[[]]]]]]
156=[[[[[[[]]]]]]  [[[]]]] [[[[[[[]]]]]]]
157=[[[[[[[[]]]]]]  [[[]]]] [[[[[[[]]]]]]]]
158=[[[[[[[[]]]]]]  [[[]]]] [[[[]]]]] [[[]]]
159=[[[[[[[[]]]]]]  [[[]]]] [[[]]]] [[[[]]]]
160=[[[]]]  [[[[[[]]]]]] [[[[[[]]]]]]
161=[[[[]]]  [[[[[[]]]]]] [[[[[[]]]]]]]
162=[[[[]]]]  [[[[[]]]]] [[[]]]
163=[[[[[]]]]  [[[[[]]]]] [[[]]]]
164=[[[[[]]]]  [[[[[]]]]]] [[[]]]
165=[[[[[[]]]]  [[[[[]]]]]] [[[]]]]
166=[[[[[[]]]]  [[[[[]]]]]]] [[[]]]
167=[[[[[[[]]]]  [[[[[]]]]]]] [[[]]]]
168=[[[[[[[]]]]  [[[[[]]]]]]]] [[[]]]
169=[[[[[[]]]]] [[[[]]]]]  [[[]]]
170=[[[[[[[]]]]] [[[[]]]]]  [[[]]]]
171=[[[[[[[[]]]]] [[[[]]]]]  [[[]]]]]
172=[[[[[[[[[]]]]] [[[[]]]]]  [[[]]]]]]
173=[[[[[[[[[[]]]]] [[[[]]]]]  [[[]]]]]]]
174=[[[[[[]]]]   [[[]]]]] [[[[[[[]]]]]]]
175=[[[[[[]]]]]]  [[[]]] [[[[[[[[]]]]]]]]
176=[[[]]]   [[[[]]]] [[[[[[]]]]  [[[]]]]]
177=[[[[[[[]]]]   [[[]]]]] [[[]]]] [[[[]]]]
178=[[[[[[[[]]]]   [[[]]]]] [[[]]]] [[[[]]]]]
179=[[[[[[[[[]]]]   [[[]]]]] [[[]]]] [[[[]]]]]]
180=[[[[[[[]]]]]]]  [[[]]] [[[[[[]]]]]]
181=[[[[[[[[]]]]]]]  [[[]]] [[[[[[]]]]]]]
182=[[[[[[[[[]]]]]]]  [[[]]] [[[[[[]]]]]]]]
183=[[[[[[[[]]]]]]  [[[]]]] [[[[[[[[]]]]]]]]]
184=[[[[[]]]]  [[[]]] [[[[[[]]]]]]] [[[[[]]]]]
185=[[[[[[[[]]]]]]]  [[[]]]] [[[[[[]]]]]]
186=[[[[[[[[[]]]]]]]  [[[]]]] [[[[[[]]]]]]]
187=[[[[]]]   [[[[]]]]] [[[[[[]]]]  [[[]]]]]
188=[[[[[]]]   [[[[]]]]] [[[[[[]]]]  [[[]]]]]]
189=[[[[]]]]   [[[]]] [[[[[[[[]]]]]]]]
190=[[[[[]]]]   [[[]]] [[[[[[[[]]]]]]]]]
191=[[[[[[]]]]   [[[]]] [[[[[[[[]]]]]]]]]]
192=[[[[[]]]]]  [[[[]]]] [[[[]]]]
193=[[[[[[]]]]]  [[[[]]]] [[[[]]]]]
194=[[[[[[[]]]]]  [[[[]]]] [[[[]]]]]]
195=[[[[[[]]]]]  [[[[]]]]] [[[[]]]]
196=[[[[[[[]]]]] [[[[]]]]]]  [[[]]]
197=[[[[[[[[]]]]] [[[[]]]]]]  [[[]]]]
198=[[[[[[[]]]]]  [[[[]]]]]] [[[[]]]]
199=[[[[[[[[]]]]]  [[[[]]]]]] [[[[]]]]]
200=[[[[[]]]]  [[[]]]]  [[[]]] [[[]]]
201=[[[[[[]]]]  [[[]]]]  [[[]]] [[[]]]]
202=[[[[[[]]]]  [[[]]]]  [[[]]]] [[[]]]
203=[[[[[[[]]]]  [[[]]]]  [[[]]]] [[[]]]]
204=[[[[[[[[[]]]]]  [[[[]]]]]]]] [[[[]]]]
205=[[[[[[[[[[]]]]]  [[[[]]]]]]]] [[[[]]]]]
206=[[[[[[[[]]]]  [[[]]]]  [[[]]]]]] [[[]]]
207=[[[[[[[[[[]]]]]  [[[[]]]]]]]]] [[[[]]]]
208=[[[[[[[]]]]]]  [[[]]]] [[[]]]  [[[[]]]]
209=[[[[]]]   [[[[]]]] [[[[[[]]]]] [[[[]]]]]]
210=[[[[[[[]]]]   [[[]]]]]] [[[[[[[[]]]]]]]]
211=[[[[[[[[]]]]   [[[]]]]]] [[[[[[[[]]]]]]]]]
212=[[[[[[[[]]]]]]  [[[]]]] [[[]]]] [[[[[]]]]]
213=[[[[[[[[[[[[]]]]]  [[[[]]]]]]]]]]] [[[[]]]]
214=[[[[[[[[[[[[[]]]]]  [[[[]]]]]]]]]]] [[[[]]]]]
215=[[[[[[[[[]]]]]]]] [[[[[[[]]]]]]]] [[[[[[]]]]]]
216=[[[[[[[]]]]]]]  [[[[]]]]
217=[[[[[[[[]]]]]]]  [[[[]]]]]
218=[[[[[[[[[]]]]]]]  [[[[]]]]]]
219=[[[[[[[[[[]]]]]]]  [[[[]]]]]]]
220=[[[[[[[[[[[]]]]]]]  [[[[]]]]]]]]
221=[[[[[[[[[[[[]]]]]]]  [[[[]]]]]]]]]
222=[[[[[[[[[[[[[]]]]]]]  [[[[]]]]]]]]]]
223=[[[[[[[[[[[[[[]]]]]]]  [[[[]]]]]]]]]]]
224=[[[[[]]]]   [[[]]]] [[[]]]  [[[[]]]]
225=[[[[[[[[]]]]] [[[[]]]]]]]  [[[]]]
226=[[[[[[[[[]]]]] [[[[]]]]]]]  [[[]]]]
227=[[[[[[[[[[]]]]] [[[[]]]]]]]  [[[]]]]]
228=[[[[[[[[[[[]]]]] [[[[]]]]]]]  [[[]]]]]]
229=[[[[[[[[[[[[]]]]] [[[[]]]]]]]  [[[]]]]]]]
230=[[[[[[[[[[[[[]]]]] [[[[]]]]]]]  [[[]]]]]]]]
231=[[[[]]]  [[[[[[]]]]]]] [[[[[[[[]]]]]]]]
232=[[[[[[]]]]   [[[]]]]] [[[]]]  [[[[]]]]
233=[[[[[[[]]]]   [[[]]]]] [[[]]]  [[[[]]]]]
234=[[[[[[[]]]]]]  [[[]]]] [[[[]]]]  [[[]]]
235=[[[[[[[[]]]]]]  [[[]]]] [[[[]]]]  [[[]]]]
236=[[[[[[[]]]]   [[[]]]]] [[[]]]] [[[[[]]]]]
237=[[[[[[[[]]]]]]  [[[]]]] [[[[]]]]] [[[[]]]]
238=[[[[[]]]  [[[[[[]]]]]]]] [[[[[[[[]]]]]]]]
239=[[[[[[]]]  [[[[[[]]]]]]]] [[[[[[[[]]]]]]]]]
240=[[[]]]   [[[[]]]] [[[[[[]]]]]] [[[[]]]]
241=[[[[]]]   [[[[]]]] [[[[[[]]]]]] [[[[]]]]]
242=[[[[[[]]]]  [[[]]]]]  [[[]]] [[[]]]
243=[[[[]]]]  [[[[[[]]]]]]
244=[[[[[]]]]  [[[[[[]]]]]]]
245=[[[[[[]]]]  [[[[[[]]]]]]]]
246=[[[[[[[]]]]  [[[[[[]]]]]]]]]
247=[[[[[[[[]]]]  [[[[[[]]]]]]]]]]
248=[[[[[[[[[]]]]  [[[[[[]]]]]]]]]]]
249=[[[[[[]]]]  [[[[[]]]]]]] [[[[]]]]
250=[[[[[[]]]]]]  [[[[]]]] [[[]]]
251=[[[[[[[]]]]]]  [[[[]]]] [[[]]]]
252=[[[[[[[]]]]]]  [[[[]]]]] [[[]]]
253=[[[[[[[[]]]]]]  [[[[]]]]] [[[]]]]
254=[[[[[[[[]]]]]]  [[[[]]]]]] [[[]]]
255=[[[[[[[[[]]]]]]  [[[[]]]]]] [[[]]]]
256=[[[[[]]]]]   [[[]]]
8191=[[[[[[[[]]]]]]  [[[[]]]]] [[[[[[]]]]]  [[[[]]]]]]
13071=[[[[[[[[[]]]]  [[[]]]]]  [[[]]] [[[[]]]]   [[[]]] [[[[[]]]]]]]]
524287=[[[[]]]]   [[[]]] [[[[[[[[]]]]]]]] [[[[[[]]]]]  [[[[]]]]][[[[[[[[[[[]]]]]]  [[[]]]] [[[[]]]]]]  [[[[]]]]]]
2147483647=[[[[[[]]]]]]  [[[[]]]] [[[[[]]]]] [[[[]]]][[[[]]]   [[[[]]]]]  [[[[[]]]]][[[[[[[[[[[]]]]]]]  [[[[]]]]]]]]  [[[[]]]][[[[[[[[[[[[[[[]]]]]  [[[[]]]]]]]]]]] [[[[]]]]]]  [[[[[]]]]]]
1449565302=[[[[[[[[[]]]]  [[[]]]]]]  [[[]]]]] [[[[[[[[]]]]  [[[[[]]]]]]]]][[[[[]]]   [[[[]]]]] [[[[]]]]  [[[]]]]  [[[[]]]][[[[[[[[[[[]]]]]  [[[[]]]] [[[[]]]]]]]  [[[[[]]]]]]]]
1746268229=[[[[[[[]]]]]]]  [[[[]]]] [[[[]]]  [[[[[[[[]]]]]]]]][[[[]]]]   [[[]]]  [[[[[[]]]]]][[[[[[[[[[]]]]  [[[]]]]  [[[]]]] [[[]]]]]  [[[[[]]]]]]]
126528612=[[[[[[]]]]  [[[[[[]]]]]]]] [[[[[]]]]][[[[[[[]]]]]]]  [[[[[[[[]]]]]]]][[[[[[[[[]]]]]]  [[[]]]] [[[[[]]]]]]]  [[[[[]]]]]
778085967=[[[[[[[[[]]]]  [[[[[]]]]]]]]]] [[[[[[]]]]]]  [[[]]][[[[[[[]]]]]  [[[[]]]]]]  [[[[]]]][[[[[[[]]]]  [[[[[]]]]]]] [[[]]]]  [[[[[]]]]]
1553783038=[[[[[]]]  [[[[[[[[]]]]]]]]]] [[[[[[[]]]]   [[[]]]]]][[[[[]]]   [[[[]]]]]]  [[[[[]]]]][[[[[[[[[]]]]  [[[]]]]  [[[]]]]]] [[[]]]]  [[[[]]]][[[[[[[[]]]  [[[[[[]]]]]]]]  [[[[[[[]]]]]]]]]]
997599288=[[[[[]]]]   [[[]]] [[[[[[]]]]]]] [[[[[[[[]]]]]  [[[[]]]]]]][[[[[[[[]]]]]] [[[[[]]]]]]]  [[[[[[]]]]]][[[[[[[[[[]]]]   [[[]]]]]]] [[[]]]]  [[[[[[]]]]]]]

7944b para 1-256

1275b para os casos grandes

Sparr
fonte