我是PARI / GP的新手,了解不同的数字字段。我正在尝试使用k = Q(\zeta_23)
(第23个分圆场)构建字段bnfinit
以运行以下脚本:
v=[]; w=[]; j=0; l=0;
forprime(p=29, 100000, {
if(p%46==1, j++; if(#bnfisintnorm(k,p)>0,l++;w=[p];v=concat(v,w)))
});
print("Up to 100000 there are ",j," primes congruent to 1 mod 46 and ",l," are norms of principal ideals")
跑进GP会出现此错误,
<=1,j++;if(#bnfisintnorm(k,p)>0,l++;w=[p];v=concat(v,w))));print("Up to 100000 there are ",j," primes congruent to 1 mod 46 and ",l," are norms of principal ideals")
*** at top-level: ...00000,if(p%46==1,j++;if(#bnfisintnorm(k,p)>0,
*** ^--------------------
*** bnfisintnorm: incorrect type in checknf [please apply nfinit()] (t_POL).
(18:29) gp >
这应该找到质数p,使得在字段K中存在代数整数,其范数为p。
请帮忙吗?感谢。
答案 0 :(得分:2)
您可以将所需的数字字段定义为k = bnfinit(polcyclo(23))
。所以你的代码会输出:
gp> Up to 100000 there are 429 primes congruent to 1 mod 46 and 141 are norms of principal ideals
希望,这有帮助。