print(''' {| class="wikitable" style="text-align:left;" |+ Polynomial Expansions and AKS prime test |- ! p ! (x-1)^p |-''') for p in range(12): print('! %i\n| %s\n| %r\n|-' % (p, ' '.join('%s%s' % (('%+i' % e) if (e != 1 or not p or (p and not n) ) else '+', (('x^{%i}' % n) if n > 1 else 'x') if n else '') for n,e in enumerate(expand_x_1(p))), aks_test(p))) print('|}')