/* h'(D)=h(D)/(w(D)/2) */ myh(D)= { if (D==-3,return(1/3)); if (D==-4,return(1/2)); return (quadclassunit(D).no); } /* Hurwitz class number in level 2, equal to H(N)+2H(N/4), with H=qfbhclassno */ Hspec(N)= { my(D0,F,s,fa,lipr,liex,lfa,q); [D0,F]=coredisc(-N,1); fa=factor(F); lipr=fa[,1]; liex=fa[,2]; lfa=#lipr; s=3+(1<<(liex[1]+1)-3)*(2-kronecker(D0,2)); for (j=2,lfa, q=lipr[j]; s*=(1+(q^liex[j]-1)/(q-1)*(q-kronecker(D0,q))) ); myh(D0)*s; } /* Ramanujan tau function for p prime */ tauprime(p)= { my(s,lim,p27,p9,tin); if (p==2,return(-24)); s=0; lim=sqrtint(p); p27=7*p^2; p9=9*p; tin=((p-1)/2)%2; for (t=1,lim,t2=t*t;s+=t2^3*(p27+t2*(4*t2-p9))*if(t%2==tin,qfbhclassno(4*(p-t2)),Hspec(4*(p-t2)))); 28*p^6-28*p^5-90*p^4-35*p^3-1-128*s; } /* Ramanujan tau function */ tau(n)= { my(fa,lipr,liex,lfa,P,S,p,e,t,t0,t1,t2); fa=factor(n); lipr=fa[,1]; liex=fa[,2]; lfa=#lipr; P=1; for (j=1,lfa, p=lipr[j]; e=liex[j]; tp=tauprime(p); t1=tp; t0=1; for (k=1,e-1,t2=tp*t1-p^11*t0; t0=t1; t1=t2); P*=t1 ); P; } /* parallel tauprime function: 1 <= j <= k */ taupar(p,k,j)= { my(s,lim,p27,p9,tin); s=0; lim=sqrtint(p); p27=7*p^2; p9=9*p; tin=((p-1)/2)%2; forstep (t=j,lim,k,t2=t*t;s+=t2^3*(p27+t2*(4*t2-p9))*if(t%2==tin,qfbhclassno(4*(p-t2)),Hspec(4*(p-t2)))); s; write("tp"Str(j),s); } tauall(p,k)= { my(s); s=0; for(j=1,k,s+=read("tp"Str(j))); 28*p^6-28*p^5-90*p^4-35*p^3-1-128*s; }