# bounds=[12,9,7,6,6] {tot=0; for(r1=1,sqrtint(bounds[1]),for(r2=0,min(r1,sqrtint(bounds[1]-r1^2)),for(r3=0,min(r2,sqrtint(bounds[1]-r1^2-r2^2)),for(r4=0,min(r3,sqrtint(bounds[1]-r1^2-r2^2-r3^2)),for(r5=0,min(r4,sqrtint(bounds[1]-r1^2-r2^2-r3^2-r4^2)), b1=[r1,r2,r3,r4,r5];print(b1); if(b1[2]==0,q2=0,q2=1);if(b1[3]==0,q3=0,q3=1);if(b1[4]==0,q4=0,q4=1);if(b1[5]==0,q5=0,q5=1); bs1=b1; for(s1=-sqrtint(bounds[2]),sqrtint(bounds[2]),for(s2=-q2*sqrtint(bounds[2]-s1^2),sqrtint(bounds[2]-s1^2),for(s3=-q3*sqrtint(bounds[2]-s1^2-s2^2),sqrtint(bounds[2]-s1^2-s2^2),for(s4=-q4*sqrtint(bounds[2]-s1^2-s2^2-s3^2),sqrtint(bounds[2]-s1^2-s2^2-s3^2),for(s5=-q5*sqrtint(bounds[2]-s1^2-s2^2-s3^2-s4^2),sqrtint(bounds[2]-s1^2-s2^2-s3^2-s4^2), b2=[s1,s2,s3,s4,s5]; mu21=(b2*bs1~)/(bs1*bs1~); bs2=b2-mu21*bs1; check=bs2+mu21*bs1; if(abs(mu21)<=1/2,if(check*check~>=3/4*(bs1*bs1~), if(bs2*bs2~<=3*2^(5-2-2), for(t1=-sqrtint(bounds[3]),sqrtint(bounds[3]),for(t2=-sqrtint(bounds[3]-t1^2),sqrtint(bounds[3]-t1^2),for(t3=-sqrtint(bounds[3]-t1^2-t2^2),sqrtint(bounds[3]-t1^2-t2^2),for(t4=-sqrtint(bounds[3]-t1^2-t2^2-t3^2),sqrtint(bounds[3]-t1^2-t2^2-t3^2),for(t5=-sqrtint(bounds[3]-t1^2-t2^2-t3^2-t4^2),sqrtint(bounds[3]-t1^2-t2^2-t3^2-t4^2), b3=[t1,t2,t3,t4,t5]; mu32=(b3*bs2~)/(bs2*bs2~);mu31=(b3*bs1~)/(bs1*bs1~);bs3=b3-mu31*bs1-mu32*bs2;check=bs3+mu32*bs2; if(abs(mu32)<=1/2,if(abs(mu31)<=1/2,if(check*check~>=3/4*(bs2*bs2~), if(bs3*bs3~<=3*2^(5-3-2), for(u1=-sqrtint(bounds[4]),sqrtint(bounds[4]),for(u2=-sqrtint(bounds[4]-u1^2),sqrtint(bounds[4]-u1^2),for(u3=-sqrtint(bounds[4]-u1^2-u2^2),sqrtint(bounds[4]-u1^2-u2^2),for(u4=-sqrtint(bounds[4]-u1^2-u2^2-u3^2),sqrtint(bounds[4]-u1^2-u2^2-u3^2),for(u5=-sqrtint(bounds[4]-u1^2-u2^2-u3^2-u4^2),sqrtint(bounds[4]-u1^2-u2^2-u3^2-u4^2), b4=[u1,u2,u3,u4,u5]; mu43=(b4*bs3~)/(bs3*bs3~);mu42=(b4*bs2~)/(bs2*bs2~);mu41=(b4*bs1~)/(bs1*bs1~);bs4=b4-mu41*bs1-mu42*bs2-mu43*bs3;check=bs4+mu43*bs3; if(abs(mu43)<=1/2,if(abs(mu42)<=1/2,if(abs(mu41)<=1/2,if(check*check~>=3/4*(bs3*bs3~), if(bs4*bs4~<=3*2^(5-4-2), for(v1=-sqrtint(bounds[5]),sqrtint(bounds[5]),for(v2=-sqrtint(bounds[5]-v1^2),sqrtint(bounds[5]-v1^2),for(v3=-sqrtint(bounds[5]-v1^2-v2^2),sqrtint(bounds[5]-v1^2-v2^2),for(v4=-sqrtint(bounds[5]-v1^2-v2^2-v3^2),sqrtint(bounds[5]-v1^2-v2^2-v3^2),for(v5=-sqrtint(bounds[5]-v1^2-v2^2-v3^2-v4^2),sqrtint(bounds[5]-v1^2-v2^2-v3^2-v4^2), b5=[v1,v2,v3,v4,v5]; mu54=(b5*bs4~)/(bs4*bs4~);mu53=(b5*bs3~)/(bs3*bs3~);mu52=(b5*bs2~)/(bs2*bs2~);mu51=(b5*bs1~)/(bs1*bs1~);bs5=b5-mu51*bs1-mu52*bs2-mu53*bs3-mu54*bs4;check=bs5+mu54*bs4; if(abs(mu51)<=1/2,if(abs(mu52)<=1/2,if(abs(mu53)<=1/2,if(abs(mu54)<=1/2,if(check*check~>=3/4*(bs4*bs4~), if(bs5*bs5~<=1, if(bs4*bs4~<=1/(1-(4/3)*mu54^2), M=[b1[1],b1[2],b1[3],b1[4],b1[5];b2[1],b2[2],b2[3],b2[4],b2[5];b3[1],b3[2],b3[3],b3[4],b3[5];b4[1],b4[2],b4[3],b4[4],b4[5];b5[1],b5[2],b5[3],b5[4],b5[5]]; if(abs(matdet(M))>1, tot=tot+1;print(tot,M); N=M^(-1); P=matrix(5,5,i,j,floor(abs(N[i,j]))); S=(P[,1]~*P[,1])*(P[,2]~*P[,2])*(P[,3]~*P[,3])*(P[,4]~*P[,4])*(P[,5]~*P[,5]); if(S==0,,print("counterexample: ",M) ))))))))))))))))))))))))))))))))))))))))))))));tot } print([gettime(),tot])