Created
October 28, 2014 15:13
-
-
Save quapka/84fc9fbafbce147a939e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from fractions import gcd | |
moduli = [8844679, 11316499, 13490941, 18761893, 21799573, | |
22862761, 48456493, 43831027, 58354333, 60785419] | |
GCDs = [['\\textbf{Moduli}'] + moduli] | |
for nA in moduli: | |
line = [nA] | |
for nB in moduli: | |
line.append(gcd(nA, nB)) | |
if line[0] in [13490941, 48456493]: | |
#line = ['\\textcolor{blue}{'+ str(x) +'}' for x in line] | |
line = ['\cellcolor{blue}'+ str(x) for x in line] | |
GCDs.append(line) | |
print '\\begin{tabular}{*{11}{|c}|}\n\\hline' | |
for line in GCDs: | |
print ' & '.join([str(x).rjust(9) for x in line]) + ' \\\\ \n\hline' | |
print '\\end{tabular}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment