0
liste(lim,mul,base=34,step=5590,offset=588)=my(v=List(),X=mul*base); lim\=1; while(X<lim,forstep(n=X+offset+step,lim,step, listput(v,n)); X*=base); Set(v)
list(lim)=setunion(liste(lim,23),liste(lim,223))
v=list(1e6)

This is a Pari code.

Now how can I modify this program to see if it is true that if numbers generated with that Pari code are multiple of 43, then they are congruent either to 0 or 344 mod (559)?

4

1 回答 1

1

您可以使用select功能:

subset1 = select((x) -> (x % 43 == 0), v);
subset2 = select((x) -> (x % 43 == 0) && (x % 559 == 0 || x % 559 == 344), v);
vecsort(subset1) == vecsort(subset2)
> 1

因此,该猜想适用于您的 PARI/GP 代码生成的数字。

于 2020-04-04T19:02:21.880 回答