这里会显示出您选择的修订版和当前版本之间的差别。
| 两侧同时换到之前的修订记录 前一修订版 | |||
|
2020-2021:teams:intrepidsword:zhongzihao:ntt [2022/05/02 16:47] toxel add more |
2020-2021:teams:intrepidsword:zhongzihao:ntt [2022/05/02 16:48] (当前版本) toxel add code |
||
|---|---|---|---|
| 行 137: | 行 137: | ||
| | $484227031934875729921$ | $105\times2^{62}+1$ | $17$ | $502673776008585281537$ | $109\times2^{62}+1$ | $3$ | | | $484227031934875729921$ | $105\times2^{62}+1$ | $17$ | $502673776008585281537$ | $109\times2^{62}+1$ | $3$ | | ||
| + | 生成代码: | ||
| + | <hidden> | ||
| + | <code cpp> | ||
| + | import sympy.ntheory as nth | ||
| + | import random | ||
| + | |||
| + | if __name__ == '__main__': | ||
| + | output = list() | ||
| + | for mult in range(1, 120, 2): | ||
| + | for exp in range(10, 63): | ||
| + | num = mult << exp | 1 | ||
| + | if nth.isprime(num): | ||
| + | output.append((num, mult, exp, nth.residue_ntheory.primitive_root(num))) | ||
| + | output.sort() | ||
| + | print(len(output)) | ||
| + | print('^ NTT 模数 ^ 表达式 ^ 原根 ^ NTT 模数 ^ 表达式 ^ 原根 ^') | ||
| + | for i in range(0, len(output), 2): | ||
| + | num, mult, exp, pr_root = output[i] | ||
| + | string = f'| ${num}$ | ${mult}\\times{2}^{{{exp}}}+1$ | ${pr_root}$ ' | ||
| + | if i + 1 < len(output): | ||
| + | num, mult, exp, pr_root = output[i + 1] | ||
| + | string += f'| ${num}$ | ${mult}\\times{2}^{{{exp}}}+1$ | ${pr_root}$ ' | ||
| + | string += '|' | ||
| + | print(string) | ||
| + | </code> | ||
| + | </hidden> | ||