OFFSET
1,1
COMMENTS
EXAMPLE
PROG
(PARI) Union()={ my (v); v=(select(m->!#select(k->k<>2, quadclassunit(-4*m).cyc), [1..1848])); for(k=3, 41, d=4*k-1; if(isprime(d) && qfbclassno(-d)==1, v=concat(v, d))); return(v); }
isok(p, u)={my (i, s, n=matsize(u)[2], t=0); for(i=1, n, s=kronecker(-u[i], p); if(s==1, t++, break)); if(t==n, t=0; for(i=1, n, s=qfbsolve(Qfb(1, 0, u[i]), p); if(s==[], break, t++))); if(t==n, 1, 0)}
Primo(p, m)={my(u=Union()); while(p<m, p=nextprime(p+1); if(isok(p, u), return(p))); return(0)}
Lista(m)={ my (q, r=323*10^7, v=[]); q=nextprime(r); m=precprime(m); while(q<m, r=q; q=Primo(r, m); if(q>r, v=concat(v, q), q=m)); return(v); }
CROSSREFS
KEYWORD
nonn
AUTHOR
Marco Frigerio, Dec 29 2020
STATUS
approved