php/2adic.php0000644000175100017510000000144612747025543012352 0ustar keithkeith Calculating a 2-adic square root \n"; } else if(bccomp($Nvalue,"2")<0){ print "n < 2
\n"; } else if(bccomp(mod($Avalue,"8"),"1")!=0){ print "a is not of the form 8k+1
\n"; } else{ twoadicsqrt_improved($Avalue,$Nvalue); } print "

\n"; print "Return to main page
\n"; ?> php/3x+1.html0000644000175100017510000000275613772246606012244 0ustar keithkeith The Collatz Conjecture

The Collatz Conjecture

The iterates y, T(y), T(T(y)),... of the 3x+1 function

are printed and the number of steps taken to reach one of the integers 1, 0, -1, -5, -17 is recorded.

It is conjectured that every trajectory starting from a non-zero integer will end in one of the (non-zero) numbers in this list and subsequently cycle:

  1,2,1;
-1,-1;
-5,-7,-10,-5;
-17,-25,-37,-55,-82,-41,-61,-91,-136,-68,-34,-17.

Also see Generalized 3x+1 functions and Markov matrices.

Enter y:

Last modified 2nd February 2006
Return to main page php/3x+1_.php0000644000175100017510000000311111620071521012166 0ustar keithkeith="0";$i=bcadd($i,"1")){ print "i=$i: $x\n
"; if(bccomp($x,"0")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 0 is $i\n
"; flush(); return; } if(bccomp($x,"1")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 1 is $i\n
"; flush(); return; } if(bccomp($x,"-1")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -1 is $i\n
"; flush(); return; } if(bccomp($x,"-5")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -5 is $i\n
"; flush(); return; } if(bccomp($x,"-17")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -17 is $i\n
"; flush(); return; } $x=collatzt($x); flush(); } } ?> php/3x+1.php0000644000175100017510000000070712747107542012055 0ustar keithkeith \n"; } else { collatz($Mvalue); } print "

\n"; print "Return to main page
\n"; auditfin(); ?> php/3x+371.html0000644000175100017510000000354011625274515012401 0ustar keithkeith The 3x+371 Conjecture

The 3x+371 Conjecture

The iterates y, t(y), t(t(y)),... of the 3x+371 function

t(x) = x/2 if x is even,
t(x) = (3x+371)/2 if x is odd,

are printed and the number of steps taken to reach one of the integers 721, 371, 265, 25, 0, -371, -563, -1855, -6307, is recorded.

It is conjectured (by Keith Matthews) that every trajectory starting from a non-zero integer will end in one of the numbers in this list and subsequently cycle. (The cycle lengths are printed in bold type.):

Enter M:

Last modified 15th May 2010
Return to main page php/3x+371_.php0000644000175100017510000000471210436606720012361 0ustar keithkeith$y\n
"; flush(); $x=$y; for($i="0";gezero($i);$i=bcadd($i,"1")){ if(eq($x,"721")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 721 is $i\n
"; flush(); return; } if(eq($x,"371")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 371 is $i\n
"; flush(); return; } if(eq($x,"265")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 265 is $i\n
"; flush(); return; } if(eq($x,"25")){ print "starting number = $y
\n"; flush(); print "the number of iterations taken to reach 25 is $i
\n"; flush(); return; } if(ezero($x)){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 0 is $i\n
"; flush(); return; } if(eq($x,"-371")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -371 is $i\n
"; flush(); return; } if(eq($x,"-563")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -563 is $i\n
"; flush(); return; } if(eq($x,"-1855")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -1855 is $i\n
"; flush(); return; } if(eq($x,"-6307")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -6307 is $i\n
"; flush(); return; } $x=t($x); print "$x\n
"; flush(); } } ?> php/3x+371.php0000644000175100017510000000073412747107637012234 0ustar keithkeith \n"; print "Return to main page
\n"; exit; } else { s($Mvalue); } print "

\n"; print "Return to main page
\n"; ?> php/6branch.html0000644000175100017510000001005713241441046013054 0ustar keithkeith A 6-branch generalized 3x+1 conjecture

A 6 branch generalized 3x+1 conjecture

The iterates y, t(y), t(t(y)),... of the function

t(x) = x/6if x ≡ 0 (mod 6),
t(x) = (7x+1)/2if x ≡ 1 (mod 6),
t(x) = x/2if x ≡ 2 (mod 6),
t(x) = x/3if x ≡ 3 (mod 6),
t(x) = x/2if x ≡ 4 (mod 6),
t(x) = (7x+1)/6if x ≡ 5 (mod 6),

are printed and the number of steps taken to reach one of the integers 19, 1, 0, -1, -5, -11 is recorded.

This mapping is of type (b) in Generalized 3x+1 mappings with Markov matrix

1/6 1/6 1/6 1/6 1/6 1/6
0 1/2 1/2 0 0 0
0 0 0 1/2 1/2 0
0 1/2 1/2 0 0 0
1/6 1/6 1/6 1/6 1/6 1/6
0 1/3 0 0 1/3 1/3

with stationary vector (2/53, 15/53, 14/53, 9/53, 10/53, 3/53).
Then, as we have the inequality

(1/6)2/53(21/6)15/53(3/6)14/53(2/6)9/53(3/6)10/53(7/6)3/53 < 1,

it is conjectured by Keith Matthews that every trajectory will end in one of the numbers in this list and subsequently cycle. (The cycle lengths are printed in bold type.):

This mapping was communicated on July 16, 2017 by Kevin Lamoreau, who was inspired by Tomás Oliveira e Silva's 5x + 1 and 7x + 1 variants.

Enter M:

Last modified 17th July 2017
Return to main page php/6branch_.php0000644000175100017510000000421713133024131013027 0ustar keithkeith$y\n
"; flush(); $x=$y; for($i="0";gezero($i);$i=bcadd($i,"1")){ if(eq($x,"0")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 0 is $i\n
"; flush(); return; } if(eq($x,"1")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 1 is $i\n
"; flush(); return; } if(eq($x,"19")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 19 is $i\n
"; flush(); return; } if(eq($x,"-1")){ print "starting number = $y
\n"; flush(); print "the number of iterations taken to reach -1 is $i
\n"; flush(); return; } if(eq($x,"-5")){ print "starting number = $y
\n"; flush(); print "the number of iterations taken to reach -5 is $i
\n"; flush(); return; } if(eq($x,"-11")){ print "starting number = $y
\n"; flush(); print "the number of iterations taken to reach -11 is $i
\n"; flush(); return; } $x=t($x); print "$x\n
"; flush(); } } ?> php/6branch.php0000644000175100017510000000073713133024111012671 0ustar keithkeith \n"; print "Return to main page
\n"; exit; } else { s($Mvalue); } print "

\n"; print "Return to main page
\n"; ?> php/aaa.html0000644000175100017510000000272512574426331012266 0ustar keithkeith Solving the diophantine equation ax^2+bxy+cy^2=n, where b^2-04ac > 0 and is not a perfect square

Solving the diophantine equation ax2+bxy+cy2=n, where b2-4ac > 0 and is not a perfect square, n non-zero


This program was written by the author after studying page 94 of the recent book Quadratic Diophantine Equations, Titu Andreescu, Dorin Andrica, Developments in Mathematics, Vol. 40, Springer 2015.

The program is a BCMath version of BC function aa2().

Enter a (nonzero):
Enter b:
Enter c(nonzero):
Enter n (non-zero):

Last modified 11th September 2015
Return to main page php/aaa.php0000644000175100017510000000264712747032715012115 0ustar keithkeith \n"; }else if($nvalue=="0"){ print "n = 0
\n"; } else{ $tmp1=bcmul($bvalue,$bvalue); $tmp2=bcmul($avalue,$cvalue); $tmp2=bcmul("4",$tmp2); $d=bcsub($tmp1,$tmp2); if(lezero($d)){ print "b2-4ac ≤ 0
\n"; return; } $f=bcsqrt($d); $xx=bcmul($f,$f); if(bccomp($xx,$d)==0){ print "b2-4ac is the square of $f
\n"; return; } print "The diophantine equation "; $x="x"; $y="y"; printbinaryform($avalue,$bvalue,$cvalue,$x,$y); print "=$nvalue:
\n"; $s=aa2($avalue,$bvalue,$cvalue,$nvalue); } print "

\n"; print "Return to main page
\n"; ?> php/aa.html0000644000175100017510000000403013763565331012121 0ustar keithkeith Solving the diophantine equation ax^2-by^2=c, using the LMM method

Solving the diophantine equation ax2-by2=c, using the LMM method

Here a > 0, b > 0, c ≠ 0. Also let D = ab.
This program was written by the author after studying page 84 of the recent book Quadratic Diophantine Equations, Titu Andreescu, Dorin Andrica, Developments in Mathematics, Vol. 40, Springer 2015.
(See note)
We make the transformation X = ax, Y = y and look for the fundamental solutions of the transformed equation X2 - Dy2 = ac. If there are none, then the original equation has no integer solutions. Otherwise each fundamental solution (α, β) for which α is divisible by a, gives rise to a solution family

x = (α/a)u + bβv, y = βu + α v,

where u and v are integers satisfying the equation u2 - Dv2 = 1.

The method works for ac with up to say 20 digits, due to the limitations of the program used to factor c.

The program is a BCMath version of BC function aa1().

Enter a: (> 0)
Enter b: (> 0)
Enter c: (≠ 0)

Last modified 8th December 2015
Return to main page
php/aa.php0000644000175100017510000000212612747033114011736 0ustar keithkeith Solving ax^2-by^2=c using the LMM method \n"; } else{ $a=$Avalue; $b=$Bvalue; $c=$Cvalue; $d=bcmul($a,$b); $g=squaretest($d); if(bccomp($a,"0")<=0){ print "a < 1
\n"; }else if(bccomp($b,"0")<=0){ print "b < 1
\n"; }else if(bccomp($c,"0")==0){ print "c = 0
\n"; }else if(bccomp($g,"0")>=0){ print "D is a perfect square
\n"; }else{ $result=aa1($a,$b,$c); } } print "

\n"; print "Return to main page
\n"; ?> php/ap2-bq2_.php0000644000175100017510000001533112464134403012661 0ustar keithkeith
\n"; print "Initial segment of the continued fraction for √($b/$a):
\n"; for($i="0";le($i,$h);$i=bcadd($i,"1")){ print "a[$i]=$aa[$i], P[$i]=$pcap[$i], Q[$i]=$qcap[$i], A[$i]/B[$i]=$pu[$i]/$qv[$i]
\n"; } print "period length = $h
\n"; if(gt($count,"2")){ print "More than one exceptional solution! Please contact Keith Matthews
\n"; return("0"); }else{ print "(x,y)=($xx[0], $yy[0]) is an exceptional solution of x2 – $d y2 = $kksquared.
\n"; print "(x,y)=($xx[1], $yy[1]) is the smallest positive solution in the conjugate class to ($xx[0], $yy[0]).
\n"; print "All positive solutions of x2 – $d y2 = $kksquared are given by the formulae
\n"; print "x + y√$d = ($xx[0] + $yy[0]√$d)($twokksquaredplusone + $twok√$d)n, n ≥ 0,
\n"; print "x + y√$d = ($xx[1] + $yy[1]√$d)($twokksquaredplusone + $twok√$d)n, n ≥ 0.
\n"; } } return($flag); } $l=$k;$m=$n; $k=$u;$n=$v; $p=bcsub(bcmul($y,$q),$p); $e=$q; $q=bcdiv(bcsub($d,bcmul($p,$p)),$q); if(eq($dd,"1")){ $temp=bcsub($e,$q); $temp=aplusbc($temp,"2",$p); $t1=bcabs($temp); if(eq($t1,$twok)){ if(ezero($count)){ print "k=$kk, d=$dd, a=$a, b=$b
\n"; } $temp=bcadd($u,$l); $temq=bcadd($v,$m); $hplus1=bcadd($h,"1"); $hminus1=bcsub($h,"1"); print "| Q[$h] – Q[$hplus1] + 2P[$hplus1] | = $twok = 2k, (A[$h] + A[$hminus1])/(B[$h] + B[$hminus1]) = $temp/$temq = p/q
\n"; $tempa=bcmul3($a,$temp,$temp); $tempb=bcmul3($b,$temq,$temq); $tempc=bcadd($tempa,$tempb); $tempc=bcmul($tempc,$dd); $tempc=bcdiv($tempc,"2"); $tempd=bcsub($tempa,$tempb); $t=bcmul3($dd,$temp,$temq); print "give the smallest positive solution of ap2 – bq2 = $tempd
\n"; $xx[$count]=$tempc; $yy[$count]=$t; print " and produce x[$count]=$tempc, y[$count]=$t, a solution of x2 – $d y2 = $kksquared.

\n"; $count=bcadd($count,"1"); $flag="1"; } $temp=bcsub($e,$q); $temp=aminusbc($temp,"2",$p); $t2=bcabs($temp); if(eq($t2,$twok)){ if(ezero($count)){ print "k=$kk, d=$dd, a=$a, b=$b
\n"; } $temp=bcsub($u,$l); $temq=bcsub($v,$m); $hplus1=bcadd($h,"1"); $hminus1=bcsub($h,"1"); print "| Q[$h] – Q[$hplus1] – 2P[$hplus1] | = $twok = 2k and (A[$h] – A[$hminus1])/(B[$h] – B[$hminus1]) = $temp/$temq = p/q
\n"; $tempa=bcmul3($a,$temp,$temp); $tempb=bcmul3($b,$temq,$temq); $tempc=bcadd($tempa,$tempb); $tempc=bcmul($tempc,$dd); $tempc=bcdiv($tempc,"2"); $tempd=bcsub($tempa,$tempb); $t=bcmul3($dd,$temp,$temq); print "give the smallest positive solution of ap2 – bq2 = $tempd
\n"; $xx[$count]=$tempc; $yy[$count]=$t; print " and produce x[$count]=$tempc, y[$count]=$t, a solution of x2 – $d y2 = $kksquared.

\n"; $count=bcadd($count,"1"); $flag="1"; } } if(eq($q,$twokoverd)){ if(ezero($count)){ print "k=$kk, d=$dd, a=$a, b=$b
\n"; } $hplus1=bcadd($h,"1"); print "Q[$hplus1]= $q = 2k/d and A[$h]/B[$h] = $u/$v = p/q
\n"; $tempa=bcmul3($a,$u,$u); $tempb=bcmul3($b,$v,$v); $tempc=bcadd($tempa,$tempb); $tempc=bcmul($tempc,$dd); $tempc=bcdiv($tempc,"2"); $tempd=bcsub($tempa,$tempb); print "give the smallest positive solution of ap2 – bq2 = $tempd
\n"; $t=bcmul3($dd,$u,$v); print " and produce x[$count]=$tempc, y[$count]=$t, a solution of x2 – $d y2 = $kksquared.

\n"; $xx[$count]=$tempc; $yy[$count]=$t; $count=bcadd($count,"1"); $flag="1"; } } } function dujellacfractest($m,$n){ for($k=$m;le($k,$n);$k=bcadd($k,"1")){ $t=dujellatest($k); if(ezero($t)){ continue; } } } function dujellatest($k){ global $divisor; $kk=aplusbc("1",$k,$k); $twok=bcmul("2",$k); $div2k=divisors($twok,"0"); for($s="0";lt($s,$div2k);$s=bcadd($s,"1")){ $divisor2k[$s]=$divisor[$s]; } $flag="0"; for($s="0";lt($s,$div2k);$s=bcadd($s,"1")){ $d=$divisor2k[$s]; if(eq($d,$k) || eq($d,$twok)){ continue; } $temp1=bcmod($k,"2"); $temp2=bcmod($d,"2"); if(neqzero($temp1) && neqzero($temp2)){ continue; } $divkk=divisors($kk,"0"); for($ss="0";lt($ss,$divkk);$ss=bcadd($ss,"1")){ $b=$divisor[$ss]; $a=bcdiv($kk,$b); if(le($a,"2") || le($b,"2") || ge($a,$b)){ continue; } $t=gcd($a,$b); if(eq($t,"1")){ $g=rootdovera($a,$k,$d); if(neqzero($g)){ # print "k=$k, d=$d, a=$a, b=$b
\n"; #print "



\n"; print "======================
\n"; $flag=1; } } } } return($flag); } ?> php/arithmetic.html0000644000175100017510000000232411625277355013676 0ustar keithkeith Arithmetical operations on integers

Arithmetical operations on integers


Enter a:

Enter b:

Select an operation:

Last modified 27th February 2004
Return to main page
php/arithmeticm.html0000644000175100017510000000224311625277364014053 0ustar keithkeith Arithmetical operations on integers

Modular arithmetical operations on integers


Enter a:
Enter b:
Enter m (> 1):
Select an operation:

Last modified 5th September 2002
Return to main page
php/arithmeticm.php0000644000175100017510000000403512747226320013667 0ustar keithkeith \n"; print "Return to main page
\n"; return; } if(le($Mvalue,"1")){ print "m ≤ 1
\n"; print "Return to main page
\n"; return; } switch ($OPERATION){ case "ADD"; $Result=bcadd($Avalue,$Bvalue); $Result=mod($Result,$Mvalue); print "$Avalue+($Bvalue) (mod $Mvalue)=$Result
\n"; break; case "SUBTRACT"; $Result=bcsub($Avalue,$Bvalue); $Result=mod($Result,$Mvalue); print "$Avalue-($Bvalue) (mod $Mvalue)=$Result
\n"; break; case "MULTIPLY"; $Result=bcmul($Avalue,$Bvalue); $Result=mod($Result,$Mvalue); print "$Avaluex($Bvalue) (mod $Mvalue)=$Result
\n"; break; case "1/A"; $temp=gcd($Avalue,$Mvalue); if(bccomp($temp,"1")>0){ print "gcd(a,m) > 1
\n"; }else{ $Result=inverse($Avalue,$Mvalue); print "1/($Avalue) (mod $Mvalue)=$Result
\n"; } break; case "POWER"; if(bccomp($Bvalue,"0")<0){ print "b < 0
\n"; }else{ $Result=mpower($Avalue,$Bvalue,$Mvalue); print "$Avalue$Bvalue (mod $Mvalue)=$Result
\n"; } break; case "B/A"; if(bccomp(gcd($Avalue,$Mvalue),"1")>0){ print "gcd(a,m) > 1
\n"; }else{ global $solution; $Result=cong($Avalue,$Bvalue,$Mvalue); print "$Bvalue/($Avalue) (mod $Mvalue)=$solution
\n"; } break; } print "

\n"; print "Return to main page
\n"; ?> php/arithmetic.php0000644000175100017510000000371112747224567013525 0ustar keithkeith \n"; return; } switch ($OPERATION){ case "ADD"; $Result=bcadd($Avalue,$Bvalue); print "$Avalue+$Bvalue=$Result
\n"; break; case "SUBTRACT"; $Result=bcsub($Avalue,$Bvalue); print "$Avalue-$Bvalue=$Result
\n"; break; case "MULTIPLY"; $Result=bcmul($Avalue,$Bvalue); print "$Avalue*$Bvalue=$Result
\n"; break; case "FLOORAB"; if(bccomp($Bvalue,"0")==0){ print "b = 0
\n"; }else{ $Result=int($Avalue,$Bvalue); print "integer part($Avalue/$Bvalue)=$Result
\n"; } break; case "AMODB"; if(bccomp($Bvalue,"1")<0){ print "b < 1
\n"; }else{ $Result=mod($Avalue,$Bvalue); print "$Avalue (mod $Bvalue)=$Result
\n"; } break; case "CEILAB"; if(bccomp($Bvalue,"0")==0){ print "b = 0
\n"; }else{ $Result=ceiling($Avalue,$Bvalue); print "ceil($Avalue/$Bvalue)=$Result
\n"; } break; case "POWER"; if(bccomp($Bvalue,"0")<0){ print "b < 0
\n"; }else if (bccomp($Bvalue,"100000")>0){ print "b > 100000
\n"; }else{ $Result=bcpow($Avalue,$Bvalue); print "$Avalue$Bvalue=$Result
\n"; } break; case "BINOMIAL"; if(bccomp($Bvalue,"0")<0){ print "b < 0
\n"; }else if (bccomp($Avalue,"10000")>0){ print "a > 10000
\n"; }else if (bccomp($Avalue,$Bvalue)<0){ print "a < b
\n"; }else{ $Result=binomial0($Avalue,$Bvalue); print "$AvalueC$Bvalue=$Result
\n"; } break; } print "

\n"; print "Return to main page
\n"; ?> php/arithpartition.php0000644000175100017510000000253513574621547014436 0ustar keithkeith\n"; $temp=bcdiv($m,$n); #printarray1($globaloutput_array,$temp); #print "
\n"; $globaloutput_array_number=$temp; return("0"); } ?> php/aubry_thue.html0000644000175100017510000001045611626066771013720 0ustar keithkeith Constructive version of the Aubry-Thue algorithm

Constructive version of the Aubry-Thue algorithm

Recall the Euclidean algorithm for m/n.

Here r0 = m > 0, r1 = n > 0,

r0=r1q1 + r2 (0 < r2 < r1)
r1=r2q2 + r3 (0 < r3 < r2)
···
rk-1=rkqk + rk+1 (0 < rk+1 < rk)
···
rl-1=rlql

Then rl = gcd(m,n).

The sk and tk are important:

s0 = 1, s1 = 0, sk = sk-2 - qk-1sk-1,
t0 = 0, t1 = 1, tk = tk-2 - qk-1tk-1, k = 2,...,l+1.

(In fact |sk| = Ak-2 and |tk| = Bk-2, where Ak/Bk is the kth convergent to m/n.)
Also the continued fraction for m/n is q1 + 1/q2 + ··· + 1/ql
The length l of the algorithm is printed.

Other properties of rk, sk and tk:

  1. qk ≥ 1 for 1 ≤ k ≤ l and ql ≥ 2 if m > n and n does not divide m;
  2. sk = (-1)k|sk|, tk = (-1)k+1|sk|;
  3. 0 = |s1| < 1 = |s2| < ··· < |sl+1|;
  4. 1 = |t1| ≤ |t2| < ··· < |tl+1|;
  5. rk = skm + tkn, 0 ≤ k ≤ l+1;
  6. m = |tk|rk-1 + |tk-1|rk, 1 ≤ k ≤ l+1;
  7. |sk| = |sk-2| + qk-1|sk-1|, |tk| = |tk-2| + qk-1|tk-1|, k = 2,...,l+1;
  8. sl+1 = (-1)l+1n/gcd(m,n), tl+1 = (-1)ln/gcd(m,n);
  9. If gcd(m,n) = 1, then |sl| ≤ n/2, |tl| ≤ m/2.
Theorem (L. Aubry, Un théorème d'arithmétique, Mathesis (4), Vol. 3 (1913), A. Thue 1902, I.M. Vinogradov 1926). Suppose gcd(m,n) = 1, m > n > 1. Then the congruence

nx ≡ y (mod m)

has a solution x, y satisfying

1 ≤ |x| < √m, 1 ≤ |y| ≤ √m,

namely (x,y) = (tk,rk), where rk-1 > √m ≥ rk.
(Hint: Use (6).)

See lecture notes for an application to Hermite-Serret's proof of p=x2+y2. Also used in the paper Thue's theorem and the diophantine equation x2-Dy2=±N, K.R. Matthews, Mathematics of Computation, 71 (2002), 1281-1286.

Enter m (> 0):
Enter n (n > 1, gcd(m,n)=1):
Last modified 3rd October 2007
Return to main page
php/aubry_thue_.php0000644000175100017510000000302711610600703013654 0ustar keithkeith php/aubry_thue.php0000644000175100017510000000223412747024502013525 0ustar keithkeith Constructive version of the Aubry-Thue theorem \n"; } else if(lezero($Mvalue)){ print "M ≤ 0
\n"; } else if(lezero($Nvalue)){ print "N ≤ 0
\n"; }else{ if(ge($Nvalue,$Mvalue)){ $Nvalue=mod($Nvalue,$Mvalue); } $g=gcd($Mvalue,$Nvalue); if(gt($g,"1")){ return; }else{ aubry_thue($Mvalue,$Nvalue); echo "The congruence $Nvalue x ≡ y (mod $Mvalue) has a solution (x, y) = ($tvalue, $rvalue) satisfying |x| < √ $Mvalue, |y| ≤ √ $Mvalue
\n"; } } print "

\n"; print "Return to main page
\n"; ?> php/axb.html0000644000175100017510000000475213163266110012310 0ustar keithkeith Solving a system of linear diophantine equations using the Hermite normal form of an integer matrix via the Havas-Majewski-Matthews LLL-based algorithm

Solving a system of linear diophantine equations using the Hermite normal form of an integer matrix via the Havas-Majewski-Matthews LLL-based algorithm

A is a nonzero m × n matrix of integers, b is m × 1 matrix, X is n × 1. We solve the system of linear diophantine equations AX = b:

a11x1+⋯+a1nxn=b1
.
.
.
am1x1+⋯+amnxn=bm

using the Hermite normal form algorithm. The version used is the LLL-based algorithm of Havas-Majewski-Matthews, as this tends to give small solutions in the case when there is more than one solution X in integers.
We determine if there is a solution in integers and exhibit a solution Y. If there is more than one solution, we find all solutions X with ||X|| ≤ ||Y|| and find the solutions X with minimal length, using a modification of the Fincke-Pohst algorithm. See the note.

We use LLL parameter α = 1.

The augmented matrix can be entered either (i) as a string of m(n+1) integers separated by spaces, or
(ii) cut and pasted from a text file, with entries separated by spaces and each row ended by a newline.
The case of zero coeffient matrix is not dealt with.

    Enter m, the number of equations (≤ 50):
    Enter n, the number of unknowns (≤ 50):
    Enter the m × (n+1) augmented matrix :

Last modified 3rd November 2011
Return to main page php/axbmodm.html0000644000175100017510000000675613477611632013206 0ustar keithkeith Solving a system of linear congruences using the Smith normal form (SNF) of an integer matrix

Solving a system of linear congruences using the Smith normal form (SNF) of an integer matrix

A is a nonzero m × n matrix of integers, B is m × 1, X is n × 1. We solve the system of linear congruences AX ≡ B (mod q):

a11x1 + ⋯ + a1nxn ≡ b1 (mod q)
.
.
.
am1x1 + ⋯ + amnxn ≡ bm (mod q)

using the Smith normal form of the integer matrix A.

P and Q are unimodular matrices such that PAQ = diag(d1,...,dr,0,...,0), where r = rank(A) and d1,...,dr are positive integers such that di divides di+1 for 1 ≤ i ≤ r-1.
Write X = QY and K = PB. Then AX ≡ B (mod q) is equivalent to the system of congrences

d1y1 ≡ k1 (mod q)
.
.
.
dryr ≡ kr (mod q)
0 ≡ kr+1 (mod q)
.
.
.
0 ≡ kn (mod q).

Assuming that the first r congruences are soluble (mod q) with solution arrays Y1,...,Yr of lengths c1,...,cr, where ci = gcd(di,q) and that the last n-r congruences are satisfied, we get the complete solution of the form
X = QY, where Y = [y1,...,yr,yr+1,...,yn]t, where yi = Yi,zi and yr+1,...,yn are arbitrary (mod q).

If r = n, we get c1···cr solutions (mod q), otherwise we get c1···crqn-r solutions (mod q).

The augmented matrix [A|B] can be entered either
(i) as a string of m(n+1) integers separated by spaces, or
(ii) cut and pasted from a text file, with entries separated by spaces and each row ended by a newline.

We assume that [A|B] is not the zero matrix (mod q).

The author is grateful to Alan Offer for programming assistance with the recursive construction of the cartesian product.

    Enter m, the number of equations (≤ 50):
    Enter n, the number of unknowns (≤ 50):
    Enter the modulus q (> 1):
    Enter the m × (n+1) augmented matrix :

Last modified 10th June 2015
Return to main page php/axbmodm.php0000644000175100017510000001017013477611662013015 0ustar keithkeith \n"; exit; } if(gt($rows,"50")){ print "row dimension is > 50
\n"; print "Return to main page
\n"; exit; } if(gt($cols,"50")){ print "column dimension is > 50
\n"; print "Return to main page
\n"; exit; } if(lt($rows,"1")){ print "row dimension is < 1
\n"; print "Return to main page
\n"; exit; } if(lt($cols,"1")){ print "column dimension is < 1
\n"; print "Return to main page
\n"; exit; } if(lt($q,"1")){ print "qmodulus is < 1
\n"; print "Return to main page
\n"; exit; } if(isset($_POST['matrix'])){ $matrix=$_POST['matrix']; }else{ return; } $matrix=trim($matrix); $a=preg_split('[ ]',$matrix); $t=count($a); if(le($t,"1")){ print "number of entries is less than or equal to 1
\n"; print "Return to main page
\n"; flush(); exit; } $cols=bcadd($cols,"1");/* Here $cols is the number of columns of the augmented matrix */ $size=bcmul($rows,$cols); if(lt($t,$size)){ print "number $t of entries is less than m × n = $size
\n"; print "Return to main page
\n"; flush(); exit; } if(gt($t,$size)){ print "number $t of entries is greater than m × n = $size
\n"; print "Return to main page
\n"; flush(); exit; } $flag="0"; for($i="0";lt($i,$t);$i=bcadd($i,"1")){ $check=check_decimal($a[$i]); if (ezero($check)){ print "

\n"; flush(); $flag="1"; break; } } if(ezero($flag)){ $ii="0"; for($i="1";le($i,$rows);$i=bcadd($i,"1")){ for($j="1";le($j,$cols);$j=bcadd($j,"1")){ $k=bcadd($ii,$j); $k=bcsub($k,"1"); $temp=mod($a[$k],$q); $mat[$i][$j]=$temp; } $ii=bcadd($cols,$ii); } $m=bcsub($cols,"1"); $t=test_zeromat($mat,$rows,$m); if(eq($t,"1")){ echo "Augmented matrix is the zero matrix (mod $q)
\n"; }else{ echo "Augmented matrix [A|B] ="; printmat1($mat,$rows,$cols); echo "
\n"; for($i="1";le($i,$rows);$i=bcadd($i,"1")){ $B[$i]["1"]=$mat[$i][$cols]; for($j="1";le($j,$m);$j=bcadd($j,"1")){ $A[$i][$j]=$mat[$i][$j]; } } $t=axbmodm($A,$B,$rows,$m,$q); if(ezero($t)){ print "There are no solutions (mod $q)
\n"; }else{ if(neqzero($colsminusrank)){ if(eq($t,"1")){ print "There is $t solution family (mod $q)
\n"; }else{ print "There are $t solution families (mod $q)
\n"; } }else{ if(eq($t,"1")){ print "There is $t solution (mod $q)
\n"; }else{ print "There are $t solutions (mod $q)
\n"; } } } } } print "

\n"; flush(); print "Return to main page
\n"; flush(); ?> php/axbmodq1dotqm.html0000644000175100017510000000761613241440334014320 0ustar keithkeith Solving a system of linear congruences with possibly differing moduli, using the Smith normal form (SNF) of an integer matrix

Solving a system of linear congruences with possibly differing moduli, using the Smith normal form (SNF) of an integer matrix

We solve the system of linear congruences:

a11x1 + ⋯ + a1nxn ≡ b1 (mod q1)
.
.
.
am1x1 + ⋯ + amnxn ≡ bm (mod qm)

Let q = lcm(q1,...,qm), q = qjrj, bij = aijri and cj = bjrj. Then we have the equivalent system of congruences

b11x1 + ⋯ + b1nxn ≡ c1 (mod q)
.
.
.
bm1x1 + ⋯ + bmnxn ≡ cm (mod q)

We use the Smith normal form of the integer matrix B.

P and Q are unimodular matrices such that PBQ = diag(d1,...,dr,0,...,0), where r = rank(B) and d1,...,dr are positive integers such that di divides di+1 for 1 ≤ i ≤ r-1.
Write X = QY and K = PC. Then we have the equivalent system of congrences

d1y1 ≡ k1 (mod q)
.
.
.
dryr ≡ kr (mod q)
0 ≡ kr+1 (mod q)
.
.
.
0 ≡ kn (mod q).

Assuming that the first r congruences are soluble (mod q) with solution arrays Y1,...,Yr of lengths e1,...,er, where ei = gcd(di,q) and that the last n-r congruences are satisfied, we get the complete solution of the form
X = QY, where Y = [y1,...,yr,yr+1,...,yn]t, where yi = Yi,zi and yr+1,...,yn are arbitrary (mod q).

If r = n, we get e1···er solutions (mod q), otherwise we get e1···erqn-r solutions (mod q).

The augmented matrix [A|B] can be entered either
(i) as a string of m(n+1) integers separated by spaces, or
(ii) cut and pasted from a text file, with entries separated by spaces and each row ended by a newline.

The author is grateful to Alan Offer for programming assistance with the recursive construction of the cartesian product.

    Enter m, the number of equations (≤ 50):
    Enter n, the number of unknowns (≤ 50):
    Enter the m moduli (separated by spaces):
    Enter the m × (n+1) augmented matrix :

Last modified 13th June 2015
Return to main page php/axbmodq1dotqm.php0000644000175100017510000001262612747003404014143 0ustar keithkeith \n"; exit; } $rows=trim($rows); $cols=trim($cols); $q=preg_split('[ ]',$moduli); $t=count($q); if(neq($t,$rows)){ print "number $t of moduli is not equal to number $rows of rows
\n"; return; } for($i="0";lt($i,$t);$i=bcadd($i,"1")){ $check=check_decimal($q[$i]); if (ezero($check)){ print "bad input
\n"; exit; } if(gtzero($i)){ $u=bccomp($q[$i],"0"); if(lezero($u)){ print "b[$i] <= 0
\n"; print "bad input
\n"; exit; } } } for($i="0";lt($i,$t);$i=bcadd($i,"1")){ $iplus1=bcadd($i,"1"); $mm[$iplus1]=$q[$i]; } print "lcm of moduli=lcm"; printarray($mm,$t); $qmodulus=lcma($q,$t); print "= $qmodulus
\n"; if(gt($rows,"50")){ print "row dimension is > 50
\n"; print "Return to main page
\n"; exit; } if(gt($cols,"50")){ print "column dimension is > 50
\n"; print "Return to main page
\n"; exit; } if(lt($rows,"1")){ print "row dimension is < 1
\n"; print "Return to main page
\n"; exit; } if(lt($cols,"1")){ print "column dimension is < 1
\n"; print "Return to main page
\n"; exit; } if(isset($_POST['matrix'])){ $matrix=$_POST['matrix']; }else{ return; } $matrix=trim($matrix); $a=preg_split('[ ]',$matrix); $t=count($a); if(le($t,"1")){ print "number of entries is less than or equal to 1
\n"; print "Return to main page
\n"; flush(); exit; } $cols=bcadd($cols,"1");/* Here $cols is the number of columns of the augmented matrix */ $size=bcmul($rows,$cols); if(lt($t,$size)){ print "number $t of entries is less than m × n = $size
\n"; print "Return to main page
\n"; flush(); exit; } if(gt($t,$size)){ print "number $t of entries is greater than m × n = $size
\n"; print "Return to main page
\n"; flush(); exit; } $flag="0"; for($i="0";lt($i,$t);$i=bcadd($i,"1")){ $check=check_decimal($a[$i]); if (ezero($check)){ print "

\n"; flush(); $flag="1"; break; } } if(ezero($flag)){ $ii="0"; for($i="1";le($i,$rows);$i=bcadd($i,"1")){ for($j="1";le($j,$cols);$j=bcadd($j,"1")){ $k=bcadd($ii,$j); $k=bcsub($k,"1"); $temp=mod($a[$k],$qmodulus); $mat[$i][$j]=$temp; } $ii=bcadd($cols,$ii); } $m=bcsub($cols,"1"); $t=test_zeromat($mat,$rows,$m); if(eq($t,"1")){ echo "adjusted augmented matrix [B|C] is the zero matrix (mod $qmodulus)
\n"; }else{ echo "adjusted augmented matrix [B|C] ="; printmat1($mat,$rows,$cols); echo "
\n"; for($i="1";le($i,$rows);$i=bcadd($i,"1")){ $B[$i]["1"]=$mat[$i][$cols]; for($j="1";le($j,$m);$j=bcadd($j,"1")){ $A[$i][$j]=$mat[$i][$j]; } } for($i="1";le($i,$rows);$i=bcadd($i,"1")){ $r[$i]=bcdiv($qmodulus,$mm[$i]); $B[$i]["1"]=bcmul($B[$i]["1"],$r[$i]); $B[$i]["1"]=mod($B[$i]["1"],$qmodulus); } for($i="1";le($i,$rows);$i=bcadd($i,"1")){ for($j="1";le($j,$m);$j=bcadd($j,"1")){ $A[$i][$j]=bcmul($A[$i][$j],$r[$i]); $A[$i][$j]=mod($A[$i][$j],$qmodulus); } } $t=axbmodm($A,$B,$rows,$m,$qmodulus); if(ezero($t)){ print "There are no solutions (mod $qmodulus)
\n"; }else if(eq($t,"-1")){ print "greater than 1000 solutions arising from cartesian product
\n"; }else{ if(neqzero($colsminusrank)){ if(eq($t,"1")){ print "There is $t solution family (mod $qmodulus)
\n"; }else{ print "There are $t solution families (mod $qmodulus)
\n"; } }else{ if(eq($t,"1")){ print "There is $t solution (mod $qmodulus)
\n"; }else{ print "There are $t solutions (mod $qmodulus)
\n"; } } } } } print "

\n"; flush(); print "Return to main page
\n"; flush(); ?> php/axb.php0000644000175100017510000000574012746777351012155 0ustar keithkeith "; print_r($_POST); echo ""; if(isset($_POST['rows'])){ $rows=$_POST['rows']; }else{ return; } if(isset($_POST['cols'])){ $cols=$_POST['cols']; }else{ return; } $rows=trim($rows); $cols=trim($cols); $check1=check_decimal($rows); $check2=check_decimal($cols); if ($check1=="0" || $check2=="0"){ print "

\n"; exit; } if(gt($rows,"50")){ print "row dimension is > 50
\n"; print "Return to main page
\n"; exit; } if(gt($cols,"50")){ print "column dimension is > 50
\n"; print "Return to main page
\n"; exit; } if(lt($rows,"1")){ print "row dimension is < 1
\n"; print "Return to main page
\n"; exit; } if(lt($cols,"1")){ print "column dimension is < 1
\n"; print "Return to main page
\n"; exit; } if(isset($_POST['matrix'])){ $matrix=$_POST['matrix']; }else{ return; } $matrix=trim($matrix); $a=preg_split('[ ]',$matrix); $t=count($a); if(le($t,"1")){ print "number of entries is less than or equal to 1
\n"; print "Return to main page
\n"; flush(); exit; } $cols=bcadd($cols,"1");/* Here $cols is the number of columns of the augmented matrix */ $size=bcmul($rows,$cols); if(lt($t,$size)){ print "number $t of entries is less than m × n = $size
\n"; print "Return to main page
\n"; flush(); exit; } if(gt($t,$size)){ print "number $t of entries is greater than m × n = $size
\n"; print "Return to main page
\n"; flush(); exit; } $flag="0"; for($i="0";lt($i,$t);$i=bcadd($i,"1")){ $check=check_decimal($a[$i]); if (ezero($check)){ print "

\n"; flush(); $flag="1"; break; } } if(ezero($flag)){ $ii="0"; for($i="1";le($i,$rows);$i=bcadd($i,"1")){ for($j="1";le($j,$cols);$j=bcadd($j,"1")){ $k=bcadd($ii,$j); $k=bcsub($k,"1"); $mat[$i][$j]=$a[$k]; } $ii=bcadd($cols,$ii); } $m=bcsub($cols,"1"); $t=test_zeromat($mat,$rows,$m); if(eq($t,"1")){ echo "Coeffficient matrix is the zero matrix
\n"; }else{ echo "Augmented matrix [A|B]="; printmat1($mat,$rows,$cols); echo "
\n"; $transposed=transpose($mat,$rows,$cols); $m1="1"; $n1="1"; axb($transposed,$m,$rows,$m1,$n1); echo "
\n"; } } print "

\n"; flush(); print "Return to main page
\n"; flush(); ?> php/b2plus3bcplusc2.html0000644000175100017510000000440412530552147014465 0ustar keithkeith Representing a prime p=5n ± 1 as x<sup>2</sup> + 3xy + y<sup>2</sup>, where x > y ≥ 1

Representing a prime p=5n ± 1 as x2 + 3xy + y2, where x > y ≥ 1

The underlying algorithm was published in New algorithms for modular inversion and representation by binary quadratic forms arising from structure in the Euclidean algorithm, Christina Doran, Shen Lu and Barry R. Smith.

First find the solution v of the congruence v2 + v - 1 ≡ 0 (mod p), where v < p/2.
Then perform the Euclidean algorithm with p and v.
The length of the Euclidean algorithm is 2s + 1 and the sequence of quotients has the form

q1, … , qs-1, qs + (-1)s+1, 1, qs, qs-1, … , q1.

Then rs+1 is the first remainder less than √(p/5) and rs-1 = rs + rs+1. Also The representation in positive integers x and y with x > y, is unique.

This is a BCmath version of a BC program.

Enter p (a prime of the form 5n + 1 or 5n – 1):

Last modified 22nd May 2015
Return to main page php/b2plus3bcplusc2_.php0000644000175100017510000000532612530533460014450 0ustar keithkeith0=$a
\n"; $r["1"]=$b=$n; print "r1=$b
\n"; $r["2"]=$c=bcmod($a,$b); while(gtzero($c)){ $iplus1=bcadd($i,"1"); $iplus2=bcadd($i,"2"); print "r$iplus2=$r[$iplus2]
\n"; $t=bcmul3("5",$c,$c); if(lt($t,$p)){ $temp=bcmul($b,$b); $temp1=bcmul($b,$c); $temp=bcadd($temp,$temp1); $temp1=bcmul($c,$c); $temp=bcsub($temp,$temp1); if(eq($p,$temp)){ print "$p = b2 + bc - c2, where b = r$iplus1 = $b, c = r$iplus2 = $c
\n"; } $temp=bcadd($b,$c); $temp2=bcmul($temp,$temp); $temp1=bcmul($temp,$c); $temp3=bcadd($temp2,$temp1); $temp1=bcmul($c,$c); $temp4=bcsub($temp3,$temp1); if(eq($p,$temp4)){ print "$p = b2 + bc - c2, where b = r$iplus1 + r$iplus2 = $temp, c = r$iplus2 = $c
\n"; } $temp=bcmul($b,$b); $temp1=bcmul3("3",$b,$c); $temp=bcadd($temp,$temp1); $temp1=bcmul($c,$c); $temp=bcadd($temp,$temp1); if(eq($p,$temp)){ print "$p = b2 + 3bc + c2, where b = r$iplus1 = $b, c = r$iplus2 = $c
\n"; } $temp=bcsub($b,$c); $t1=bcmul($temp,$temp); $t2=bcmul3("3",$temp,$c); $t3=bcmul($c,$c); $t=bcadd3($t1,$t2,$t3); if(eq($p,$t)){ print "$p = b2 + 3bc + c2, where b = r$iplus1 - r$iplus2 = $temp, c = r$iplus2 = $c
\n"; } $temp=aplusbc("1","2",$i); print "length of Euclid's algorithm is 2s+1=$temp
\n"; return; } $a=$b; $b=$c; $c=bcmod($a,$b); $iplus3=bcadd($i,"3"); $r[$iplus3]=$c; $i=bcadd($i,"1"); } } ?> php/b2plus3bcplusc2.php0000644000175100017510000000127612747037117014321 0ustar keithkeith \n"; } else if(le($Mvalue,"1")){ print "p <= 1
\n"; } else if(ezero(lucas($Mvalue,"0"))){ print "p is not a prime
\n"; } else if(neq(bcmod($Mvalue,"5"),"1") && neq(bcmod($Mvalue,"5"),"4")){ print "p is not congruent to ±1 (mod 5)
\n"; } else { rep($Mvalue); } print "

\n"; print "Return to main page
\n"; ?> php/barina8.html0000644000175100017510000000454313326520012013053 0ustar keithkeith David Barina's 7x+1 conjecture

David Barina's mod 8 conjecture

The iterates x, t(x), t(t(x)),... of the mapping

t(x) = 5x+1 if x ≡ -1 (mod 8)
t(x) = 5x-1 if x ≡ 1 (mod 8)
t(x) = ⌊x/2⌋ otherwise

are conjectured to eventually reach 1 if x > 0, or one of -1 or -31 if x < 0.

This phenomenon was communicated to Keith Matthews by David Barina on July 13, 2018.

The mapping can be regarded as an 8-branched example of type (b).

Here Q(8) has the zero class as a transient class and the submatrix formed by deleting rows 1 and column 1 has stationary vector (1/23)×(3,4,2,5,3,4,2).

The corresponding weighted product is 53/23(1/2)4/23(1/2)2/23(1/2)5/23(1/2)3/23(1/2)4/2352/23 < 1

⇔ (1/2)(4+2+5+3+4)/2355/23 < 1

⇔ 55 < 218 ⇔ 3125 < 262144,

thereby predicting everywhere eventual cycling. The cycles found are

Enter x (≠ 0):

Last modified 27th July 2018
Return to main page php/barina8_.php0000644000175100017510000000273113323333313013035 0ustar keithkeith$y\n
"; flush(); $x=$y; for($i="0";gezero($i);$i=bcadd($i,"1")){ if(eq($x,"1")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 1 is $i\n
"; flush(); return; } if(eq($x,"-1")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -1 is $i\n
"; flush(); return; } if(eq($x,"1")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -1 is $i\n
"; flush(); return; } if(eq($x,"-31")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -1 is $i\n
"; flush(); return; } $x=t($x); print "$x\n
"; flush(); } } ?> php/barina8.php0000644000175100017510000000120713323333267012703 0ustar keithkeith \n"; print "Return to main page
\n"; return; } else { if(ezero($x)){ print "x = 0
\n"; print "Return to main page
\n"; return; }else{ s($x); } } print "

\n"; print "Return to main page
\n"; return; ?> php/barina.html0000644000175100017510000000423313326517672013001 0ustar keithkeith David Barina's 7x+1 conjecture

David Barina's 7x+1 conjecture

The iterates x, t(x), t(t(x)),... of the mapping

t(x) = 7x+1 if x ≡ 1 (mod 4)
t(x) = 7x-1 if x ≡ -1 (mod 4)
t(x) = x/2 if x ≡ 0 (mod 2)

are conjectured to eventually reach 1 if x > 0, or -1 if x < 0.

This remarkable phenomenon was communicated to Keith Matthews by David Barina on July 6, 2018. See his paper for an heuristic explanation of this phenomenon.

We remark that the iterates of -x are the negative of the iterates of x, so it is enough to consider positive starting values x.

The mapping can be regarded as a 4-branched example of type (b). Here the associated Markov matrix Q(4) has stationary vector (1/2, 1/8, 1/4, 1/8) and we have the inequality

(1/2)1/2 71/8 (1/2)1/4 71/8 < 1,

thereby predicting everywhere eventual cycling.

Enter x (≠ 0):

Last modified 27th July 2018
Return to main page php/barina_.php0000644000175100017510000000214013320071050012731 0ustar keithkeith$y\n
"; flush(); $x=$y; for($i="0";gezero($i);$i=bcadd($i,"1")){ if(eq($x,"1")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 1 is $i\n
"; flush(); return; } if(eq($x,"-1")){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -1 is $i\n
"; flush(); return; } $x=t($x); print "$x\n
"; flush(); } } ?> php/barina.php0000644000175100017510000000120313320070755012604 0ustar keithkeith \n"; print "Return to main page
\n"; return; } else { if(ezero($x)){ print "x = 0
\n"; print "Return to main page
\n"; return; }else{ s($x); } } print "

\n"; print "Return to main page
\n"; return; ?> php/base.html0000644000175100017510000000171511625277373012462 0ustar keithkeith Finding the base b expansion of a positive integer n.

Finding the base b expansion of a positive integer n

This is a BCMATH version of the BC program base.

Enter b (> 1):
Enter a positive integer n:

Last modified 26th July 2011
Return to main page php/base_.php0000644000175100017510000000233512211741767012436 0ustar keithkeith\n"; flush(); $i=bcadd($i,"1"); print " are the base $b digits of $x
\n"; return($i); } function base1($b,$n,$e){ global $basedigits; global $nonzerodigitcount; $i="0"; $nonzerodigitcount="0"; while(ge($n,$b)){ $q=bcdiv($n,$b); $temp=bcmul($q,$b); $t=bcsub($n,$temp); $basedigits[$i]=$t; if(neqzero($t)){ $nonzerodigitcount=bcadd($nonzerodigitcount,"1"); } $n=$q; $i=bcadd($i,1); } $basedigits[$i]=$n; if(neqzero($n)){ $nonzerodigitcount=bcadd($nonzerodigitcount,"1"); } if(neqzero($e)){ for($j="0";le($j,$i);$j=bcadd($j,"1")){ print "basedigits[$j]=$basedigits[$j],"; } print "
\n"; } $i=bcadd($i,1); return($i); } ?> php/base.php0000655000175100017510000000142612746527574012314 0ustar keithkeith \n"; } else if(le($Bvalue,"1")){ print "b <= 1
\n"; } else if(lt($Nvalue,"0")){ print "n < 0
\n"; } else { $i=base($Bvalue,$Nvalue); print "There are $i digits
\n"; } print "

\n"; print "Return to main page
\n"; ?> php/bernoulli_numbers.html0000644000175100017510000000262412301302546015255 0ustar keithkeith Calculating Bernoulli numbers

Calculating Bernoulli numbers

The Bernoulli numbers Bj, j ≥ 2, j even, can be defined in terms of the tangent numbers Tj/2:

        

See BC code based on Richard Brent's slides Computing Bernoulli and Tangent numbers.
Also see a paper by Donald Knuth and Thomas J. Buckholtz and The Bernoulli page.

Enter n (0 ≤ n ≤ 2000):

Last modified 9th July 2011
Return to main page php/bernoulli_numbers_.php0000644000175100017510000000261111574526166015254 0ustar keithkeith= 2, n even. See slides by Richard Brent at http://maths.anu.edu.au/~brent/talks.html B[0]=1, B[1]=-1/2, B[2m+1]=0 if m >= 1, B[2m]=(-1)^(m-1)*2m*T[m]/2^m*(2^m-1) if m >= 1. Also see http://www.bernoulli.org/ */ function bernoulli($n){ global $global_denominator_rows; global $global_numerator_rows; global $global_numerator; global $global_denominator; global $global_numerator_len; global $global_denominator_len; $t=bcdiv($n,"2"); $tminus1=bcsub($t,"1"); $s=bcpow("-1",$tminus1); $temp1=tangent($t); $temp=bcmul($n,$temp1); $global_numerator=bcmul($s,$temp); $k=bcpow("2",$n); $kminus1=bcsub($k,"1"); $global_denominator=bcmul($k,$kminus1); $g=gcd($temp,$global_denominator); $global_numerator=int($global_numerator,$g); $global_denominator=bcdiv($global_denominator,$g); $global_numerator_len=len($global_numerator); $global_denominator_len=len($global_denominator); $temp=bcdiv($global_numerator_len,"100"); $global_numerator_rows=$temp; $global_numerator_rows=bcadd($temp,"1"); $temp=bcdiv($global_denominator_len,"100"); $global_denominator_rows=$temp; $global_denominator_rows=bcadd($temp,"1"); $signbn=sign($global_numerator); $global_numerator=bcabs($global_numerator); return($signbn); } ?> php/bernoulli_numbers.php0000644000175100017510000000427512747021160015110 0ustar keithkeith Computing the n-th Bernoulli number \n"; } else if(lt($nvalue,"0")){ print "n < 0
\n"; } else if(bccomp($nvalue,"2000")>0){ print "n > 2000
\n"; } else{ $n=$nvalue; if(ezero($n)){ print "B$n= 1
\n"; }else if(eq($n,"1")){ print "B$n= -1/2
\n"; }else if(gt($n,"1")){ $r=bcmod($n,"2"); if(neqzero($r)){ print "B$n= 0
\n"; }else{ global $global_denominator_rows; global $global_numerator_rows; global $global_numerator; global $global_denominator; global $global_numerator_len; global $global_denominator_len; $signbn=bernoulli($n); print "B$nvalue = "; flush(); $r=bcadd($global_numerator_rows,global_denominator_rows); $r=bcadd($r,"1"); if(eq($signbn,"-1")){ print "-"; } print ""; flush(); print "
\n"; flush(); $s=$global_numerator_len; if(eq($s,"1")){ print "The numerator has $global_numerator_len digit
\n"; }else{ print "The numerator has $global_numerator_len digits
\n"; } flush(); $s=$global_denominator_len; if(eq($s,"1")){ print "The denominator has $global_denominator_len digit
\n"; }else{ print "The denominator has $global_denominator_len digits
\n"; } flush(); } } } print "Return to main page
\n"; flush(); ?> php/bernoulli.png0000644000175100017510000000275412303454330013347 0ustar keithkeithPNG  IHDR)-Q0PLTE/ݠ{tRNS~Pj8':\IDATXGX]hUvvfN`JV)>lTu"%4ʤkDE&B-P  H֊JCOö"Jhj{oݙ;{r9g_ ־86oY-^x0pE/رzq#8B@ I gǦ+}g/c+.9y(HWq ` E`shCN1OF*-^řW }@dOUlB, [/AN6?'mc(QfVVr[U#Ewhڛs;:]uBq4Y\1H$Ss'K&մB=-W57>|6^Gq%>hnur[DZ,~ClGHQ+& §\7z[rSQz 1Nz+'d;*&?nytD6QbRa>]V7C}/Nd!s0 h'cGZ_.I@: RG s=85KIq_Ֆ=AȦɨԏ`O q'  >LQ(~V׼-7dXЃRKy0l(v?#t竻FwNDͯ+kT2Y$6tyۋ#ϴT%[ʰϠ 9ج#1&Ec+2T͉YUYDYi8u!XdPVå24l)Sk[OH{Qխ1ڼo ZXt=̜ʪEe[mҔ Yy¯ͬ|2LN|ڼELvS"HU.bOn|$;Oe' gdynJ"U^iyOZ\&G/W=++״) ͔m-dKuH+ZVSQ708E0"j+"" _vtnedGW_Aݔ@~aHDZqPGt#eʰ/?OCt ee p!10-e oӽpu!}vAu';YuQ{N#N*;(ӽA77sIENDB`php/bigu.html0000644000175100017510000000272113654706311012465 0ustar keithkeith Solving the diophantine equation ax<sup>2</sup> + bxy + cy<sup>2</sup> + dx + ey +f = 0, where b<sup>2</sup> - 4ac > 0 is not a perfect square

Solving the diophantine equation ax2 + bxy + cy2 + dx + ey +f = 0, where b2 - 4ac > 0 is not a perfect square.


This program is described in a note being prepared. It uses a transformation due to Legendre 1798,

This is a BCMath version of BC function bigu(a,b,c,d,e,f,printflag) contained in bigu.

Enter a:
Enter b:
Enter c:
Enter d:
Enter e:
Enter f:

Last modified 3rd March 2020
Return to main page php/biguimproved_.php0000644000175100017510000004345613743443014014224 0ustar keithkeith\n"; return("0"); } $a=bcdiv($a,$g); $b=bcdiv($b,$g); $c=bcdiv($c,$g); $d=bcdiv($d,$g); $e=bcdiv($e,$g); $f=bcdiv($f,$g); $fourac=bcmul3("4",$a,$c); $bsquared=bcmul($b,$b); $delta1=bcsub($bsquared,$fourac); print "Δ1 = b2 – 4ac = $delta1
\n"; $temp=sqtest($delta1); if(gezero($temp)){ print "discriminant is a square
\n"; return("-1"); } $s=fund4($delta1,"0"); $t1=$globalx; $u1=$globaly; #print "(t1,u1)=($t1,$u1)
\n"; print "least positive solution of u2 - $delta1​v2 = 4: (φ11)=($t1,$u1)
\n"; if(ezero($d) && ezero($e)){ $f=bcminus($f); $g=binaryviasfs($a,$b,$c,$f,"0"); if(ezero($g)){ print "There are no integer solutions of the transformed equation
\n"; return("0"); } $u='u'; $v='v'; $twoa=bcmul("2",$a); $twoc=bcmul("2",$c); for($i="0";lt($i,$g);$i++){ $aa=$globalbinaryviastoltx[$i]; $bb=$globalbinaryviastolty[$i]; print "Fundamental solution [$i]: ($aa, $bb)
\n"; $temp1=abpluscd($b,$aa,$twoc,$bb); $temp1=bcminus($temp1); print "x = ("; printaxplusby($aa,$u,$temp1,$v); print ")/2
\n"; $temp2=abpluscd($b,$bb,$twoa,$aa); print "y = ("; printaxplusby($bb,$u,$temp2,$v); print ")/2
\n"; } $fourac=bcmul3("4",$a,$c); $bsquared=bcmul($b,$b); $d=bcsub($bsquared,$fourac); print " where u2 – $d v2 = 4
\n"; $x='x'; $y='y'; print "The diophantine equation "; printbinaryform($a,$b,$c,$x,$y); print " = $f
\n"; if(eq($g,"1")){ print " has one solution family
\n"; }elseif(gt($g,"1")){ print " has $g solution families
\n"; } return($g); } $twoa=bcmul("2",$a); $twoc=bcmul("2",$c); $alpha=abminuscd($twoc,$d,$b,$e); $beta=abminuscd($twoa,$e,$b,$d); print "α = $alpha, β = $beta
\n"; print "$delta1​x = "; $X='X'; $Y='Y'; printxplusa($X,$alpha); print "
\n"; print "$delta1​y = "; printxplusa($Y,$beta); print "
\n"; $temp1=bcmul3($a,$e,$e); $temp2=bcmul3($b,$e,$d); $temp2=bcminus($temp2); $temp3=bcmul3($c,$d,$d); $temp4=bcmul($f,$delta1); $temp=bcadd4($temp1,$temp2,$temp3,$temp4); $temp=bcmul($delta1,$temp); $k=bcminus($temp); #------------------------------------------------------------------------ # Now to divide a,b,c,k by gcd(a,b,c) $t=gcd3($a,$b,$c); $A=bcdiv($a,$t); $B=bcdiv($b,$t); $C=bcdiv($c,$t); $N=bcdiv($k,$t); print "equation transforms to
\n"; print "AX2 + BXY + CY2 = N,
\n"; print "where A = a/g, B = b/g, C = c/g, g = gcd(a,b,c), and
\n"; print " N = -Δ1(ae2 - bde + cd2 + fΔ1)/g
\n"; print "i.e., "; printbinaryform($A,$B,$C,$X,$Y); print " = $N
\n"; if(ezero($N)){ $temp1=bcmod($alpha,$delta1); $temp2=bcmod($beta,$delta1); if(ezero($temp1) && ezero($temp2)){ $uniquesolutionx=bcdiv($alpha,$delta1); $uniquesolutiony=bcdiv($beta,$delta1); print "($uniquesolutionx,$uniquesolutiony) is a solution to the original equation
\n"; return("-1"); }else{ return("0"); } } $fourAC=bcmul3("4",$A,$C); $Bsquared=bcmul($B,$B); $delta2=bcsub($Bsquared,$fourAC); print "Δ2 = B2 – 4AC = $delta2
\n"; $s=fund4($delta2,"0"); $t2=$globalx; $u2=$globaly; print "least positive solution of u2 - $delta2​v2 = 4 is (u1,v1)=($t2,$u2)
\n"; $u11temp=aminusbc($t2,$B,$u2); $u11=bcdiv($u11temp,"2"); $u12temp=bcmul($C,$u2); $u12=bcminus($u12temp); $u21=bcmul($A,$u2); $u22temp=aplusbc($t2,$B,$u2); $u22=bcdiv($u22temp,"2"); print "UL = ((u1 - B​v1)/2, -C​v1, A​v1, ((u1 + B​v1))/2) = ($u11, $u12, $u21, $u22)
\n"; $count="0"; $g=binaryviasfs($A,$B,$C,$N,$printflag); if(ezero($g)){ print "There are no solutions of the transformed equation
\n"; return($count); }else{ print "There are g = $g fundamental solutions (Xh, Yh), 0 ≤ h < g, of "; $X='x'; $Y='y'; printbinaryform($A,$B,$C,$X,$Y); print " = $N:
\n"; for($h="0";lt($h,$g);$h++){ print "($globalbinaryviastoltx[$h], $globalbinaryviastolty[$h]), "; } } print "
\n"; $k="0"; $powerof2="1"; while("1"){ $k=bcadd($k,"1"); $null=powerdd($t2,$u2,$delta2,$k); $temp=bcdiv($zed1,$powerof2); if(eq($temp,$t1)){ break; } $powerof2=bcmul($powerof2,"2"); } $twok=bcmul("2",$k); print "kL = $twok
\n"; print "((u1 + v1√Δ2)/2)kL/2 ="; print " ((u1 + v1√Δ2)/2)$k ="; print " (φ1 + ψ1√Δ1)/2
\n"; $twokminus1=bcsub($twok,"1"); if(eq($flag,"1")){ print "twokminus1=$twokminus1
\n"; } print "testing ±ULt(Xh,Yh)t, 0 ≤ h < g = $g and 0 ≤ t ≤ kL – 1 = $twokminus1 gives
\n"; #print "


"; $merge="0"; for($h="0";lt($h,$g);$h++){ #print "X[$h],Y[$h]
\n"; $gamma=$globalbinaryviastoltx[$h]; $epsilon=$globalbinaryviastolty[$h]; if(eq($flag,"1")){ print "processing (X[$h],Y[$h])=($gamma,$epsilon):
\n"; } for($t="0";le($t,$twokminus1);$t++){ if(eq($flag,"1")){ print "testing UL$t(X$h,Y$h)t:
\n"; } $e1[$t]="0"; $tt=test($gamma,$epsilon,$alpha,$beta,$delta1); if(eq($tt,"1")){ if(eq($flag,"1")){ print "option 1
\n"; } $hindex[$count]=$h; $e1[$t]="1"; $solutionx[$count]=$globalhyperbolasolutionx; $solutiony[$count]=$globalhyperbolasolutiony; $solutione1x[$t]=$solutionx[$count]; $solutione1y[$t]=$solutiony[$count]; $tcount[$count]=$t; $sign[$count][$h]="1"; #print "solution ($solutionx[$count],$solutiony[$count])
\n"; #print " $delta1(x,y)t = U$t+$twok n($globalbinaryviastoltx[$h],$globalbinaryviastolty[$h])t + ($alpha,$beta)t, n ∈ ℤ
\n"; $count++; } $x=bcminus($gamma);$y=bcminus($epsilon); if(eq($flag,"1")){ print "testing -U$t(X[$h],Y[$h])t:
\n"; } $e2[$t]="0"; $tt=test($x,$y,$alpha,$beta,$delta1); if(eq($tt,"1")){ if(eq($flag,"1")){ print "option 2
\n"; } $hindex[$count]=$h; $e2[$t]="1"; $solutionx[$count]=$globalhyperbolasolutionx; $solutiony[$count]=$globalhyperbolasolutiony; $solutione2x[$t]=$solutionx[$count]; $solutione2y[$t]=$solutiony[$count]; $sign[$count][$h]="-1"; $tcount[$count]=$t; #print "solution ($solutionx[$count],$solutiony[$count])
\n "; #print " $delta1(x,y)t = -U$t+$twok n($globalbinaryviastoltx[$h],$globalbinaryviastolty[$h])t + ($alpha,$beta)t, n ∈ ℤ
\n"; $count++; } # if(eq($e1[$t],"1") || eq($e2[$t],"1")){ # print "e2[$t]=$e2[$t], e2[$t]=$e2[$t], h=$h
\n"; # } #($gamma,$epsilon)^t = U($gamma,$epsilon)^t $tempgamma=abpluscd($u11,$gamma,$u12,$epsilon); $epsilon=abpluscd($u21,$gamma,$u22,$epsilon); $gamma=$tempgamma; }#end of for $t for($r="0";lt($r,$k);$r++){ if(eq($e1[$r],"1") || eq($e2[$r],"1")){# investigating merge possibility $temp=bcadd($r,$k); if(eq($e1[$r],"1") && eq($e1[$temp],"1") && eq($e2[$r],"1") && eq($e2[$temp],"1")){ print "solution ($solutione1x[$r],$solutione1y[$r])
\n "; print "  $delta1(xn,yn)t = UL"; printexponent($k,$r); print "($globalbinaryviastoltx[$h],$globalbinaryviastolty[$h])t + ($alpha,$beta)t, n ∈ ℤ
\n"; print "solution ($solutione2x[$r],$solutione2y[$r])
\n "; print "  $delta1(xn,yn)t = -UL"; printexponent($k,$r); print "($globalbinaryviastoltx[$h],$globalbinaryviastolty[$h])t + ($alpha,$beta)t, n ∈ ℤ
\n"; $merge="1"; continue; } if(eq($e1[$r],"1") && eq($e1[$temp],"1")){ print "solution ($solutione1x[$r],$solutione1y[$r])
\n "; print "  $delta1(xn,yn)t = UL"; printexponent($k,$r); print "($globalbinaryviastoltx[$h],$globalbinaryviastolty[$h])t + ($alpha,$beta)t, n ∈ ℤ
\n"; $merge="1"; } if(eq($e1[$r],"1") && eq($e2[$temp],"1")){ print "solution ($solutione1x[$r],$solutione1y[$r])
\n "; print "  $delta1(xn,yn)t = (-1)nUL"; printexponent($k,$r); print "($globalbinaryviastoltx[$h],$globalbinaryviastolty[$h])t + ($alpha,$beta)t, n ∈ ℤ
\n"; $merge="-1"; } if(eq($e2[$r],"1") && eq($e1[$temp],"1")){ print "solution ($solutione2x[$r],$solutione2y[$r])
\n "; print "  $delta1(xn,yn)t = (-1)n+1UL"; printexponent($k,$r); print "($globalbinaryviastoltx[$h],$globalbinaryviastolty[$h])t + ($alpha,$beta)t, n ∈ ℤ
\n"; $merge="-1"; } if(eq($e2[$r],"1") && eq($e2[$temp],"1")){ print "solution ($solutione2x[$r],$solutione2y[$r])
\n "; print "  $delta1n(x,yn)t = -UL"; printexponent($k,$r); print "($globalbinaryviastoltx[$h],$globalbinaryviastolty[$h])t + ($alpha,$beta)t, n ∈ ℤ
\n"; $merge="1"; } }#end of investigating merge possibility }#end of r for loop #print "end of h=$h
\n"; #print "
"; }#end of first for $h if(ezero($merge)){ for($j="0";lt($j,$count);$j++){ #print "(solutionx[$j],solutiony[$j])=($solutionx[$j],$solutiony[$j]), hindex[$j]=$hindex[$j]
\n"; $temp=$hindex[$j]; $temp1=$sign[$j][$temp]; print "solution ($solutionx[$j],$solutiony[$j])
\n "; if(eq($temp1,"1")){ print " $delta1(xn,yn)t = U"; }else{ print " $delta1(xn,yn)t = -U"; } printexponent($twok,$tcount[$j]); print "($globalbinaryviastoltx[$temp],$globalbinaryviastolty[$temp])t + ($alpha,$beta)t, n ∈ ℤ
\n"; } } if(ezero($count)){ print "no solutions of the transformed equation yielded solutions
\n"; return("0"); } # Now to create U^k $u11temp=aminusbc($t1,$b,$u1); $u11=bcdiv($u11temp,"2"); $u12temp=bcmul($c,$u1); $u12=bcminus($u12temp); $u21=bcmul($a,$u1); $u22temp=aplusbc($t1,$b,$u1); $u22=bcdiv($u22temp,"2"); #print "U = ($u11,$u12,$u21,$u22)
\n"; if(ezero($merge)){ # Now to create U^2k $temp=bcmul($u11,$u11); $v11=aplusbc($temp,$u12,$u21); $v12=abpluscd($u11,$u12,$u12,$u22); $v21=abpluscd($u21,$u11,$u22,$u21); $temp=bcmul($u22,$u22); $v22=aplusbc($temp,$u21,$u12); print "UkL = UL$twok "; print " = ((φ2 - bψ2)/2, -cψ2, aψ2, (φ2 + bψ2)/2)
\n"; print "  = ($v11,$v12,$v21,$v22)
\n"; $temp=abpluscd($v11,$alpha,$v12,$beta); $temp1=bcminus($temp); $temp1=bcadd($temp1,$alpha); $aa=bcdiv($temp1,$delta1); print " The solutions satisfy the recurrence relations
\n"; print "xn+1 = $v11 xn "; plusminus($v12); print " yn "; plusminus($aa); print "
\n"; $temp=abpluscd($v21,$alpha,$v22,$beta); $temp1=bcminus($temp); $temp1=bcadd($temp1,$beta); $bb=bcdiv($temp1,$delta1); print "yn+1 = $v21 xn "; plusminus($v22); print " yn "; plusminus($bb); print "
\n"; # Now for the inverse recurrence relations $aaa=abminuscd($v12,$bb,$v22,$aa); $bbb=abminuscd($v21,$aa,$v11,$bb); print "and inverse:
\n"; print "xn = $v22 xn+1 "; $minusv12=bcminus($v12); plusminus($minusv12); print " yn+1 "; plusminus($aaa); print "
\n"; $minusu21=bcminus($v21); print "yn = $minusu21 xn+1 "; plusminus($v11); print " yn+1 "; plusminus($bbb); print "
\n"; # print "n ≥ 0
\n"; print "

"; } if(eq($merge,"1")){# we are using U instead of U^2 print "ULkL = UL$kL = ($u11,$u12,$u21,$u22)
\n"; $temp=abpluscd($u11,$alpha,$u12,$beta); $temp1=bcminus($temp); $temp1=bcadd($temp1,$alpha); $aa=bcdiv($temp1,$delta1); print " The solutions satisfy the recurrence relations
\n"; print "xn+1 = $u11​xn "; plusminus($u12); print "yn "; plusminus($aa); print "
\n"; $temp=abpluscd($u21,$alpha,$u22,$beta); $temp1=bcminus($temp); $temp1=bcadd($temp1,$beta); $bb=bcdiv($temp1,$delta1); print "yn+1 = $u21​xn "; plusminus($u22); print "yn "; plusminus($bb); print "
\n"; $aaa=abminuscd($u12,$bb,$u22,$aa); $bbb=abminuscd($u21,$aa,$u11,$bb); print "and inverse:
\n"; print "xn = $u22​xn+1 "; $minusu12=bcminus($u12); plusminus($minusu12); print "yn+1 "; plusminus($aaa); print "
\n"; $minusu21=bcminus($u21); print "yn = $minusu21​xn+1 "; plusminus($u11); print "yn+1 "; plusminus($bbb); print "
\n"; # print "n ≥ 0
\n"; print "

"; } if(eq($merge,"-1")){# we are using -U instead of U^2 print "ULkL/2 = UL$k = ($u11,$u12,$u21,$u22)
\n"; $temp=abpluscd($u11,$alpha,$u12,$beta); $temp=bcadd($temp,$alpha); $aa=bcdiv($temp,$delta1); $temp=abpluscd($u21,$alpha,$u22,$beta); $temp=bcadd($temp,$beta); $bb=bcdiv($temp,$delta1); $minusu11=bcminus($u11); $minusu12=bcminus($u12); print " The solutions satisfy the recurrence relations
\n"; print "xn+1 = $minusu11​xn "; plusminus($minusu12); print "yn "; plusminus($aa); print "
\n"; $minusu22=bcminus($u22); $minusu21=bcminus($u21); print "yn+1 = $minusu21​xn "; plusminus($minusu22); print "yn "; plusminus($bb); print "
\n"; $aaa=abminuscd($u22,$aa,$u12,$bb); $bbb=abminuscd($u11,$bb,$u21,$aa); print "and inverse:
\n"; $minusu22=bcminus($u22); print "xn = $minusu22​xn+1 "; plusminus($u12); print "yn+1 "; plusminus($aaa); print "
\n"; print "yn = $u21​xn+1 "; $minusu11=bcminus($u11); plusminus($minusu11); print "yn+1 "; plusminus($bbb); print "
\n"; # print "n ≥ 0
\n"; print "

"; } if(ezero($merge)){ return($count); }else{ $count=bcdiv($count,"2"); return($count); } } function test($x,$y,$alpha,$beta,$dd){ global $globalhyperbolasolutionx; global $globalhyperbolasolutiony; #print "testing (x,y)=($x,$y)
\n"; $xx=bcadd($x,$alpha); $yy=bcadd($y,$beta); $xxmoddd=bcmod($xx,$dd); $yymoddd=bcmod($yy,$dd); if(ezero($xxmoddd) && ezero($yymoddd)){ $xxoverdd=bcdiv($xx,$dd); $yyoverdd=bcdiv($yy,$dd); $globalhyperbolasolutionx=$xxoverdd; $globalhyperbolasolutiony=$yyoverdd; return("1"); }else{ return("0"); } } ?> php/bigu_.php0000644000175100017510000004022413656354213012451 0ustar keithkeith\n"; return("0"); } $fourac=bcmul3("4",$a,$c); $bsquared=bcmul($b,$b); $dd=bcsub($bsquared,$fourac); print "D = $dd
\n"; $temp=sqtest($dd); if(gezero($temp)){ print "discriminant is a square
\n"; return("-1"); } if(ezero($d) && ezero($e)){ $f=bcminus($f); $g=binaryviasfs($a,$b,$c,$f,"0"); if(ezero($g)){ print "There are no integer solutions of the transformed equation
\n"; return("0"); } $u='u'; $v='v'; $twoa=bcmul("2",$a); $twoc=bcmul("2",$c); for($i="0";lt($i,$g);$i++){ $aa=$globalbinaryviastoltx[$i]; $bb=$globalbinaryviastolty[$i]; print "Fundamental solution [$i]: ($aa, $bb)
\n"; $temp1=abpluscd($b,$aa,$twoc,$bb); $temp1=bcminus($temp1); print "x = ("; printaxplusby($aa,$u,$temp1,$v); print ")/2
\n"; $temp2=abpluscd($b,$bb,$twoa,$aa); print "y = ("; printaxplusby($bb,$u,$temp2,$v); print ")/2
\n"; } $fourac=bcmul3("4",$a,$c); $bsquared=bcmul($b,$b); $d=bcsub($bsquared,$fourac); print " where u2 – $d v2 = 4
\n"; $x='x'; $y='y'; print "The diophantine equation "; printbinaryform($a,$b,$c,$x,$y); print " = $f
\n"; if(eq($g,"1")){ print " has one solution family
\n"; }elseif(gt($g,"1")){ print " has $g solution families
\n"; } return($g); } $twoa=bcmul("2",$a); $twoc=bcmul("2",$c); $alpha=abminuscd($twoc,$d,$b,$e); $beta=abminuscd($twoa,$e,$b,$d); print "alpha = $alpha, beta = $beta
\n"; print "$dd​x = "; $X='X'; $Y='Y'; printxplusa($X,$alpha); print "
\n"; print "$dd​y = "; printxplusa($Y,$beta); print "
\n"; $temp1=bcmul3($a,$e,$e); $temp2=bcmul3($b,$e,$d); $temp2=bcminus($temp2); $temp3=bcmul3($c,$d,$d); $temp4=bcmul($f,$dd); $temp=bcadd4($temp1,$temp2,$temp3,$temp4); $temp=bcmul($dd,$temp); $k=bcminus($temp); print "solving "; printbinaryform($a,$b,$c,$X,$Y); print " = $k
\n"; $s=fund4($dd,"0"); $phi=$globalx; $psi=$globaly; print "least positive solution of u2 - $dd​v2 = 4: (φ,ψ)=($phi,$psi)
\n"; $u11temp=aminusbc($phi,$b,$psi); $u11=bcdiv($u11temp,"2"); $u12temp=bcmul($c,$psi); $u12=bcminus($u12temp); $u21=bcmul($a,$psi); $u22temp=aplusbc($phi,$b,$psi); $u22=bcdiv($u22temp,"2"); print "U = ((φ - bψ)/2, -cψ, aψ, ((φ + bψ))/2) = ($u11,$u12,$u21,$u22)
\n"; $count="0"; $flag1="0"; $flag2="0"; $g=binaryviasfs($a,$b,$c,$k,$printflag); if(ezero($g)){ print "There are no solutions of the transformed equation
\n"; return($count); } print "There are g = $g fundamental solutions (X[h], Y[h], 0 ≤ h < g, of "; $X='x'; $Y='y'; printbinaryform($a,$b,$c,$X,$Y); print " = $k:
\n"; for($h="0";lt($h,$g);$h++){ print "($globalbinaryviastoltx[$h], $globalbinaryviastolty[$h]), "; } print "

\n"; for($h="0";lt($h,$g);$h++){ $gamma=$globalbinaryviastoltx[$h]; $epsilon=$globalbinaryviastolty[$h]; $t1=test($a,$b,$c,$d,$e,$f,$gamma,$epsilon,$alpha,$beta,$dd); if(eq($t1,"1")){ $solutionx1=$globalhyperbolasolutionx; $solutiony1=$globalhyperbolasolutiony; } $x=bcminus($gamma);$y=bcminus($epsilon); $t2=test($a,$b,$c,$d,$e,$f,$x,$y,$alpha,$beta,$dd); if(eq($t2,"1")){ $solutionx2=$globalhyperbolasolutionx; $solutiony2=$globalhyperbolasolutiony; } $x=abpluscd($u11,$gamma,$u12,$epsilon);$y=abpluscd($u21,$gamma,$u22,$epsilon); $t3=test($a,$b,$c,$d,$e,$f,$x,$y,$alpha,$beta,$dd); if(eq($t3,"1")){ $solutionx3=$globalhyperbolasolutionx; $solutiony3=$globalhyperbolasolutiony; } $x=bcminus($x);$y=bcminus($y); $t4=test($a,$b,$c,$d,$e,$f,$x,$y,$alpha,$beta,$dd); if(eq($t4,"1")){ $solutionx4=$globalhyperbolasolutionx; $solutiony4=$globalhyperbolasolutiony; } if(ezero($t1) && ezero($t2) && ezero($t3) && ezero($t4)){ continue; } print "case (a,b,c,d)=($t1,$t2,$t3,$t4)
\n"; if(eq($t1,"1") && eq($t2,"1") && ezero($t3) && ezero($t4)){ #print "case 1
\n"; print "(X[$h],Y[$h]) = ($gamma,,$epsilon)
\n"; print "solution [$count]: ($solutionx1,,$solutiony1)
\n"; print "(x,y)t = (U2n($gamma,$epsilon)t + ($alpha,$beta)t)/$dd, n ∈ ℤ
\n"; print "
\n"; $arrayvalue[$count]="2"; $count++; print "solution [$count]: ($solutionx2,$solutiony2)
\n"; print "(x,y)t = (-U2n($gamma,$epsilon)t + ($alpha,$beta)t)/$dd, n ∈ ℤ
\n"; $arrayvalue[$count]="2"; $count++; } if(eq($t1,"1") && ezero($t2) && eq($t3,"1") && ezero($t4)){ #print "case 2
\n"; print "(X[$h],Y[$h]) = ($gamma,$epsilon)
\n"; print "solution [$count]: ($solutionx1,$solutiony1)
\n"; print "(x,y)t = (Um($gamma,$epsilon)t + ($alpha,$beta)t)/$dd, m ∈ ℤ
\n"; $arrayvalue[$count]="1"; $count++; } if(eq($t1,"1") && ezero($t2) && ezero($t3) && eq($t4,"1")){ #print "case 3
\n"; print "(X[$h],Y[$h]) = ($gamma,$epsilon)
\n"; print "solution [$count]: ($solutionx1,$solutiony1)
\n"; $arrayvalue[$count]="-1"; $count++; print "(x,y)t = ((-U)m($gamma,$epsilon)t + ($alpha,$beta)t)/$dd, m ∈ ℤ
\n"; # print "(x,y)t=(U2n($gamma,$epsilon)t + ($alpha,$beta)t)/$dd
\n"; # print "solution ($solutionx4,$solutiony4)
\n"; # print "(x,y)t=(-U2n+1($gamma,$epsilon)t + ($alpha,$beta)t)/$dd
\n"; } if(ezero($t1) && eq($t2,"1") && eq($t3,"1") && ezero($t4)){ #print "case 4
\n"; print "(X[$h],Y[$h]) = ($gamma,$epsilon)
\n"; print "solution [$count]: ($solutionx2,$solutiony2)
\n"; $arrayvalue[$count]="-1"; $count++; print "(x,y)t = (-(-U)m($gamma,$epsilon)t + ($alpha,$beta)t)/$dd, n ∈ ℤ
\n"; #print "solution ($solutionx2,$solutiony2)
\n"; #print "(x,y)t=(-U2n($gamma,$epsilon)t + ($alpha,$beta)t)/$dd, n ∈ ℤ
\n"; #print "solution ($solutionx3,$solutiony3)
\n"; #print "(x,y)t=(U2n+1($gamma,$epsilon)t + ($alpha,$beta)t)/$dd, n ∈ ℤ
\n"; } if(ezero($t1) && ezero($t2) && eq($t3,"1") && eq($t4,"1")){ # print "case 5
\n"; print "(X[$h],Y[$h]) = ($gamma,$epsilon)
\n"; print "solution $count]: ($solutionx3,$solutiony3)
\n"; print "(x,y)t = (U2n+1($gamma,$epsilon)t + ($alpha,$beta)t)/$dd
\n"; $arrayvalue[$count]="2"; $count++; print "solution [$count]: ($solutionx4,$solutiony4)
\n"; $arrayvalue[$count]="2"; $count++; print "(x,y)t = (-U2n+1($gamma,$epsilon)t + ($alpha,$beta)t)/$dd, n ∈ ℤ
\n"; } if(ezero($t1) && eq($t2,"1") && ezero($t3) && eq($t4,"1")){ # print "case 6
\n"; print "(X[$h],Y[$h]) = ($gamma,$epsilon)
\n"; print "solution [$count]: ($solutionx2,$solutiony2)
\n"; $arrayvalue[$count]="1"; $count++; print "(x,y)t = (-Um($gamma,$epsilon)t + ($alpha,$beta)t)/$dd, m ∈ ℤ
\n"; } if(eq($t1,"1") && ezero($t2) && ezero($t3) && ezero($t4)){ # print "case 7
\n"; print "(X[$h],Y[$h]) = ($gamma,$epsilon)
\n"; print "solution [$count]: ($solutionx1,$solutiony1)
\n"; print "(x,y)t = (U2n($gamma,$epsilon)t + ($alpha,$beta)t)/$dd, n ∈ ℤ
\n"; $arrayvalue[$count]="2"; $count++; } if(ezero($t1) && eq($t2,"1") && ezero($t3) && ezero($t4)){ # print "case 8
\n"; print "(X[$h],Y[$h]) = ($gamma,$epsilon)
\n"; print "solution [$count]: ($solutionx2,$solutiony2)
\n"; print "(x,y)t = (-U2n($gamma,$epsilon)t + ($alpha,$beta)t)/$dd, n ∈ ℤ
\n"; $arrayvalue[$count]="2"; $count++; } if(ezero($t1) && ezero($t2) && eq($t3,"1") && ezero($t4)){ #print "case 9
\n"; print "(X[$h],Y[$h]) = ($gamma,$epsilon)
\n"; print "solution [$count]: ($solutionx3,$solutiony3)
\n"; print "(x,y)t = (U2n+1($gamma,$epsilon)t + ($alpha,$beta)t)/$dd, n ∈ ℤ
\n"; $arrayvalue[$count]="2"; $count++; } if(ezero($t1) && ezero($t2) && ezero($t3) && eq($t4,"1")){ #print "case 10
\n"; print "(X[$h],Y[$h]) = ($gamma,$epsilon)
\n"; print "solution [$count]: ($solutionx4,$solutiony4)
\n"; print "(x,y)t = (-U2n+1($gamma,$epsilon)t + ($alpha,$beta)t)/$dd, n ∈ ℤ
\n"; $arrayvalue[$count]="2"; $count++; } if(eq($t1,"1") && eq($t2,"1") && eq($t3,"1") && eq($t4,"1")){ #print "case 15
\n"; print "(X[$h],Y[$h]) = ($gamma,$epsilon)
\n"; print "solution [$count]: ($solutionx1,$solutiony1)
\n"; print "(x,y)t = (Um($gamma,$epsilon)t + ($alpha,$beta)t)/$dd
\n"; $arrayvalue[$count]="1"; $count++; print "solution [$count]: ($solutionx2,$solutiony2)
\n"; print "(x,y)t = (-Um($gamma,$epsilon)t + ($alpha,$beta)t)/$dd, m ∈ ℤ
\n"; $arrayvalue[$count]="1"; $count++; } } if(ezero($count)){ print "no solutions of the transformed equation yielded solutions
\n"; return("0"); } $temp=bcmul($u11,$u11); $v11=aplusbc($temp,$u12,$u21); $v12=abpluscd($u11,$u12,$u12,$u22); $v21=abpluscd($u21,$u11,$u22,$u21); $temp=bcmul($u22,$u22); $v22=aplusbc($temp,$u21,$u12); $t=testarrayvalue($arrayvalue,$count,"1"); # print "1st t =$t
\n"; if(eq($t,"1")){ $temp=abpluscd($u11,$alpha,$u12,$beta); $temp1=bcminus($temp); $temp1=bcadd($temp1,$alpha); $aa=bcdiv($temp1,$dd); print " The solutions satisfy the recurrence relations
\n"; print "xn+1 = $u11​xn "; plusminus($u12); print "yn "; plusminus($aa); print "
\n"; $temp=abpluscd($u21,$alpha,$u22,$beta); $temp1=bcminus($temp); $temp1=bcadd($temp1,$beta); $bb=bcdiv($temp1,$dd); print "yn+1 = $u21​xn "; plusminus($u22); print "yn "; plusminus($bb); print "
\n"; $aaa=abminuscd($u12,$bb,$u22,$aa); $bbb=abminuscd($u21,$aa,$u11,$bb); print "and inverse:
\n"; print "xn = $u22​xn+1 "; $minusu12=bcminus($u12); plusminus($minusu12); print "yn+1 "; plusminus($aaa); print "
\n"; $minusu21=bcminus($u21); print "yn = $minusu21​xn+1 "; plusminus($u11); print "yn+1 "; plusminus($bbb); print "
\n"; print "n ≥ 0
\n"; print "

"; } $t=testarrayvalue($arrayvalue,$count,"-1"); # print "2nd t =$t
\n"; if(eq($t,"1")){ $temp=abpluscd($u11,$alpha,$u12,$beta); $temp=bcadd($temp,$alpha); $aa=bcdiv($temp,$dd); $temp=abpluscd($u21,$alpha,$u22,$beta); $temp=bcadd($temp,$beta); $bb=bcdiv($temp,$dd); $minusu11=bcminus($u11); $minusu12=bcminus($u12); print " The solutions satisfy the recurrence relations
\n"; print "xn+1 = $minusu11​xn "; plusminus($minusu12); print "yn "; plusminus($aa); print "
\n"; $minusu22=bcminus($u22); $minusu21=bcminus($u21); print "yn+1 = $minusu21​xn "; plusminus($minusu22); print "yn "; plusminus($bb); print "
\n"; $aaa=abminuscd($u22,$aa,$u12,$bb); $bbb=abminuscd($u11,$bb,$u21,$aa); print "and inverse:
\n"; $minusu22=bcminus($u22); print "xn = $minusu22​xn+1 "; plusminus($u12); print "yn+1 "; plusminus($aaa); print "
\n"; print "yn = $u21​xn+1 "; $minusu11=bcminus($u11); plusminus($minusu11); print "yn+1 "; plusminus($bbb); print "
\n"; print "n ≥ 0
\n"; print "

"; } $t=testarrayvalue($arrayvalue,$count,"2"); #print "3rd t =$t
\n"; if(eq($t,"1")){ $temp=abpluscd($v11,$alpha,$v12,$beta); $temp1=bcminus($temp); $temp1=bcadd($temp1,$alpha); $aa=bcdiv($temp1,$dd); print "U2 = ($v11,$v12,$v21,$v22)
\n"; print " The solutions satisfy the recurrence relations
\n"; print "xn+1 = $v11​xn "; plusminus($v12); print "yn "; plusminus($aa); print "
\n"; $temp=abpluscd($v21,$alpha,$v22,$beta); $temp1=bcminus($temp); $temp1=bcadd($temp1,$beta); $bb=bcdiv($temp1,$dd); print "yn+1 = $v21​xn "; plusminus($v22); print "yn "; plusminus($bb); print "
\n"; $aaa=abminuscd($v12,$bb,$v22,$aa); $bbb=abminuscd($v21,$aa,$v11,$bb); print "and inverse:
\n"; print "xn = $v22​xn+1 "; $minusv12=bcminus($v12); plusminus($minusv12); print "yn+1 "; plusminus($aaa); print "
\n"; $minusv21=bcminus($v21); print "yn = $minusv21​xn+1 "; plusminus($v11); print "yn+1 "; plusminus($bbb); print "
\n"; print "n ≥ 0
\n"; print "

"; } #print "U^(-2)=(",v22,",",-v12,",",-v21,",",v11,")\n" #if(ezero($count)){ # print "There are no solutions
\n"; #} #if(eq($count,"1")){ # print "There is one family of solutions
\n"; #} #if(gt($count,"1")){ # print "There are $count families of solutions
\n"; #} return($count); } function test($a,$b,$c,$d,$e,$f,$x,$y,$alpha,$beta,$dd){ global $globalhyperbolasolutionx; global $globalhyperbolasolutiony; #print "testing (x,y)=($x,$y)
\n"; $xx=bcadd($x,$alpha); $yy=bcadd($y,$beta); $xxmoddd=bcmod($xx,$dd); $yymoddd=bcmod($yy,$dd); if(ezero($xxmoddd) && ezero($yymoddd)){ $xxoverdd=bcdiv($xx,$dd); $yyoverdd=bcdiv($yy,$dd); $globalhyperbolasolutionx=$xxoverdd; $globalhyperbolasolutiony=$yyoverdd; return("1"); }else{ return("0"); } } ?> php/bigu.php0000644000175100017510000000615513654706342012321 0ustar keithkeith \n"; } else { $tmp1=bcmul($bvalue,$bvalue); $tmp2=bcmul($avalue,$cvalue); $tmp2=bcmul("4",$tmp2); $d=bcsub($tmp1,$tmp2); if(ltzero($d)){ print "b2-4ac > 0
\n"; return; } if(ezero($d)){ print "b2-4ac = 0
\n"; print "

\n"; print "Return to main page
\n"; return; } $g=bcsqrt($d); $temp=bcmul($g,$g); if(eq($temp,$d)){ print "d is a perfect square
\n"; print "

\n"; print "Return to main page
\n"; return; } /* print "The diophantine equation "; if(gt($avalue,"1") || lt($avalue,"-1")){ print"$avalue u2"; } if(eq($avalue,"1")){ print"u2"; } if(eq($avalue,"-1")){ print"-u2"; } if(neqzero($bvalue)){ if(gt($bvalue,"1")){ print"+$bvalue uv"; } if(eq($bvalue,"1")){ print"+uv"; } if(eq($bvalue,"-1")){ print"-uv"; } if(lt($bvalue,"-1")){ print"$bvalue uv"; } } if(neqzero($cvalue)){ if(gt($cvalue,"1")){ print"+$cvalue v2"; } if(lt($cvalue,"-1")){ print"$cvalue v2"; } if(eq($cvalue,"1")){ print"+v2"; } if(eq($cvalue,"-1")){ print"-v2"; } } */ print "Solving the diophantine equation ax2 + bxy + cy2 + dx + ey +f = 0
\n"; print "(a, b, c, d, e, f)=($avalue, $bvalue, $cvalue, $dvalue, $evalue, $fvalue)
\n"; $s=bigu($avalue,$bvalue,$cvalue,$dvalue,$evalue,$fvalue,"0"); if(ezero($s)){ print "There are no solutions of the original equation
\n"; } if(eq($s,"1")){ print "There is one family of solutions
\n"; } if(gt($s,"1")){ print "There are $s families of solutions
\n"; } } print "

\n"; print "Return to main page
\n"; ?> php/biguu.php0000644000175100017510000000630713654166366012513 0ustar keithkeith \n"; } else { $tmp1=bcmul($bvalue,$bvalue); $tmp2=bcmul($avalue,$cvalue); $tmp2=bcmul("4",$tmp2); $d=bcsub($tmp1,$tmp2); if(ltzero($d)){ print "b2-4ac > 0
\n"; return; } if(ezero($d)){ print "b2-4ac = 0
\n"; print "

\n"; print "Return to main page
\n"; return; } $g=bcsqrt($d); $temp=bcmul($g,$g); if(eq($temp,$d)){ print "d is a perfect square
\n"; print "

\n"; print "Return to main page
\n"; return; } /* print "The diophantine equation "; if(gt($avalue,"1") || lt($avalue,"-1")){ print"$avalue u2"; } if(eq($avalue,"1")){ print"u2"; } if(eq($avalue,"-1")){ print"-u2"; } if(neqzero($bvalue)){ if(gt($bvalue,"1")){ print"+$bvalue uv"; } if(eq($bvalue,"1")){ print"+uv"; } if(eq($bvalue,"-1")){ print"-uv"; } if(lt($bvalue,"-1")){ print"$bvalue uv"; } } if(neqzero($cvalue)){ if(gt($cvalue,"1")){ print"+$cvalue v2"; } if(lt($cvalue,"-1")){ print"$cvalue v2"; } if(eq($cvalue,"1")){ print"+v2"; } if(eq($cvalue,"-1")){ print"-v2"; } } */ print "Solving the diophantine equation ax2 + bxy + cy2 + dx + ey +f = 0
\n"; print "(a, b, c, d, e, f)=($avalue, $bvalue, $cvalue, $dvalue, $evalue, $fvalue)
\n"; $s=bigu($avalue,$bvalue,$cvalue,$dvalue,$evalue,$fvalue,"0"); if(ezero($s)){ print "There are no solutions of the original equation
\n"; } if(eq($s,"1")){ print "There is one family of solutions
\n"; } if(gt($s,"1")){ print "There are $s families of solutions
\n"; } if(eq($s,"-1")){ print "There is a unique solution
\n"; } } print "

\n"; print "Return to main page
\n"; ?> php/binaryformsfs.html0000644000175100017510000000376313650715130014425 0ustar keithkeith Finding the fundamental solutions of the diophantine equation ax^2+bxy+cy^2=n, where a > 0, b^2-04ac > 0 and is not a perfect square

Finding the fundamental solutions of the diophantine equation ax2+bxy+cy2=n, where a > 0, b2-4ac > 0 and is not a perfect square, n non-zero


We use completion of the square and reduce the equation to X2 – d Y2 = 4an, where X = 2ax + y and Y = y and then solve this equation and obtain its Stolt fundamental solutions. It is only a short step to produce the fundamental solutions of the diophantine equation ax2 + bxy +cy2 = n. See Arkiv för Matematik, Vol 3 (1957), no. 4, 381-390. A note is being prepared (4th February 2020).

We also give formulae for the solutions corresponding to each fundamental solution.

This program has wider applicability than http://www.numbertheory.org/php/stolt_fundamental.html, as the latter is slow when the bounds become large.

This program is a BCMath version of a BC program.

Enter a:
Enter b:
Enter c:
Enter n (non-zero):

Last modified 25th April 2020
Return to main page php/binaryformsfs.php0000644000175100017510000000746013627324426014256 0ustar keithkeith \n"; } else if($nvalue=="0"){ print "n = 0
\n"; } else { if(lezero($avalue)){ print "a ≤ 0
\n"; return; } $tmp1=bcmul($bvalue,$bvalue); $tmp2=bcmul($avalue,$cvalue); $tmp2=bcmul("4",$tmp2); $d=bcsub($tmp1,$tmp2); if(lezero($d)){ print "b2-4ac ≤ 0
\n"; return; } $f=bcsqrt($d); $x=bcmul($f,$f); if(bccomp($x,$d)==0){ print "b2-4ac is the square of $f
\n"; return; } $X='x'; $Y='y'; print "The diophantine equation "; printbinaryform($avalue,$bvalue,$cvalue,$X,$Y); print " = $nvalue
\n"; #if(gt($avalue,"1") || lt($avalue,"-1")){ # print"$avalue x2"; # } # if(eq($avalue,"1")){ # print"x2"; # } # if(eq($avalue,"-1")){ # print"-x2"; # } #if(neqzero($bvalue)){ # if(gt($bvalue,"1")){ # print"+$bvalue xy"; # } # if(eq($bvalue,"1")){ # print"+xy"; # } # if(eq($bvalue,"-1")){ # print"-xy"; # } # if(lt($bvalue,"-1")){ # print"$bvalue xy"; # } # } #if(neqzero($cvalue)){ # if(gt($cvalue,"1")){ # print"+$cvalue y2"; # } # if(lt($cvalue,"-1")){ # print"$cvalue y2"; # } # if(eq($cvalue,"1")){ # print"+y2"; # } # if(eq($cvalue,"-1")){ # print"-y2"; # } # } # print "=$nvalue:
\n"; $u='u'; $v='v'; global $globalbinaryviastoltx; global $globalbinaryviastolty; $s=binaryviasfs($avalue,$bvalue,$cvalue,$nvalue,"0"); $twoa=bcmul("2",$avalue); $twoc=bcmul("2",$cvalue); for($i="0";lt($i,$s);$i++){ $a=$globalbinaryviastoltx[$i]; $b=$globalbinaryviastolty[$i]; print "Fundamental solution [$i]: ($a, $b)
\n"; $temp1=abpluscd($bvalue,$a,$twoc,$b); $temp1=bcminus($temp1); print "x = ("; printaxplusby($a,$u,$temp1,$v); print ")/2
\n"; $temp2=abpluscd($bvalue,$b,$twoa,$a); print "y = ("; printaxplusby($b,$u,$temp2,$v); print ")/2
\n"; } $fourac=bcmul3("4",$avalue,$cvalue); $bsquared=bcmul($bvalue,$bvalue); $d=bcsub($bsquared,$fourac); print " where u2 – $d v2 = 4
\n"; if(ezero($s)){ print "The original equation has no integer solutions
\n"; }elseif(eq($s,"1")){ print "The original equation has one fundamental solution
\n"; }elseif(gt($s,"1")){ print "The original equation has $s fundamental solutions
\n"; }else{ print "leaving the program
\n"; } } print "

\n"; print "Return to main page
\n"; ?> php/binarygen.html0000644000175100017510000000265712553622141013520 0ustar keithkeith Finding the solution classes (primitive and imprimitive) of the diophantine equation ax^2+bxy+cy^2=n, where b^2-04ac > 0 and is not a perfect square

Finding the solution classes (primitive and imprimitive) of the diophantine equation ax2+bxy+cy2=n, where b2-4ac > 0 and is not a perfect square, n non-zero, gcd(a,b,c)=1


(See paper.) The standard method is due to Gauss (See G.B. Mathews Number Theory, page 97 or L.E. Dickson, Introduction to the theory of numbers, pages 74-75.)

Enter a:
Enter b:
Enter c: (gcd(a,b,c)=1)
Enter n (non-zero):

Last modified 16th March 2015
Return to main page php/binarygen.php0000644000175100017510000000372213674271134013344 0ustar keithkeith \n"; }else if($nvalue=="0"){ print "n = 0
\n"; } else{ $tmp1=bcmul($bvalue,$bvalue); $tmp2=bcmul($avalue,$cvalue); $tmp2=bcmul("4",$tmp2); $d=bcsub($tmp1,$tmp2); if(lezero($d)){ print "b2-4ac ≤ 0
\n"; return; } $f=bcsqrt($d); $xx=bcmul($f,$f); if(bccomp($xx,$d)==0){ print "b2-4ac is the square of $f
\n"; return; } print "The diophantine equation "; $x="x"; $y="y"; printbinaryform($avalue,$bvalue,$cvalue,$x,$y); print "=$nvalue:
\n"; $temp1=gcd($avalue,$bvalue); $temp2=gcd($temp1,$cvalue); if(gt($temp2,"1")){ $temp=bcmod($nvalue,$temp2); if(neqzero($temp)){ print "gcd($avalue,$bvalue,$cvalue) does not divide $nvalue
\n"; }else{ $avalue=bcdiv($avalue,$temp2); $bvalue=bcdiv($bvalue,$temp2); $cvalue=bcdiv($cvalue,$temp2); $nvalue=bcdiv($nvalue,$temp2); $s=binarygenlist($avalue,$bvalue,$cvalue,$nvalue,"1"); } } else{ $s=binarygenlist($avalue,$bvalue,$cvalue,$nvalue,"1"); } } print "

\n"; print "Return to main page
\n"; ?> php/binary.html0000644000175100017510000000302112553621714013015 0ustar keithkeith Finding primitive solutions of the diophantine equation ax^2+bxy+cy^2=n, where b^2-04ac > 0 and is not a perfect square

Finding primitive solutions of the diophantine equation ax2+bxy+cy2=n, where b2-4ac > 0 and is not a perfect square, n non-zero, gcd(a,b,c)=1


If gcd(a,n)=1, the algorithm finds representatives with least positive y.
(See paper.) The standard method is due to Gauss (See G.B. Mathews Number Theory, page 97 or L.E. Dickson, Introduction to the theory of numbers, pages 74-75.)

E = 1 is verbose.

Enter a:
Enter b:
Enter c: (gcd(a,b,c)=1)
Enter n (non-zero):
Enter E (0 or 1):

Last modified 27th May 2009
Return to main page php/binary.php0000644000175100017510000000617512747032166012657 0ustar keithkeith \n"; } else if(neq($Evalue,"0") && neq($Evalue,"1")){ print "E is not equal to 0 or 1
\n"; } else if($nvalue=="0"){ print "n = 0
\n"; } else { $tmp1=bcmul($bvalue,$bvalue); $tmp2=bcmul($avalue,$cvalue); $tmp2=bcmul("4",$tmp2); $d=bcsub($tmp1,$tmp2); if(lezero($d)){ print "b2-4ac ≤ 0
\n"; return; } $f=bcsqrt($d); $x=bcmul($f,$f); if(bccomp($x,$d)==0){ print "b2-4ac is the square of $f
\n"; return; } print "The diophantine equation "; if(gt($avalue,"1") || lt($avalue,"-1")){ print"$avalue x2"; } if(eq($avalue,"1")){ print"x2"; } if(eq($avalue,"-1")){ print"-x2"; } if(neqzero($bvalue)){ if(gt($bvalue,"1")){ print"+$bvalue xy"; } if(eq($bvalue,"1")){ print"+xy"; } if(eq($bvalue,"-1")){ print"-xy"; } if(lt($bvalue,"-1")){ print"$bvalue xy"; } } if(neqzero($cvalue)){ if(gt($cvalue,"1")){ print"+$cvalue y2"; } if(lt($cvalue,"-1")){ print"$cvalue y2"; } if(eq($cvalue,"1")){ print"+y2"; } if(eq($cvalue,"-1")){ print"-y2"; } } print "=$nvalue:
\n"; $temp1=gcd($avalue,$bvalue); $temp2=gcd($temp1,$cvalue); if(gt($temp2,"1")){ print "gcd($avalue,$bvalue,$cvalue) > 1
\n"; } else{ $s=binary1($avalue,$bvalue,$cvalue,$nvalue,$Evalue); if(ezero($s)){ print "This equation has no primitive solution
\n"; flush(); }else{ if(eq($s,"1")){ print "one solution class: "; }else{ print "solution classes:
\n"; } for($i="0";lt($i,$s);$i=bcadd($i,"1")){ print "($fund_x[$i], $fund_y[$i])
\n"; flush(); } } } } print "

\n"; print "Return to main page
\n"; ?> php/binomial0.php0000644000175100017510000000067010040353524013223 0ustar keithkeith php/binomial.html0000644000175100017510000000343111625277404013332 0ustar keithkeith Prime-power factorization of binomial coefficients

Prime-power factorization of binomial coefficients

For each prime p ≤ n, we compute the power of pe dividing the binomial coefficient .
The program uses the fact that e=E(n,k,p) is the number of borrows in the subtraction n – k in base p.
Here n > k > 0.

(See P. Goetgheluck, Computing Binomial Coefficients, American Math. Monthly 94 (1987) 360-365.
Note that Goetgheluck's statement on p. 364 that E=1, if n – k < p ≤ n, assumes k ≤ n/2.)

Enter n (17863 ≥ n > 1):
Enter k (n > k > 0):

The bc code I use is:

define E(n,k,p){
auto e,f,r,a,b
e=0;r=0
if(k>n/2){
  k=n-k
}
if(p>n-k){
  return (1)
}
if(p>n/2){
  return (0)
}
f=sqrt(n)
if(p>f){
	if(n%p < k%p){
	    return(1)
        }else{
	    return(0)
        }
}
while(n){
   a=n%p; n=n/p
   b=k%p+r; k=k/p
   if(a<b){
     e=e+1
     r=1
   }else{
     r=0
   }
}
return(e)
}
Last modified 27th February 2004
Return to main page
php/binomial_.php0000644000175100017510000000444011610600774013307 0ustar keithkeithk>0. * Note that Goetgheluck's statement on p. 364 that E=1, if n-k\n"; flush(); return; } if(lezero($k)){ print "k ≤ 0
\n"; flush(); return; } if(le($n,$k)){ print "n < k
\n"; flush(); return; } $i="0"; $s="0"; while(le($p[$i],$n)){ /* there exists an i, 0<=i<=2047, satisfying $p[$i]>$n */ $q=$p[$i]; $e=binomial_p($n,$k,$q); if(gtzero($e)){ if(gtzero($s)){ if(gt($e,"1")){ print " · $q$e"; flush(); }else{ print " · $q"; flush(); } }else{ if(gt($e,"1")){ print "$q$e"; flush(); }else{ print $q; flush(); } } $temp=bcmod($s,"10"); if(ezero($temp) && gtzero($s)){ print "
\n"; flush(); } $s=bcadd($s,"1"); } if(eq($i,"2047")){ break; }else{ $i=bcadd($i,"1"); } } print "
\n"; flush(); return($s); } ?> php/binomial.php0000644000175100017510000000210412747226736013161 0ustar keithkeith Prime-power factorization of binomial coefficients \n"; } else if(gt($nvalue,"17863")){ print "n > 17863
\n"; } else if(lezero($kvalue)){ print "k ≤ 0
\n"; } else if(lt($nvalue,$kvalue)){ print "n < k
\n"; } else{ print "The prime-power factorization of $nvalueC$kvalue is:
\n"; flush(); $output=binomial($nvalue,$kvalue); print "The number of prime factors of $nvalueC$kvalue is $output
\n"; flush(); } print "

\n"; flush(); print "Return to main page
\n"; flush(); ?> php/blog0000644000175100017510000000023711610766253011520 0ustar keithkeith18th July 2011 latest version of php files. reorganised inclusion of library.php, added order of qform for neg disc and added h(d) for range of positive disc. php/buell_224.html0000644000175100017510000004666111612041574013237 0ustar keithkeith
Class numbers for odd negative fundamental discriminants,
3 ≤ d ≤ 1615
h(-3)1h(-7)1h(-11)1h(-15)2h(-19)1h(-23)3
h(-31)3h(-35)2h(-39)4h(-43)1h(-47)5h(-51)2
h(-55)4h(-59)3h(-67)1h(-71)7h(-79)5h(-83)3
h(-87)6h(-91)2h(-95)8h(-103)5h(-107)3h(-111)8
h(-115)2h(-119)10h(-123)2h(-127)5h(-131)5h(-139)3
h(-143)10h(-151)7h(-155)4h(-159)10h(-163)1h(-167)11
h(-179)5h(-183)8h(-187)2h(-191)13h(-195)4h(-199)9
h(-203)4h(-211)3h(-215)14h(-219)4h(-223)7h(-227)5
h(-231)12h(-235)2h(-239)15h(-247)6h(-251)7h(-255)12
h(-259)4h(-263)13h(-267)2h(-271)11h(-283)3h(-287)14
h(-291)4h(-295)8h(-299)8h(-303)10h(-307)3h(-311)19
h(-319)10h(-323)4h(-327)12h(-331)3h(-335)18h(-339)6
h(-347)5h(-355)4h(-359)19h(-367)9h(-371)8h(-379)3
h(-383)17h(-391)14h(-395)8h(-399)16h(-403)2h(-407)16
h(-411)6h(-415)10h(-419)9h(-427)2h(-431)21h(-435)4
h(-439)15h(-443)5h(-447)14h(-451)6h(-455)20h(-463)7
h(-467)7h(-471)16h(-479)25h(-483)4h(-487)7h(-491)9
h(-499)3h(-503)21h(-511)14h(-515)6h(-519)18h(-523)5
h(-527)18h(-535)14h(-543)12h(-547)3h(-551)26h(-555)4
h(-559)16h(-563)9h(-571)5h(-579)8h(-583)8h(-587)7
h(-591)22h(-595)4h(-599)25h(-607)13h(-611)10h(-615)20
h(-619)5h(-623)22h(-627)4h(-631)13h(-635)10h(-643)3
h(-647)23h(-651)8h(-655)12h(-659)11h(-663)16h(-667)4
h(-671)30h(-679)18h(-683)5h(-687)12h(-691)5h(-695)24
h(-699)10h(-703)14h(-707)6h(-715)4h(-719)31h(-723)4
h(-727)13h(-731)12h(-739)5h(-743)21h(-751)15h(-755)12
h(-759)24h(-763)4h(-767)22h(-771)6h(-779)10h(-787)5
h(-791)32h(-795)4h(-799)16h(-803)10h(-807)14h(-811)7
h(-815)30h(-823)9h(-827)7h(-831)28h(-835)6h(-839)33
h(-843)6h(-851)10h(-859)7h(-863)21h(-871)22h(-879)22
h(-883)3h(-887)29h(-895)16h(-899)14h(-903)16h(-907)3
h(-911)31h(-915)8h(-919)19h(-923)10h(-935)28h(-939)8
h(-943)16h(-947)5h(-951)26h(-955)4h(-959)36h(-967)11
h(-971)15h(-979)8h(-983)27h(-987)8h(-991)17h(-995)8
h(-1003)4h(-1007)30h(-1011)12h(-1015)16h(-1019)13h(-1023)16
h(-1027)4h(-1031)35h(-1039)23h(-1043)8h(-1047)16h(-1051)5
h(-1055)36h(-1059)6h(-1063)19h(-1067)12h(-1079)34h(-1087)9
h(-1091)17h(-1095)28h(-1099)6h(-1103)23h(-1111)22h(-1115)10
h(-1119)32h(-1123)5h(-1131)8h(-1135)18h(-1139)16h(-1147)6
h(-1151)41h(-1155)8h(-1159)16h(-1163)7h(-1167)22h(-1171)7
h(-1187)9h(-1191)24h(-1195)8h(-1199)38h(-1203)6h(-1207)18
h(-1211)14h(-1219)6h(-1223)35h(-1227)4h(-1231)27h(-1235)12
h(-1239)32h(-1243)4h(-1247)26h(-1255)12h(-1259)15h(-1263)20
h(-1267)6h(-1271)40h(-1279)23h(-1283)11h(-1291)9h(-1295)36
h(-1299)8h(-1303)11h(-1307)11h(-1311)28h(-1315)6h(-1319)45
h(-1327)15h(-1335)28h(-1339)8h(-1343)34h(-1347)6h(-1351)24
h(-1355)12h(-1363)6h(-1367)25h(-1371)12h(-1379)16h(-1383)18
h(-1387)4h(-1391)44h(-1399)27h(-1403)14h(-1407)24h(-1411)4
h(-1415)34h(-1419)12h(-1423)9h(-1427)15h(-1435)4h(-1439)39
h(-1443)8h(-1447)23h(-1451)13h(-1455)28h(-1459)11h(-1463)32
h(-1471)23h(-1479)28h(-1483)7h(-1487)37h(-1491)12h(-1495)20
h(-1499)13h(-1507)4h(-1511)49h(-1515)12h(-1523)7h(-1527)14
h(-1531)11h(-1535)38h(-1543)19h(-1547)12h(-1551)32h(-1555)4
h(-1559)51h(-1563)6h(-1567)15h(-1571)17h(-1579)9h(-1583)33
h(-1591)22h(-1595)16h(-1599)36h(-1603)6h(-1607)27h(-1615)24

There are 330 discriminants -d with d in the range [3,1615]

Return to main page

php/buell_225.html0000644000175100017510000004736011612042302013223 0ustar keithkeith
Class numbers for odd negative fundamental discriminants, 1619 ≤ d ≤ 3247
h(-1619)15h(-1623)28h(-1627)7h(-1631)44h(-1635)8h(-1639)22
h(-1643)10h(-1651)8h(-1655)44h(-1659)8h(-1663)17h(-1667)13
h(-1671)38h(-1679)52h(-1687)18h(-1691)18h(-1695)20h(-1699)11
h(-1703)28h(-1707)10h(-1711)28h(-1723)5h(-1727)36h(-1731)8
h(-1735)26h(-1739)20h(-1743)24h(-1747)5h(-1751)48h(-1759)27
h(-1763)12h(-1767)32h(-1771)8h(-1779)10h(-1783)17h(-1787)7
h(-1795)8h(-1799)50h(-1803)8h(-1807)12h(-1811)23h(-1819)10
h(-1823)45h(-1831)19h(-1835)10h(-1839)40h(-1843)6h(-1847)43
h(-1851)14h(-1855)28h(-1867)5h(-1871)45h(-1879)27h(-1883)14
h(-1887)20h(-1891)10h(-1895)48h(-1903)22h(-1907)13h(-1915)6
h(-1919)44h(-1923)10h(-1927)18h(-1931)21h(-1939)8h(-1943)32
h(-1947)8h(-1951)33h(-1955)12h(-1959)42h(-1963)6h(-1967)36
h(-1979)23h(-1983)16h(-1987)7h(-1991)56h(-1995)8h(-1999)27
h(-2003)9h(-2011)7h(-2015)52h(-2019)16h(-2027)11h(-2031)38
h(-2035)8h(-2039)45h(-2047)18h(-2051)18h(-2055)28h(-2059)8
h(-2063)45h(-2067)8h(-2071)30h(-2083)7h(-2087)35h(-2091)12
h(-2095)16h(-2099)19h(-2103)34h(-2111)49h(-2119)34h(-2123)14
h(-2127)28h(-2131)13h(-2135)44h(-2139)8h(-2143)13h(-2147)14
h(-2155)12h(-2159)60h(-2163)8h(-2167)18h(-2171)14h(-2179)7
h(-2183)42h(-2191)30h(-2195)16h(-2199)36h(-2203)5h(-2207)39
h(-2211)16h(-2215)22h(-2219)24h(-2227)6h(-2231)58h(-2235)12
h(-2239)35h(-2243)15h(-2247)20h(-2251)7h(-2255)40h(-2263)22
h(-2267)11h(-2271)44h(-2279)56h(-2283)6h(-2287)29h(-2291)18
h(-2307)8h(-2311)29h(-2315)18h(-2319)30h(-2323)8h(-2327)48
h(-2335)14h(-2339)19h(-2343)32h(-2347)5h(-2351)63h(-2355)12
h(-2359)28h(-2363)10h(-2371)13h(-2379)16h(-2383)29h(-2387)12
h(-2391)34h(-2395)8h(-2399)59h(-2407)20h(-2411)23h(-2415)40
h(-2419)8h(-2423)33h(-2427)14h(-2431)28h(-2435)22h(-2443)6
h(-2447)37h(-2451)8h(-2455)28h(-2459)19h(-2463)34h(-2467)7
h(-2471)62h(-2479)24h(-2483)20h(-2487)20h(-2491)12h(-2495)56
h(-2503)21h(-2507)14h(-2515)6h(-2519)64h(-2531)17h(-2539)11
h(-2543)35h(-2551)41h(-2555)12h(-2559)40h(-2563)6h(-2567)44
h(-2571)14h(-2579)21h(-2587)8h(-2591)57h(-2595)12h(-2599)30
h(-2603)20h(-2607)28h(-2611)8h(-2615)46h(-2623)22h(-2627)12
h(-2631)48h(-2635)12h(-2639)64h(-2643)10h(-2647)15h(-2651)26
h(-2659)13h(-2663)43h(-2667)8h(-2671)23h(-2679)52h(-2683)5
h(-2687)51h(-2699)15h(-2703)28h(-2707)7h(-2711)53h(-2715)8
h(-2719)41h(-2723)12h(-2731)11h(-2735)62h(-2739)16h(-2743)20
h(-2747)18h(-2751)40h(-2755)8h(-2759)54h(-2767)21h(-2771)26
h(-2779)14h(-2787)6h(-2791)39h(-2795)12h(-2803)9h(-2807)52
h(-2811)16h(-2815)22h(-2819)21h(-2823)26h(-2827)8h(-2831)68
h(-2839)26h(-2843)15h(-2847)32h(-2851)11h(-2855)60h(-2859)18
h(-2863)22h(-2867)12h(-2879)57h(-2887)25h(-2895)36h(-2899)10
h(-2903)59h(-2911)42h(-2915)24h(-2919)40h(-2923)6h(-2927)31
h(-2931)14h(-2935)22h(-2939)29h(-2947)8h(-2951)54h(-2955)12
h(-2959)40h(-2963)13h(-2967)44h(-2971)11h(-2983)20h(-2987)20
h(-2991)48h(-2995)8h(-2999)73h(-3003)8h(-3007)20h(-3011)21
h(-3019)7h(-3023)47h(-3027)12h(-3031)34h(-3035)18h(-3039)42
h(-3043)12h(-3047)38h(-3055)36h(-3059)24h(-3063)16h(-3067)7
h(-3071)76h(-3079)41h(-3083)13h(-3091)10h(-3095)48h(-3099)20
h(-3103)20h(-3107)18h(-3111)52h(-3115)12h(-3119)69h(-3127)24
h(-3131)20h(-3135)40h(-3139)10h(-3143)56h(-3147)10h(-3151)22
h(-3155)20h(-3163)9h(-3167)53h(-3171)16h(-3183)34h(-3187)7
h(-3191)69h(-3199)32h(-3203)11h(-3207)32h(-3215)50h(-3219)20
h(-3223)30h(-3227)14h(-3235)6h(-3239)70h(-3243)8h(-3247)32

There are 330 discriminants -d with d in the range [1619,3247]

Return to main page

php/buell_226.html0000644000175100017510000004742111612042254013230 0ustar keithkeith
Class numbers for odd negative fundamental discriminants, 3251 ≤ d ≤ 4863
h(-3251)31h(-3255)40h(-3259)9h(-3263)48h(-3271)27h(-3279)52
h(-3287)34h(-3291)10h(-3295)32h(-3299)27h(-3307)9h(-3311)72
h(-3315)8h(-3319)41h(-3323)17h(-3327)26h(-3331)15h(-3335)64
h(-3343)19h(-3347)11h(-3351)60h(-3355)8h(-3359)69h(-3363)16
h(-3367)20h(-3371)21h(-3379)16h(-3383)46h(-3387)12h(-3391)37
h(-3395)20h(-3399)40h(-3403)8h(-3407)57h(-3415)38h(-3419)28
h(-3423)40h(-3427)6h(-3431)66h(-3435)16h(-3439)30h(-3443)16
h(-3451)12h(-3455)52h(-3459)12h(-3463)19h(-3467)19h(-3471)60
h(-3487)28h(-3491)23h(-3495)36h(-3499)11h(-3503)52h(-3507)8
h(-3511)41h(-3515)20h(-3523)6h(-3527)65h(-3531)16h(-3535)28
h(-3539)23h(-3543)18h(-3547)9h(-3551)58h(-3559)45h(-3563)22
h(-3567)20h(-3571)15h(-3579)14h(-3583)29h(-3587)22h(-3595)8
h(-3599)66h(-3603)16h(-3607)19h(-3611)26h(-3615)48h(-3619)12
h(-3623)45h(-3631)43h(-3635)10h(-3639)60h(-3643)9h(-3647)54
h(-3651)18h(-3655)20h(-3659)29h(-3667)10h(-3671)81h(-3679)32
h(-3683)10h(-3687)42h(-3691)13h(-3695)72h(-3707)14h(-3711)36
h(-3715)14h(-3719)67h(-3723)12h(-3727)31h(-3731)28h(-3739)11
h(-3743)56h(-3747)12h(-3755)20h(-3759)52h(-3763)6h(-3767)39
h(-3779)31h(-3783)48h(-3787)8h(-3791)68h(-3795)16h(-3799)46
h(-3803)15h(-3811)10h(-3815)56h(-3819)16h(-3823)29h(-3827)22
h(-3831)42h(-3835)12h(-3839)82h(-3847)23h(-3851)25h(-3855)44
h(-3859)10h(-3863)61h(-3867)14h(-3883)8h(-3891)24h(-3895)32
h(-3899)24h(-3903)26h(-3907)7h(-3911)83h(-3919)39h(-3923)23
h(-3927)40h(-3931)11h(-3935)66h(-3939)16h(-3943)27h(-3947)17
h(-3955)12h(-3959)68h(-3963)8h(-3967)33h(-3979)20h(-3983)44
h(-3991)30h(-3995)28h(-3999)48h(-4003)13h(-4007)57h(-4011)20
h(-4015)20h(-4019)19h(-4027)9h(-4031)84h(-4035)12h(-4039)42
h(-4043)16h(-4047)40h(-4051)11h(-4055)68h(-4063)24h(-4071)40
h(-4079)85h(-4083)10h(-4087)30h(-4091)33h(-4099)15h(-4103)42
h(-4111)39h(-4115)22h(-4119)54h(-4123)8h(-4127)49h(-4135)46
h(-4139)19h(-4143)44h(-4147)12h(-4151)74h(-4155)12h(-4159)31
h(-4163)22h(-4171)16h(-4179)16h(-4183)28h(-4187)14h(-4191)60
h(-4195)8h(-4199)88h(-4207)26h(-4211)23h(-4215)44h(-4219)15
h(-4223)44h(-4227)10h(-4231)51h(-4243)9h(-4247)62h(-4251)16
h(-4255)36h(-4259)35h(-4267)8h(-4271)65h(-4279)28h(-4283)21
h(-4287)48h(-4291)12h(-4295)48h(-4299)18h(-4303)34h(-4307)18
h(-4315)14h(-4319)84h(-4323)8h(-4327)19h(-4331)34h(-4339)17
h(-4343)64h(-4351)44h(-4355)20h(-4359)60h(-4363)9h(-4367)68
h(-4371)20h(-4379)16h(-4387)8h(-4391)79h(-4395)20h(-4399)50
h(-4403)20h(-4407)40h(-4411)12h(-4415)66h(-4423)33h(-4427)16
h(-4431)48h(-4435)10h(-4439)76h(-4443)14h(-4447)17h(-4451)29
h(-4463)55h(-4467)12h(-4471)44h(-4479)70h(-4483)9h(-4487)60
h(-4495)32h(-4499)34h(-4503)24h(-4507)13h(-4511)84h(-4515)16
h(-4519)29h(-4523)21h(-4531)12h(-4535)70h(-4539)20h(-4543)28
h(-4547)17h(-4551)56h(-4555)12h(-4559)72h(-4567)33h(-4571)28
h(-4579)10h(-4583)61h(-4587)12h(-4591)49h(-4595)24h(-4603)7
h(-4607)40h(-4611)28h(-4615)36h(-4619)36h(-4623)36h(-4627)10
h(-4631)76h(-4639)51h(-4643)13h(-4647)32h(-4651)17h(-4659)14
h(-4663)33h(-4667)22h(-4679)91h(-4683)16h(-4687)16h(-4691)21
h(-4695)44h(-4699)12h(-4703)75h(-4711)44h(-4715)24h(-4723)9
h(-4727)54h(-4731)20h(-4735)42h(-4739)26h(-4747)8h(-4751)91
h(-4755)12h(-4759)55h(-4763)20h(-4767)32h(-4771)12h(-4783)23
h(-4787)25h(-4791)68h(-4795)12h(-4799)63h(-4803)14h(-4807)40
h(-4811)22h(-4819)18h(-4823)48h(-4827)12h(-4831)33h(-4835)30
h(-4839)58h(-4843)8h(-4847)74h(-4855)20h(-4859)30h(-4863)52

There are 330 discriminants -d with d in the range [3251,4863]

Return to main page

php/buell_227.html0000644000175100017510000004745211612042213013230 0ustar keithkeith
Class numbers for odd negative fundamental discriminants,
4867 ≤ d ≤ 6499
h(-4867)8h(-4871)91h(-4879)52h(-4883)18h(-4891)20h(-4895)64
h(-4899)16h(-4903)27h(-4907)12h(-4911)50h(-4915)10h(-4919)91
h(-4927)34h(-4931)35h(-4935)48h(-4939)16h(-4943)55h(-4947)12
h(-4951)31h(-4955)28h(-4963)12h(-4967)59h(-4971)16h(-4979)30
h(-4983)52h(-4987)9h(-4991)92h(-4999)33h(-5003)15h(-5007)36
h(-5011)21h(-5015)88h(-5019)20h(-5023)25h(-5027)14h(-5035)12
h(-5039)83h(-5051)29h(-5055)36h(-5059)19h(-5063)36h(-5071)50
h(-5079)64h(-5083)8h(-5087)69h(-5091)14h(-5095)48h(-5099)39
h(-5107)7h(-5111)78h(-5115)16h(-5119)39h(-5123)26h(-5127)38
h(-5131)10h(-5135)56h(-5143)40h(-5147)19h(-5151)68h(-5155)12
h(-5159)88h(-5163)10h(-5167)33h(-5171)35h(-5179)11h(-5183)80
h(-5187)16h(-5191)40h(-5195)16h(-5199)74h(-5207)56h(-5215)32
h(-5219)24h(-5223)32h(-5227)15h(-5231)75h(-5235)24h(-5251)14
h(-5255)92h(-5259)12h(-5263)28h(-5267)14h(-5271)64h(-5279)87
h(-5287)34h(-5291)36h(-5295)60h(-5299)12h(-5303)55h(-5307)12
h(-5311)46h(-5315)18h(-5323)15h(-5327)58h(-5331)20h(-5335)32
h(-5339)34h(-5343)36h(-5347)13h(-5351)93h(-5359)48h(-5363)16
h(-5367)40h(-5371)12h(-5379)24h(-5383)22h(-5387)23h(-5395)12
h(-5399)79h(-5403)16h(-5407)43h(-5411)34h(-5419)13h(-5423)68
h(-5431)57h(-5435)26h(-5443)9h(-5447)60h(-5451)28h(-5455)36
h(-5459)34h(-5467)8h(-5471)71h(-5479)43h(-5483)17h(-5487)52
h(-5495)84h(-5503)25h(-5507)23h(-5511)56h(-5515)10h(-5519)97
h(-5523)12h(-5527)19h(-5531)23h(-5539)18h(-5543)78h(-5551)52
h(-5555)24h(-5559)44h(-5563)15h(-5567)54h(-5579)30h(-5583)32
h(-5587)8h(-5591)99h(-5595)12h(-5599)56h(-5603)22h(-5611)10
h(-5615)62h(-5619)28h(-5623)33h(-5627)28h(-5631)74h(-5639)87
h(-5647)21h(-5651)31h(-5655)56h(-5659)19h(-5663)56h(-5667)10
h(-5671)44h(-5683)11h(-5691)24h(-5695)44h(-5699)24h(-5703)54
h(-5707)8h(-5711)109h(-5719)56h(-5723)14h(-5727)40h(-5731)20
h(-5735)52h(-5739)22h(-5743)29h(-5747)24h(-5755)12h(-5759)108
h(-5763)12h(-5767)36h(-5771)44h(-5779)13h(-5783)53h(-5791)33
h(-5795)32h(-5799)80h(-5803)10h(-5807)65h(-5811)12h(-5815)50
h(-5827)15h(-5835)12h(-5839)37h(-5843)25h(-5847)50h(-5851)21
h(-5855)76h(-5863)28h(-5867)21h(-5871)72h(-5879)101h(-5883)16
h(-5891)26h(-5899)18h(-5903)73h(-5907)16h(-5911)56h(-5919)54
h(-5923)7h(-5927)71h(-5935)42h(-5939)35h(-5943)32h(-5947)8
h(-5951)90h(-5955)20h(-5959)42h(-5963)24h(-5971)14h(-5979)24
h(-5983)44h(-5987)15h(-5991)70h(-5995)16h(-5999)90h(-6007)27
h(-6011)27h(-6015)36h(-6019)22h(-6023)82h(-6031)50h(-6035)28
h(-6043)9h(-6047)71h(-6051)20h(-6055)36h(-6059)26h(-6063)36
h(-6067)15h(-6071)96h(-6079)57h(-6083)24h(-6087)36h(-6091)15
h(-6095)84h(-6099)16h(-6103)28h(-6107)30h(-6115)10h(-6119)82
h(-6123)16h(-6127)22h(-6131)31h(-6135)72h(-6139)20h(-6143)41
h(-6151)59h(-6155)28h(-6159)80h(-6163)11h(-6167)66h(-6179)42
h(-6187)12h(-6191)98h(-6195)16h(-6199)39h(-6203)17h(-6207)50
h(-6211)15h(-6215)96h(-6227)18h(-6231)64h(-6235)12h(-6239)90
h(-6243)22h(-6247)43h(-6251)24h(-6259)10h(-6263)77h(-6267)12
h(-6271)51h(-6279)56h(-6283)12h(-6287)51h(-6295)24h(-6299)43
h(-6303)48h(-6307)8h(-6311)89h(-6315)16h(-6319)52h(-6323)21
h(-6331)18h(-6335)92h(-6339)20h(-6343)33h(-6347)28h(-6351)44
h(-6355)16h(-6359)101h(-6367)37h(-6371)36h(-6379)17h(-6383)72
h(-6387)18h(-6391)48h(-6395)16h(-6403)10h(-6407)46h(-6411)24
h(-6415)50h(-6423)38h(-6427)9h(-6431)114h(-6439)62h(-6443)26
h(-6447)48h(-6451)17h(-6455)60h(-6459)30h(-6463)30h(-6467)20
h(-6479)84h(-6483)12h(-6487)42h(-6491)31h(-6495)52h(-6499)14

There are 330 discriminants -d with d in the range [4867,6499]

Return to main page

php/buell_228.html0000644000175100017510000004750111612042344013231 0ustar keithkeith
Class numbers for odd negative fundamental discriminants,
6503 ≤ d ≤ 8131
h(-6503)82h(-6511)44h(-6515)26h(-6519)68h(-6523)14h(-6527)80
h(-6531)24h(-6535)30h(-6539)28h(-6547)11h(-6551)117h(-6555)24
h(-6559)38h(-6563)23h(-6567)32h(-6571)15h(-6583)36h(-6587)26
h(-6595)16h(-6599)109h(-6603)12h(-6607)45h(-6611)42h(-6619)13
h(-6623)42h(-6631)44h(-6635)30h(-6639)90h(-6643)12h(-6659)23
h(-6663)60h(-6667)10h(-6671)88h(-6679)55h(-6683)32h(-6691)21
h(-6695)92h(-6699)24h(-6703)23h(-6707)28h(-6711)74h(-6715)12
h(-6719)105h(-6731)34h(-6735)44h(-6739)18h(-6743)54h(-6747)16
h(-6751)66h(-6755)20h(-6763)9h(-6767)86h(-6771)16h(-6779)39
h(-6783)56h(-6787)12h(-6791)81h(-6799)44h(-6803)19h(-6807)40
h(-6815)92h(-6819)22h(-6823)33h(-6827)17h(-6835)18h(-6839)108
h(-6843)12h(-6847)26h(-6851)36h(-6855)60h(-6863)81h(-6871)45
h(-6879)64h(-6883)9h(-6887)78h(-6891)26h(-6895)28h(-6899)35
h(-6907)17h(-6911)87h(-6915)28h(-6919)68h(-6923)16h(-6927)38
h(-6931)12h(-6935)88h(-6943)48h(-6947)29h(-6951)80h(-6955)12
h(-6959)95h(-6963)12h(-6967)33h(-6971)45h(-6979)14h(-6983)57
h(-6987)12h(-6991)71h(-6995)32h(-6999)66h(-7003)16h(-7015)28
h(-7019)43h(-7023)44h(-7027)11h(-7031)108h(-7035)16h(-7039)43
h(-7043)23h(-7051)16h(-7055)92h(-7059)32h(-7063)40h(-7067)14
h(-7071)70h(-7079)85h(-7087)30h(-7091)38h(-7095)56h(-7099)14
h(-7103)77h(-7107)12h(-7111)52h(-7115)30h(-7123)10h(-7127)79
h(-7131)20h(-7135)38h(-7143)46h(-7147)14h(-7151)85h(-7159)65
h(-7163)20h(-7167)64h(-7171)20h(-7179)22h(-7183)32h(-7187)25
h(-7195)16h(-7199)114h(-7207)29h(-7211)35h(-7215)72h(-7219)15
h(-7223)84h(-7231)44h(-7235)22h(-7239)48h(-7243)13h(-7247)47
h(-7251)34h(-7255)60h(-7259)36h(-7271)116h(-7279)70h(-7283)25
h(-7287)36h(-7291)12h(-7295)80h(-7303)30h(-7307)25h(-7311)88
h(-7315)16h(-7319)88h(-7323)18h(-7327)34h(-7331)33h(-7339)18
h(-7343)74h(-7347)16h(-7351)33h(-7355)36h(-7359)72h(-7363)10
h(-7367)94h(-7379)28h(-7383)56h(-7387)10h(-7391)120h(-7395)16
h(-7403)22h(-7411)25h(-7415)58h(-7419)24h(-7423)40h(-7427)28
h(-7431)70h(-7435)10h(-7439)116h(-7447)42h(-7451)35h(-7455)56
h(-7459)15h(-7463)66h(-7467)20h(-7471)58h(-7483)10h(-7487)65
h(-7491)16h(-7495)48h(-7499)33h(-7503)40h(-7507)11h(-7511)96
h(-7519)50h(-7523)35h(-7527)40h(-7531)24h(-7535)96h(-7539)28
h(-7543)36h(-7547)15h(-7555)12h(-7559)115h(-7563)24h(-7567)44
h(-7571)18h(-7579)16h(-7583)63h(-7591)65h(-7599)52h(-7603)11
h(-7607)89h(-7611)20h(-7615)50h(-7619)46h(-7627)10h(-7631)106
h(-7635)20h(-7639)31h(-7643)29h(-7647)66h(-7651)20h(-7655)76
h(-7663)44h(-7667)20h(-7671)84h(-7679)106h(-7683)12h(-7687)29
h(-7691)43h(-7699)27h(-7703)81h(-7707)16h(-7711)34h(-7715)18
h(-7719)96h(-7723)9h(-7727)81h(-7735)48h(-7739)40h(-7743)52
h(-7747)16h(-7751)110h(-7755)16h(-7759)49h(-7763)22h(-7771)18
h(-7779)24h(-7783)44h(-7787)28h(-7795)16h(-7799)96h(-7807)36
h(-7811)42h(-7815)52h(-7819)16h(-7823)75h(-7827)18h(-7831)66
h(-7835)30h(-7843)16h(-7847)56h(-7851)20h(-7855)44h(-7859)34
h(-7863)34h(-7867)11h(-7871)120h(-7879)49h(-7883)17h(-7887)72
h(-7891)12h(-7895)112h(-7899)22h(-7903)44h(-7907)21h(-7915)14
h(-7919)97h(-7923)16h(-7927)47h(-7931)44h(-7939)20h(-7951)51
h(-7955)44h(-7959)80h(-7963)13h(-7967)44h(-7971)30h(-7979)44
h(-7991)100h(-7995)16h(-7999)74h(-8003)26h(-8007)64h(-8011)25
h(-8015)92h(-8023)22h(-8027)28h(-8031)60h(-8035)14h(-8039)113
h(-8043)16h(-8047)34h(-8051)34h(-8059)21h(-8063)86h(-8067)20
h(-8071)66h(-8079)50h(-8083)16h(-8087)81h(-8095)56h(-8099)28
h(-8103)48h(-8111)121h(-8115)24h(-8119)52h(-8123)21h(-8131)12

There are 330 discriminants -d with d in the range [6503,8131]

Return to main page

php/buell_229.html0000644000175100017510000004751211612042420013227 0ustar keithkeith
Class numbers for odd negative fundamental discriminants,
8135 ≤ d ≤ 9743
h(-8135)94h(-8139)36h(-8143)22h(-8147)37h(-8151)88h(-8155)12
h(-8159)106h(-8167)33h(-8171)21h(-8179)25h(-8187)14h(-8191)55
h(-8195)32h(-8203)18h(-8207)96h(-8211)24h(-8215)36h(-8219)35
h(-8223)58h(-8227)10h(-8231)107h(-8239)64h(-8243)21h(-8247)40
h(-8251)20h(-8255)68h(-8259)30h(-8263)43h(-8267)30h(-8279)126
h(-8283)16h(-8287)45h(-8291)47h(-8295)64h(-8299)16h(-8311)61
h(-8315)38h(-8319)80h(-8323)12h(-8327)52h(-8331)18h(-8335)50
h(-8339)26h(-8347)12h(-8351)118h(-8355)20h(-8359)58h(-8363)35
h(-8367)30h(-8371)22h(-8383)26h(-8387)21h(-8391)76h(-8395)12
h(-8399)134h(-8403)18h(-8407)36h(-8411)40h(-8419)19h(-8423)83
h(-8431)59h(-8435)28h(-8439)68h(-8443)11h(-8447)99h(-8455)56
h(-8459)42h(-8463)48h(-8467)15h(-8471)80h(-8479)50h(-8483)30
h(-8491)20h(-8495)64h(-8499)24h(-8503)48h(-8507)18h(-8511)94
h(-8515)16h(-8519)110h(-8527)43h(-8531)50h(-8535)52h(-8539)17
h(-8543)97h(-8547)16h(-8551)50h(-8555)32h(-8563)9h(-8567)84
h(-8571)36h(-8579)42h(-8583)50h(-8587)18h(-8599)63h(-8603)24
h(-8607)40h(-8611)14h(-8615)118h(-8623)51h(-8627)21h(-8635)16
h(-8639)88h(-8643)16h(-8647)31h(-8651)38h(-8655)84h(-8659)22
h(-8663)67h(-8671)64h(-8679)88h(-8683)16h(-8687)84h(-8691)26
h(-8695)36h(-8699)35h(-8707)15h(-8711)132h(-8715)16h(-8719)53
h(-8723)28h(-8727)50h(-8731)17h(-8735)106h(-8743)26h(-8747)21
h(-8751)72h(-8755)20h(-8759)108h(-8763)24h(-8767)36h(-8779)15
h(-8783)73h(-8787)12h(-8791)82h(-8795)32h(-8799)80h(-8803)9
h(-8807)81h(-8815)48h(-8819)49h(-8823)60h(-8827)12h(-8831)109
h(-8835)16h(-8839)77h(-8843)26h(-8851)22h(-8855)88h(-8859)16
h(-8863)29h(-8867)27h(-8871)46h(-8879)130h(-8887)43h(-8891)32
h(-8895)92h(-8899)14h(-8903)70h(-8907)22h(-8911)44h(-8915)22
h(-8923)19h(-8927)82h(-8931)32h(-8935)46h(-8939)38h(-8943)60
h(-8947)10h(-8951)135h(-8963)29h(-8971)19h(-8979)24h(-8983)38
h(-8987)32h(-8995)20h(-8999)99h(-9003)12h(-9007)35h(-9011)33
h(-9015)72h(-9019)30h(-9023)80h(-9031)54h(-9035)40h(-9039)80
h(-9043)15h(-9047)88h(-9051)20h(-9055)36h(-9059)39h(-9067)9
h(-9071)138h(-9079)52h(-9083)24h(-9087)32h(-9091)21h(-9095)76
h(-9103)57h(-9107)26h(-9111)64h(-9115)14h(-9119)124h(-9123)18
h(-9127)57h(-9131)40h(-9139)12h(-9143)72h(-9147)20h(-9151)67
h(-9155)36h(-9159)96h(-9167)54h(-9179)38h(-9183)40h(-9187)21
h(-9191)124h(-9195)20h(-9199)51h(-9203)31h(-9211)18h(-9215)116
h(-9219)16h(-9223)34h(-9227)25h(-9231)100h(-9235)14h(-9239)139
h(-9247)54h(-9255)52h(-9259)24h(-9263)62h(-9267)22h(-9271)60
h(-9283)11h(-9287)78h(-9291)32h(-9299)50h(-9303)68h(-9307)10
h(-9311)97h(-9319)41h(-9323)29h(-9327)56h(-9331)20h(-9335)98
h(-9339)20h(-9343)51h(-9347)24h(-9355)12h(-9363)20h(-9367)28
h(-9371)49h(-9379)24h(-9383)102h(-9391)55h(-9395)24h(-9399)96
h(-9403)11h(-9407)92h(-9411)30h(-9415)52h(-9419)35h(-9427)14
h(-9431)91h(-9435)32h(-9439)75h(-9443)20h(-9447)44h(-9451)24
h(-9455)120h(-9463)45h(-9467)41h(-9471)72h(-9479)101h(-9483)16
h(-9487)38h(-9491)45h(-9499)28h(-9503)80h(-9507)16h(-9511)69
h(-9515)28h(-9519)96h(-9523)12h(-9527)66h(-9535)34h(-9539)55
h(-9543)52h(-9547)13h(-9551)129h(-9563)18h(-9571)20h(-9579)32
h(-9587)23h(-9591)80h(-9595)16h(-9599)98h(-9607)42h(-9611)44
h(-9615)36h(-9619)19h(-9623)95h(-9627)18h(-9631)77h(-9635)44
h(-9643)11h(-9647)86h(-9651)28h(-9655)52h(-9659)38h(-9663)54
h(-9667)12h(-9671)126h(-9679)71h(-9683)18h(-9687)60h(-9691)20
h(-9695)92h(-9699)28h(-9703)34h(-9707)26h(-9715)24h(-9719)133
h(-9723)24h(-9727)38h(-9731)32h(-9735)64h(-9739)13h(-9743)105

There are 330 discriminants -d with d in the range [8135,9743]

Return to main page

php/buell_230.html0000644000175100017510000000675311612042452013226 0ustar keithkeith
Class numbers for odd negative fundamental discriminants, 9755 ≤ d ≤ 9995
h(-9755)20h(-9759)92h(-9763)16h(-9767)89h(-9771)26h(-9779)48
h(-9787)11h(-9791)119h(-9795)20h(-9799)66h(-9803)37h(-9807)64
h(-9811)21h(-9815)76h(-9823)24h(-9827)28h(-9831)108h(-9835)16
h(-9839)91h(-9843)12h(-9847)44h(-9851)45h(-9859)21h(-9863)96
h(-9867)16h(-9871)49h(-9879)76h(-9883)17h(-9887)75h(-9895)56
h(-9899)30h(-9903)56h(-9907)15h(-9911)136h(-9915)24h(-9919)68
h(-9923)25h(-9931)23h(-9935)94h(-9939)28h(-9943)56h(-9951)76
h(-9955)16h(-9959)130h(-9967)39h(-9979)20h(-9983)92h(-9987)26
h(-9991)32h(-9995)40

There are 50 discriminants -d with d in the range [9755,9995]

Return to main page

php/buell_231.html0000644000175100017510000004711711612042503013223 0ustar keithkeith
Class numbers for even negative fundamental discriminants, 4 ≤ d ≤ 3256
h(-4)1h(-8)1h(-20)2h(-24)2h(-40)2h(-52)2
h(-56)4h(-68)4h(-84)4h(-88)2h(-104)6h(-116)6
h(-120)4h(-132)4h(-136)4h(-148)2h(-152)6h(-164)8
h(-168)4h(-184)4h(-212)6h(-228)4h(-232)2h(-244)6
h(-248)8h(-260)8h(-264)8h(-276)8h(-280)4h(-292)4
h(-296)10h(-308)8h(-312)4h(-328)4h(-340)4h(-344)10
h(-356)12h(-372)4h(-376)8h(-388)4h(-404)14h(-408)4
h(-420)8h(-424)6h(-436)6h(-440)12h(-452)8h(-456)8
h(-472)6h(-488)10h(-516)12h(-520)4h(-532)4h(-536)14
h(-548)8h(-552)8h(-564)8h(-568)4h(-580)8h(-584)16
h(-596)14h(-616)8h(-628)6h(-632)8h(-644)16h(-660)8
h(-664)10h(-680)12h(-692)14h(-696)12h(-708)4h(-712)8
h(-724)10h(-728)12h(-740)16h(-744)12h(-760)4h(-772)4
h(-776)20h(-788)10h(-804)12h(-808)6h(-820)8h(-824)20
h(-836)20h(-840)8h(-852)8h(-856)6h(-868)8h(-872)10
h(-884)16h(-888)12h(-904)8h(-916)10h(-920)20h(-932)12
h(-948)12h(-952)8h(-964)12h(-984)12h(-996)12h(-1012)4
h(-1016)16h(-1028)16h(-1032)8h(-1048)6h(-1060)8h(-1064)20
h(-1076)22h(-1092)8h(-1096)12h(-1108)6h(-1112)14h(-1124)20
h(-1128)8h(-1140)16h(-1144)12h(-1160)20h(-1172)18h(-1192)6
h(-1204)8h(-1208)12h(-1220)16h(-1236)12h(-1240)8h(-1252)8
h(-1256)26h(-1268)10h(-1272)12h(-1284)20h(-1288)8h(-1304)22
h(-1316)24h(-1320)8h(-1336)12h(-1348)8h(-1364)28h(-1380)8
h(-1384)10h(-1396)14h(-1412)16h(-1416)16h(-1428)8h(-1432)6
h(-1448)18h(-1460)20h(-1464)12h(-1480)12h(-1492)10h(-1496)28
h(-1508)16h(-1524)20h(-1528)8h(-1540)8h(-1544)20h(-1556)22
h(-1560)16h(-1572)12h(-1576)10h(-1588)6h(-1592)20h(-1604)20
h(-1608)16h(-1624)16h(-1636)16h(-1640)16h(-1652)20h(-1668)12
h(-1672)8h(-1684)10h(-1688)10h(-1704)24h(-1716)16h(-1720)12
h(-1732)12h(-1736)24h(-1748)20h(-1752)8h(-1768)8h(-1780)8
h(-1784)32h(-1796)20h(-1812)12h(-1816)14h(-1828)8h(-1832)26
h(-1844)30h(-1848)8h(-1860)16h(-1864)8h(-1876)16h(-1880)20
h(-1892)12h(-1896)20h(-1912)8h(-1924)16h(-1928)20h(-1940)20
h(-1956)20h(-1972)12h(-1976)28h(-1988)24h(-1992)8h(-2004)16
h(-2008)14h(-2020)8h(-2024)28h(-2036)30h(-2040)16h(-2056)16
h(-2068)12h(-2072)16h(-2084)32h(-2104)12h(-2120)28h(-2132)12
h(-2136)20h(-2148)12h(-2152)10h(-2164)10h(-2168)24h(-2180)32
h(-2184)24h(-2212)8h(-2216)22h(-2228)18h(-2244)16h(-2248)8
h(-2260)12h(-2264)30h(-2276)32h(-2280)16h(-2292)16h(-2296)16
h(-2308)8h(-2324)28h(-2328)16h(-2344)18h(-2356)16h(-2360)20
h(-2372)24h(-2388)12h(-2392)8h(-2404)20h(-2408)24h(-2424)12
h(-2436)16h(-2440)12h(-2452)10h(-2456)34h(-2468)12h(-2472)12
h(-2488)12h(-2504)36h(-2516)36h(-2532)20h(-2536)14h(-2552)20
h(-2564)28h(-2568)16h(-2580)16h(-2584)16h(-2596)20h(-2612)14
h(-2616)28h(-2632)8h(-2644)18h(-2648)22h(-2660)24h(-2676)12
h(-2680)12h(-2692)12h(-2696)24h(-2708)30h(-2712)20h(-2724)20
h(-2728)12h(-2740)12h(-2756)40h(-2760)16h(-2776)10h(-2788)8
h(-2792)26h(-2804)34h(-2820)24h(-2824)24h(-2836)10h(-2840)32
h(-2852)24h(-2856)24h(-2868)16h(-2872)12h(-2884)16h(-2920)12
h(-2932)14h(-2936)40h(-2948)20h(-2964)24h(-2968)8h(-2980)16
h(-2984)26h(-2996)32h(-3012)12h(-3016)20h(-3028)10h(-3032)22
h(-3044)40h(-3048)12h(-3064)24h(-3076)20h(-3080)32h(-3092)26
h(-3108)16h(-3112)14h(-3124)20h(-3128)24h(-3140)16h(-3144)16
h(-3156)32h(-3160)16h(-3172)8h(-3176)42h(-3188)30h(-3192)16
h(-3208)12h(-3220)16h(-3224)28h(-3236)32h(-3252)12h(-3256)12

There are 330 discriminants -d with d in the range [4,3256]

Return to main page

php/buell_232.html0000644000175100017510000004745611612042537013241 0ustar keithkeith
Class numbers for even negative fundamental discriminants, 3268 ≤ d ≤ 6488
h(-3268)12h(-3272)28h(-3284)30h(-3288)20h(-3304)12h(-3316)22
h(-3320)20h(-3336)16h(-3352)14h(-3368)26h(-3396)28h(-3412)10
h(-3416)44h(-3428)32h(-3432)16h(-3444)24h(-3448)8h(-3460)16
h(-3464)44h(-3476)32h(-3480)16h(-3496)20h(-3508)10h(-3512)20
h(-3524)40h(-3540)24h(-3544)18h(-3556)16h(-3560)24h(-3572)28
h(-3576)28h(-3588)16h(-3592)12h(-3604)24h(-3608)28h(-3620)24
h(-3624)28h(-3640)16h(-3652)12h(-3656)36h(-3668)20h(-3684)20
h(-3688)18h(-3704)40h(-3716)36h(-3720)24h(-3732)16h(-3736)26
h(-3748)20h(-3752)16h(-3764)46h(-3768)12h(-3784)16h(-3796)12
h(-3812)32h(-3828)16h(-3832)16h(-3848)28h(-3860)44h(-3864)24
h(-3876)24h(-3880)12h(-3892)12h(-3896)36h(-3908)20h(-3912)24
h(-3928)10h(-3940)24h(-3944)44h(-3956)36h(-3972)12h(-3976)16
h(-3988)14h(-3992)26h(-4004)40h(-4008)16h(-4020)16h(-4024)20
h(-4036)20h(-4040)28h(-4052)26h(-4072)18h(-4084)22h(-4088)32
h(-4120)12h(-4132)12h(-4136)44h(-4148)20h(-4152)12h(-4164)36
h(-4168)12h(-4180)16h(-4184)42h(-4196)44h(-4216)16h(-4228)16
h(-4244)26h(-4260)16h(-4264)20h(-4276)30h(-4280)36h(-4292)24
h(-4296)32h(-4308)24h(-4324)16h(-4328)22h(-4340)32h(-4344)28
h(-4360)12h(-4372)10h(-4376)26h(-4388)36h(-4404)28h(-4408)20
h(-4420)16h(-4424)48h(-4436)50h(-4440)16h(-4452)16h(-4456)22
h(-4468)14h(-4472)36h(-4484)44h(-4488)16h(-4504)22h(-4516)16
h(-4520)44h(-4532)28h(-4548)20h(-4552)12h(-4564)24h(-4568)18
h(-4580)24h(-4584)32h(-4596)16h(-4612)16h(-4616)56h(-4628)28
h(-4632)24h(-4648)12h(-4660)20h(-4664)36h(-4676)48h(-4692)24
h(-4696)30h(-4708)12h(-4712)16h(-4724)46h(-4728)20h(-4740)16
h(-4744)24h(-4756)20h(-4760)40h(-4772)36h(-4776)28h(-4792)12
h(-4804)16h(-4808)24h(-4820)40h(-4836)40h(-4852)10h(-4856)40
h(-4868)32h(-4872)24h(-4884)32h(-4888)12h(-4904)42h(-4916)38
h(-4920)24h(-4936)24h(-4948)14h(-4952)42h(-4964)32h(-4980)32
h(-4984)16h(-4996)32h(-5012)32h(-5016)24h(-5028)20h(-5032)12
h(-5044)20h(-5048)36h(-5060)40h(-5064)32h(-5080)20h(-5092)20
h(-5108)34h(-5124)24h(-5128)12h(-5140)12h(-5144)58h(-5156)36
h(-5160)16h(-5172)24h(-5176)28h(-5188)12h(-5192)32h(-5204)50
h(-5208)16h(-5224)18h(-5236)24h(-5240)36h(-5252)24h(-5268)20
h(-5272)10h(-5284)24h(-5288)42h(-5304)40h(-5316)36h(-5320)24
h(-5332)20h(-5336)32h(-5348)24h(-5352)20h(-5368)20h(-5380)16
h(-5384)28h(-5396)56h(-5412)16h(-5416)22h(-5428)16h(-5432)24
h(-5444)60h(-5448)24h(-5460)16h(-5464)18h(-5480)44h(-5492)18
h(-5496)28h(-5512)20h(-5524)26h(-5528)38h(-5540)48h(-5556)28
h(-5560)20h(-5572)16h(-5576)48h(-5588)24h(-5592)20h(-5604)28
h(-5608)14h(-5620)24h(-5624)44h(-5636)36h(-5640)32h(-5656)28
h(-5668)16h(-5672)34h(-5704)32h(-5716)22h(-5720)32h(-5732)36
h(-5736)32h(-5748)24h(-5752)16h(-5764)28h(-5768)24h(-5784)32
h(-5812)14h(-5816)60h(-5828)24h(-5844)28h(-5848)16h(-5860)16
h(-5864)58h(-5876)56h(-5892)28h(-5896)16h(-5908)16h(-5912)30
h(-5924)52h(-5928)24h(-5944)20h(-5956)20h(-5960)36h(-5972)22
h(-5988)20h(-5992)16h(-6004)24h(-6008)24h(-6020)40h(-6024)24
h(-6036)40h(-6040)16h(-6052)16h(-6056)50h(-6068)48h(-6072)24
h(-6088)20h(-6104)48h(-6116)52h(-6132)24h(-6136)20h(-6148)16
h(-6152)44h(-6164)36h(-6168)20h(-6180)24h(-6184)34h(-6196)18
h(-6212)40h(-6216)24h(-6232)12h(-6244)32h(-6248)28h(-6260)28
h(-6276)28h(-6280)20h(-6296)54h(-6308)28h(-6312)16h(-6324)40
h(-6328)16h(-6340)24h(-6344)44h(-6356)52h(-6360)32h(-6376)34
h(-6388)14h(-6392)32h(-6404)56h(-6420)16h(-6424)28h(-6436)28
h(-6440)32h(-6452)42h(-6456)28h(-6472)12h(-6484)18h(-6488)30

There are 330 discriminants -d with d in the range [3268,6488]

Return to main page

php/buell_233.html0000644000175100017510000004745711612042572013242 0ustar keithkeith
Class numbers for even negative fundamental discriminants, 6504 ≤ d ≤ 9780
h(-6504)20h(-6520)28h(-6532)16h(-6536)64h(-6548)38h(-6564)44
h(-6568)14h(-6580)16h(-6584)44h(-6596)48h(-6612)16h(-6616)22
h(-6628)16h(-6632)42h(-6644)48h(-6648)20h(-6676)26h(-6680)28
h(-6692)32h(-6708)16h(-6712)20h(-6740)52h(-6744)44h(-6756)36
h(-6772)22h(-6788)28h(-6792)16h(-6808)20h(-6820)16h(-6824)58
h(-6836)42h(-6852)36h(-6856)20h(-6868)16h(-6872)46h(-6884)52
h(-6888)24h(-6904)24h(-6916)24h(-6920)36h(-6932)34h(-6952)16
h(-6964)26h(-6968)44h(-6980)40h(-6996)40h(-7012)20h(-7016)38
h(-7028)28h(-7032)20h(-7044)20h(-7048)24h(-7060)20h(-7064)50
h(-7076)64h(-7080)40h(-7096)20h(-7108)24h(-7112)40h(-7124)68
h(-7140)32h(-7144)20h(-7156)26h(-7160)52h(-7172)36h(-7176)32
h(-7188)24h(-7192)20h(-7204)28h(-7208)32h(-7224)40h(-7240)20
h(-7256)46h(-7268)40h(-7284)36h(-7288)16h(-7304)56h(-7316)40
h(-7320)24h(-7332)24h(-7336)36h(-7348)24h(-7352)28h(-7364)40
h(-7368)16h(-7384)28h(-7412)36h(-7428)20h(-7432)20h(-7444)38
h(-7460)48h(-7464)32h(-7476)40h(-7480)16h(-7492)12h(-7496)56
h(-7508)34h(-7512)24h(-7528)18h(-7540)16h(-7544)64h(-7556)72
h(-7572)20h(-7576)30h(-7588)16h(-7592)28h(-7604)42h(-7608)36
h(-7620)24h(-7624)20h(-7636)28h(-7640)56h(-7652)36h(-7656)48
h(-7672)16h(-7684)40h(-7716)28h(-7720)20h(-7732)18h(-7736)52
h(-7748)48h(-7752)32h(-7764)24h(-7768)22h(-7780)16h(-7784)68
h(-7796)70h(-7816)28h(-7828)16h(-7832)32h(-7844)32h(-7860)40
h(-7864)36h(-7876)20h(-7880)52h(-7892)42h(-7896)32h(-7908)36
h(-7912)12h(-7924)20h(-7928)24h(-7940)40h(-7944)48h(-7960)24
h(-7972)24h(-7976)54h(-7988)42h(-8004)48h(-8008)16h(-8020)32
h(-8024)48h(-8040)32h(-8052)16h(-8056)36h(-8068)12h(-8072)28
h(-8084)68h(-8088)24h(-8104)34h(-8116)34h(-8120)40h(-8132)28
h(-8148)24h(-8152)18h(-8164)32h(-8168)50h(-8180)48h(-8184)32
h(-8196)36h(-8212)18h(-8216)72h(-8248)12h(-8260)24h(-8264)56
h(-8276)38h(-8292)20h(-8296)20h(-8308)16h(-8312)40h(-8324)60
h(-8328)24h(-8340)32h(-8344)24h(-8356)44h(-8360)48h(-8372)40
h(-8376)28h(-8392)24h(-8404)20h(-8408)26h(-8420)48h(-8436)40
h(-8440)28h(-8452)16h(-8456)56h(-8468)36h(-8472)20h(-8484)40
h(-8488)18h(-8504)60h(-8516)56h(-8520)32h(-8536)32h(-8548)16
h(-8552)42h(-8564)78h(-8580)32h(-8584)28h(-8596)28h(-8612)32
h(-8616)40h(-8628)24h(-8632)20h(-8644)36h(-8648)56h(-8660)28
h(-8680)16h(-8692)20h(-8696)64h(-8708)40h(-8724)36h(-8728)22
h(-8740)24h(-8744)42h(-8756)60h(-8760)24h(-8772)24h(-8776)32
h(-8792)36h(-8804)64h(-8808)20h(-8824)32h(-8840)56h(-8852)42
h(-8868)28h(-8872)26h(-8884)18h(-8888)52h(-8904)40h(-8916)48
h(-8920)20h(-8932)16h(-8936)34h(-8948)30h(-8952)28h(-8968)16
h(-8980)32h(-8984)78h(-8996)40h(-9012)36h(-9028)24h(-9032)28
h(-9044)72h(-9048)24h(-9060)32h(-9064)36h(-9076)30h(-9080)28
h(-9092)48h(-9096)56h(-9112)24h(-9124)20h(-9128)40h(-9140)60
h(-9156)32h(-9160)20h(-9172)14h(-9176)76h(-9188)40h(-9192)32
h(-9204)48h(-9208)16h(-9220)24h(-9224)64h(-9236)66h(-9240)32
h(-9256)28h(-9268)24h(-9272)36h(-9284)60h(-9304)22h(-9316)32
h(-9320)60h(-9332)34h(-9336)44h(-9348)32h(-9352)24h(-9364)30
h(-9368)42h(-9380)56h(-9384)24h(-9412)16h(-9416)56h(-9428)42
h(-9444)36h(-9448)26h(-9460)32h(-9476)72h(-9480)24h(-9492)24
h(-9496)22h(-9508)16h(-9512)60h(-9524)38h(-9528)28h(-9544)32
h(-9556)34h(-9560)48h(-9572)60h(-9588)32h(-9592)20h(-9608)40
h(-9620)40h(-9624)60h(-9636)40h(-9640)16h(-9652)24h(-9656)72
h(-9668)36h(-9672)24h(-9688)20h(-9704)54h(-9716)56h(-9732)20
h(-9736)32h(-9748)18h(-9752)28h(-9764)76h(-9768)32h(-9780)32

There are 330 discriminants -d with d in the range [6504,9780]

Return to main page

php/buell_234.html0000644000175100017510000000363011612042674013227 0ustar keithkeith
Class numbers for even negative fundamental discriminants, 9784 ≤ d ≤ 9992
h(-9784)28h(-9796)40h(-9812)52h(-9816)32h(-9832)18h(-9844)36
h(-9848)32h(-9860)32h(-9876)52h(-9880)32h(-9892)20h(-9896)78
h(-9908)38h(-9912)32h(-9924)52h(-9928)24h(-9940)24h(-9944)56
h(-9956)44h(-9960)32h(-9976)20h(-9988)28h(-9992)40

There are 23 discriminants -d with d in the range [9784,9992]

Return to main page

php/buell_236.html0000644000175100017510000010041211611727722013230 0ustar keithkeith
Class numbers for forms of odd positive fundamental discriminant d, 5 ≤ d ≤ 2181
h(5)1- h(13)1- h(17)1- h(21)2+ h(29)1- h(33)2+ h(37)1- h(41)1-
h(53)1- h(57)2+ h(61)1- h(65)2- h(69)2+ h(73)1- h(77)2+ h(85)2-
h(89)1- h(93)2+ h(97)1- h(101)1- h(105)4+ h(109)1- h(113)1- h(129)2+
h(133)2+ h(137)1- h(141)2+ h(145)4- h(149)1- h(157)1- h(161)2+ h(165)4+
h(173)1- h(177)2+ h(181)1- h(185)2- h(193)1- h(197)1- h(201)2+ h(205)4+
h(209)2+ h(213)2+ h(217)2+ h(221)4+ h(229)3- h(233)1- h(237)2+ h(241)1-
h(249)2+ h(253)2+ h(257)3- h(265)2- h(269)1- h(273)4+ h(277)1- h(281)1-
h(285)4+ h(293)1- h(301)2+ h(305)4+ h(309)2+ h(313)1- h(317)1- h(321)6+
h(329)2+ h(337)1- h(341)2+ h(345)4+ h(349)1- h(353)1- h(357)4+ h(365)2-
h(373)1- h(377)4+ h(381)2+ h(385)4+ h(389)1- h(393)2+ h(397)1- h(401)5-
h(409)1- h(413)2+ h(417)2+ h(421)1- h(429)4+ h(433)1- h(437)2+ h(445)4-
h(449)1- h(453)2+ h(457)1- h(461)1- h(465)4+ h(469)6+ h(473)6+ h(481)2-
h(485)2- h(489)2+ h(493)2- h(497)2+ h(501)2+ h(505)8+ h(509)1- h(517)2+
h(521)1- h(533)2- h(537)2+ h(541)1- h(545)4+ h(553)2+ h(557)1- h(561)4+
h(565)2- h(569)1- h(573)2+ h(577)7- h(581)2+ h(589)2+ h(593)1- h(597)2+
h(601)1- h(609)4+ h(613)1- h(617)1- h(629)2- h(633)2+ h(641)1- h(645)4+
h(649)2+ h(653)1- h(661)1- h(665)4+ h(669)2+ h(673)1- h(677)1- h(681)2+
h(685)2- h(689)8+ h(697)6- h(701)1- h(705)4+ h(709)1- h(713)2+ h(717)2+
h(721)2+ h(733)3- h(737)2+ h(741)4+ h(745)4+ h(749)2+ h(753)2+ h(757)1-
h(761)3- h(769)1- h(773)1- h(777)8+ h(781)2+ h(785)6- h(789)2+ h(793)8+
h(797)1- h(805)4+ h(809)1- h(813)2+ h(817)10+ h(821)1- h(829)1- h(849)2+
h(853)1- h(857)1- h(861)4+ h(865)2- h(869)2+ h(877)1- h(881)1- h(885)4+
h(889)2+ h(893)2+ h(897)8+ h(901)4- h(905)8+ h(913)2+ h(917)2+ h(921)2+
h(929)1- h(933)2+ h(937)1- h(941)1- h(949)2- h(953)1- h(957)4+ h(965)2-
h(969)4+ h(973)2+ h(977)1- h(985)6- h(989)2+ h(993)6+ h(997)1- h(1001)4+
h(1005)4+ h(1009)7- h(1013)1- h(1021)1- h(1033)1- h(1037)2- h(1041)2+ h(1045)8+
h(1049)1- h(1057)2+ h(1061)1- h(1065)4+ h(1069)1- h(1073)2- h(1077)2+ h(1081)2+
h(1085)4+ h(1093)5- h(1097)1- h(1101)6+ h(1105)4- h(1109)1- h(1113)4+ h(1117)1-
h(1121)2+ h(1129)9- h(1133)2+ h(1137)2+ h(1141)2+ h(1145)4- h(1149)2+ h(1153)1-
h(1157)2- h(1165)2- h(1169)2+ h(1173)4+ h(1177)2+ h(1181)1- h(1185)4+ h(1189)2-
h(1193)1- h(1201)1- h(1205)4+ h(1209)4+ h(1213)1- h(1217)1- h(1221)8+ h(1229)3-
h(1237)1- h(1241)2- h(1245)4+ h(1249)1- h(1253)2+ h(1257)6+ h(1261)2- h(1265)4+
h(1273)2+ h(1277)1- h(1281)4+ h(1285)2- h(1289)1- h(1293)2+ h(1297)11- h(1301)1-
h(1309)4+ h(1313)4- h(1317)2+ h(1321)1- h(1329)2+ h(1333)2+ h(1337)2+ h(1345)12+
h(1349)2+ h(1353)4+ h(1357)2+ h(1361)1- h(1365)8+ h(1373)3- h(1381)1- h(1385)2-
h(1389)2+ h(1393)10+ h(1397)2+ h(1401)2+ h(1405)4+ h(1409)1- h(1417)2- h(1429)5-
h(1433)1- h(1437)2+ h(1441)2+ h(1453)1- h(1457)2+ h(1461)2+ h(1465)2- h(1469)4+
h(1473)2+ h(1477)2+ h(1481)1- h(1489)3- h(1493)1- h(1497)2+ h(1501)2+ h(1505)4+
h(1509)6+ h(1513)4+ h(1517)4+ h(1529)2+ h(1533)4+ h(1537)4+ h(1541)2+ h(1545)4+
h(1549)1- h(1553)1- h(1561)2+ h(1565)2- h(1569)2+ h(1577)2+ h(1581)4+ h(1585)2-
h(1589)2+ h(1597)1- h(1601)7- h(1605)4+ h(1609)1- h(1613)1- h(1621)1- h(1633)2+
h(1637)1- h(1641)10+ h(1645)4+ h(1649)2- h(1653)4+ h(1657)1- h(1661)2+ h(1669)1-
h(1673)2+ h(1677)8+ h(1685)2- h(1689)2+ h(1693)1- h(1697)1- h(1705)16+ h(1709)1-
h(1713)2+ h(1717)4+ h(1721)1- h(1729)4+ h(1733)1- h(1741)1- h(1745)4- h(1749)4+
h(1753)1- h(1757)2+ h(1761)14+ h(1765)6- h(1769)2- h(1777)1- h(1781)2- h(1785)16+
h(1789)1- h(1793)2+ h(1797)2+ h(1801)1- h(1817)2+ h(1821)2+ h(1829)2+ h(1833)4+
h(1837)2+ h(1841)2+ h(1853)2- h(1857)2+ h(1861)1- h(1865)2- h(1869)4+ h(1873)1-
h(1877)1- h(1885)8+ h(1889)1- h(1893)2+ h(1897)10+ h(1901)3- h(1905)4+ h(1909)2+
h(1913)1- h(1921)2- h(1929)6+ h(1933)1- h(1937)6- h(1941)2+ h(1945)4+ h(1949)1-
h(1957)6+ h(1961)4+ h(1965)4+ h(1969)2+ h(1973)1- h(1977)2+ h(1981)2+ h(1985)2-
h(1993)1- h(1997)1- h(2001)4+ h(2005)8+ h(2013)4+ h(2017)1- h(2021)6+ h(2029)7-
h(2033)2+ h(2037)4+ h(2041)4+ h(2045)4+ h(2049)2+ h(2053)1- h(2065)4+ h(2069)1-
h(2073)2+ h(2077)2+ h(2081)5- h(2085)4+ h(2089)3- h(2093)4+ h(2101)6+ h(2105)4+
h(2109)4+ h(2113)1- h(2117)2- h(2121)4+ h(2129)1- h(2137)1- h(2141)1- h(2145)8+
h(2149)2+ h(2153)5- h(2157)2+ h(2161)1- h(2165)2- h(2173)2- h(2177)6+ h(2181)2+

There are 440 discriminants in the range [52181]

Return to main page

php/buell_237.html0000644000175100017510000010076711611727731013246 0ustar keithkeith
Class numbers for forms of odd positive fundamental discriminant d, 2185 ≤ d ≤ 4349
h(2185)4+ h(2189)2+ h(2193)4+ h(2201)2+ h(2213)3- h(2217)2+ h(2221)1- h(2229)2+
h(2233)12+ h(2237)1- h(2245)4+ h(2249)4- h(2253)2+ h(2257)2- h(2261)4+ h(2265)4+
h(2269)1- h(2273)1- h(2281)1- h(2285)2- h(2289)8+ h(2293)1- h(2297)1- h(2301)4+
h(2305)16- h(2309)1- h(2317)2+ h(2321)2+ h(2329)4+ h(2333)1- h(2337)4+ h(2341)1-
h(2345)4+ h(2353)4+ h(2357)1- h(2361)2+ h(2365)4+ h(2369)2+ h(2373)4+ h(2377)1-
h(2381)1- h(2389)1- h(2393)1- h(2397)4+ h(2405)4- h(2409)4+ h(2413)2+ h(2417)1-
h(2429)6+ h(2433)2+ h(2437)1- h(2441)1- h(2445)4+ h(2449)2+ h(2453)2+ h(2461)2+
h(2465)4- h(2469)2+ h(2473)1- h(2477)1- h(2481)2+ h(2485)4+ h(2489)2+ h(2497)2+
h(2501)4- h(2505)12+ h(2509)2- h(2513)2+ h(2517)2+ h(2521)1- h(2533)8+ h(2537)2+
h(2545)4- h(2549)1- h(2553)4+ h(2557)3- h(2561)2- h(2569)2+ h(2573)2+ h(2577)2+
h(2581)2- h(2585)4+ h(2589)6+ h(2593)1- h(2605)8- h(2609)1- h(2613)4+ h(2617)1-
h(2621)1- h(2629)2+ h(2633)1- h(2641)2+ h(2649)2+ h(2653)2+ h(2657)1- h(2661)2+
h(2665)4- h(2669)8+ h(2677)3- h(2681)2+ h(2685)4+ h(2689)1- h(2693)1- h(2697)4+
h(2701)4+ h(2705)8- h(2713)3- h(2717)4+ h(2721)2+ h(2729)1- h(2733)2+ h(2737)4+
h(2741)1- h(2749)1- h(2753)1- h(2757)2+ h(2761)2+ h(2765)4+ h(2769)4+ h(2773)2+
h(2777)3- h(2785)2- h(2789)1- h(2797)1- h(2801)1- h(2805)8+ h(2813)2- h(2821)4+
h(2829)4+ h(2833)1- h(2837)1- h(2841)2+ h(2845)4+ h(2849)8+ h(2857)3- h(2861)1-
h(2865)4+ h(2869)2+ h(2877)4+ h(2881)2+ h(2885)2- h(2893)2+ h(2897)1- h(2901)2+
h(2905)4+ h(2909)1- h(2913)14+ h(2917)3- h(2921)2+ h(2929)2- h(2933)2+ h(2937)4+
h(2941)6- h(2945)8+ h(2949)2+ h(2953)1- h(2957)1- h(2965)2- h(2969)1- h(2973)2+
h(2977)2- h(2981)6+ h(2985)4+ h(2993)12+ h(3001)1- h(3005)4+ h(3009)4+ h(3013)2+
h(3017)2+ h(3021)12+ h(3029)4- h(3037)1- h(3041)1- h(3045)8+ h(3049)1- h(3053)2+
h(3057)2+ h(3061)1- h(3065)2- h(3073)2+ h(3077)2- h(3081)16+ h(3085)2- h(3089)1-
h(3093)2+ h(3097)2+ h(3101)2+ h(3109)1- h(3113)2+ h(3117)2+ h(3121)5- h(3129)20+
h(3133)2- h(3137)9- h(3145)4- h(3149)2+ h(3153)2+ h(3157)4+ h(3161)4- h(3165)4+
h(3169)1- h(3173)6+ h(3181)5- h(3189)2+ h(3193)2+ h(3197)2+ h(3201)16+ h(3205)4+
h(3209)1- h(3217)1- h(3221)3- h(3229)3- h(3233)2- h(3237)4+ h(3241)2+ h(3245)8+
h(3253)5- h(3257)1- h(3261)6+ h(3265)2- h(3269)2+ h(3273)2+ h(3277)2- h(3281)6-
h(3289)4+ h(3293)2- h(3297)4+ h(3301)1- h(3305)12+ h(3309)2+ h(3313)1- h(3317)2+
h(3329)1- h(3333)4+ h(3337)2+ h(3341)4- h(3345)4+ h(3349)2- h(3353)2+ h(3361)1-
h(3365)2- h(3369)2+ h(3373)1- h(3377)2+ h(3385)2- h(3389)1- h(3397)2+ h(3401)2+
h(3405)4+ h(3409)2+ h(3413)1- h(3417)4+ h(3421)2+ h(3433)1- h(3437)2+ h(3441)4+
h(3445)4- h(3449)1- h(3453)2+ h(3457)1- h(3461)1- h(3469)1- h(3473)2+ h(3477)8+
h(3485)4- h(3489)2+ h(3493)2+ h(3497)4+ h(3505)4+ h(3513)2+ h(3517)1- h(3521)2+
h(3529)1- h(3533)1- h(3541)1- h(3545)4- h(3553)4+ h(3557)1- h(3561)2+ h(3565)4+
h(3569)6+ h(3581)1- h(3585)20+ h(3589)2- h(3593)1- h(3597)4+ h(3601)20- h(3605)4+
h(3613)1- h(3617)1- h(3621)4+ h(3629)2+ h(3633)4+ h(3637)1- h(3641)2+ h(3649)2-
h(3653)2- h(3657)4+ h(3661)2+ h(3665)2- h(3669)2+ h(3673)1- h(3677)1- h(3685)4+
h(3689)4+ h(3693)2+ h(3697)1- h(3701)1- h(3705)8+ h(3709)1- h(3713)2+ h(3729)4+
h(3733)1- h(3737)4+ h(3741)4+ h(3745)4+ h(3749)2+ h(3761)1- h(3765)4+ h(3769)1-
h(3777)2+ h(3781)2+ h(3785)2- h(3793)1- h(3797)1- h(3801)4+ h(3805)8+ h(3809)2-
h(3813)4+ h(3817)2+ h(3821)1- h(3829)2+ h(3833)1- h(3837)2+ h(3841)2+ h(3845)4-
h(3849)2+ h(3853)1- h(3857)4+ h(3865)2- h(3869)2- h(3873)6+ h(3877)3- h(3881)1-
h(3885)8+ h(3889)3- h(3893)4+ h(3901)2+ h(3905)8+ h(3909)2+ h(3913)4+ h(3917)1-
h(3921)2+ h(3929)1- h(3937)2+ h(3941)6+ h(3945)4+ h(3949)2+ h(3953)2+ h(3957)6+
h(3961)2- h(3965)8+ h(3973)6- h(3977)2- h(3981)6+ h(3985)2- h(3989)1- h(3997)10+
h(4001)3- h(4009)22+ h(4013)1- h(4017)8+ h(4021)1- h(4029)4+ h(4033)2- h(4037)2+
h(4045)4- h(4049)1- h(4053)8+ h(4057)1- h(4061)2+ h(4065)12+ h(4069)4+ h(4073)1-
h(4081)8+ h(4085)4+ h(4089)4+ h(4093)1- h(4097)10- h(4101)2+ h(4105)4+ h(4109)2+
h(4117)2+ h(4121)2- h(4129)1- h(4133)1- h(4137)4+ h(4141)2- h(4145)4+ h(4153)1-
h(4157)1- h(4161)16+ h(4169)2+ h(4173)8+ h(4177)1- h(4181)2- h(4189)2+ h(4193)6+
h(4197)2+ h(4201)1- h(4209)4+ h(4213)2+ h(4217)1- h(4229)7- h(4233)4+ h(4237)2+
h(4241)1- h(4245)4+ h(4249)2+ h(4253)1- h(4261)1- h(4265)2- h(4269)2+ h(4273)1-
h(4277)4+ h(4281)6+ h(4285)2- h(4289)1- h(4297)1- h(4301)4+ h(4305)16+ h(4309)2+
h(4313)2+ h(4317)2+ h(4321)20+ h(4333)2+ h(4337)1- h(4341)2+ h(4345)24+ h(4349)1-

There are 440 discriminants in the range [2185,4349]

Return to main page

php/buell_238.html0000644000175100017510000010077411611726637013251 0ustar keithkeith
Class numbers for forms of odd positive fundamental discriminant d, 4353 ≤ d ≤ 6529
h(4353)10+ h(4357)5- h(4369)4+ h(4373)1- h(4377)2+ h(4381)4+ h(4385)2- h(4389)8+
h(4393)2+ h(4397)1- h(4405)4+ h(4409)9- h(4413)2+ h(4417)2+ h(4421)1- h(4429)2+
h(4433)4+ h(4441)5- h(4445)4+ h(4449)2+ h(4453)4+ h(4457)1- h(4461)2+ h(4465)4+
h(4469)2- h(4481)3- h(4485)8+ h(4493)3- h(4497)2+ h(4501)2+ h(4505)4- h(4513)1-
h(4517)1- h(4521)4+ h(4529)2+ h(4533)2+ h(4537)2- h(4541)2+ h(4549)1- h(4553)2-
h(4561)1- h(4565)4+ h(4569)2+ h(4573)2- h(4577)2+ h(4585)4+ h(4589)2- h(4593)2+
h(4597)3- h(4601)2+ h(4605)4+ h(4609)2+ h(4613)2+ h(4621)1- h(4629)2+ h(4633)4+
h(4637)1- h(4641)24+ h(4645)4+ h(4649)3- h(4657)1- h(4661)2+ h(4665)4+ h(4669)16+
h(4673)1- h(4677)2+ h(4681)2+ h(4685)2- h(4697)4+ h(4701)2+ h(4705)8+ h(4709)2-
h(4713)2+ h(4717)4+ h(4721)1- h(4729)3- h(4733)1- h(4737)2+ h(4741)2+ h(4745)4-
h(4749)6+ h(4757)10+ h(4765)6- h(4769)2+ h(4773)4+ h(4777)4- h(4781)2+ h(4785)8+
h(4789)1- h(4793)1- h(4801)1- h(4809)4+ h(4813)1- h(4817)1- h(4821)2+ h(4829)2+
h(4837)2+ h(4841)6+ h(4845)8+ h(4849)4+ h(4853)6+ h(4857)6+ h(4861)1- h(4865)20+
h(4873)2+ h(4877)1- h(4881)2+ h(4885)2- h(4889)5- h(4893)4+ h(4897)2+ h(4909)1-
h(4917)4+ h(4921)4+ h(4929)4+ h(4933)3- h(4937)1- h(4945)4+ h(4953)8+ h(4957)1-
h(4965)4+ h(4969)1- h(4973)1- h(4981)8+ h(4985)2- h(4989)2+ h(4993)1- h(4997)2+
h(5001)2+ h(5005)8+ h(5009)1- h(5017)4+ h(5021)1- h(5029)2+ h(5033)2+ h(5037)8+
h(5045)4- h(5053)2+ h(5057)4+ h(5061)4+ h(5065)2- h(5069)4+ h(5073)12+ h(5077)1-
h(5081)3- h(5089)6+ h(5093)2+ h(5097)2+ h(5101)1- h(5105)8+ h(5109)8+ h(5113)1-
h(5117)4+ h(5129)2+ h(5133)4+ h(5137)2+ h(5141)4+ h(5149)2+ h(5153)1- h(5161)2-
h(5165)2- h(5169)2+ h(5173)2+ h(5177)2+ h(5181)8+ h(5185)20- h(5189)1- h(5197)1-
h(5201)2+ h(5205)4+ h(5209)1- h(5213)2- h(5217)8+ h(5221)2+ h(5233)1- h(5237)1-
h(5241)10+ h(5245)4- h(5249)16+ h(5253)4+ h(5257)2+ h(5261)3- h(5269)10+ h(5273)7-
h(5277)2+ h(5281)3- h(5285)4+ h(5289)4+ h(5293)2+ h(5297)3- h(5305)8- h(5309)1-
h(5313)8+ h(5317)2- h(5321)2- h(5333)3- h(5345)4+ h(5349)2+ h(5353)6- h(5357)2+
h(5361)2+ h(5365)4- h(5369)12+ h(5377)2+ h(5381)1- h(5385)4+ h(5389)2- h(5393)1-
h(5397)4+ h(5401)2+ h(5405)4+ h(5413)1- h(5417)7- h(5421)8+ h(5429)2- h(5433)2+
h(5437)1- h(5441)1- h(5449)1- h(5453)4+ h(5457)4+ h(5461)2+ h(5465)2- h(5469)2+
h(5473)2- h(5477)3- h(5485)2- h(5489)2+ h(5493)2+ h(5497)6+ h(5501)1- h(5505)4+
h(5509)2+ h(5513)16+ h(5521)9- h(5529)12+ h(5533)2+ h(5541)2+ h(5545)4- h(5549)2+
h(5557)1- h(5561)2+ h(5565)8+ h(5569)1- h(5573)1- h(5581)1- h(5585)2- h(5593)4+
h(5597)2- h(5601)2+ h(5605)8+ h(5609)2+ h(5613)6+ h(5617)2- h(5621)12+ h(5629)12-
h(5633)2+ h(5637)6+ h(5641)1- h(5645)4+ h(5649)4+ h(5653)1- h(5657)1- h(5665)4+
h(5669)1- h(5673)4+ h(5677)2+ h(5681)4+ h(5685)12+ h(5689)1- h(5693)1- h(5701)1-
h(5705)4+ h(5709)4+ h(5713)8- h(5717)1- h(5721)2+ h(5729)2- h(5737)1- h(5741)3-
h(5745)4+ h(5749)1- h(5753)2+ h(5757)4+ h(5761)2+ h(5765)2- h(5773)2+ h(5777)10-
h(5781)4+ h(5785)4- h(5789)2+ h(5793)2+ h(5797)4+ h(5801)1- h(5809)8+ h(5813)1-
h(5817)8+ h(5821)3- h(5829)4+ h(5833)2+ h(5837)2- h(5845)4+ h(5849)1- h(5853)6+
h(5857)1- h(5861)1- h(5865)16+ h(5869)1- h(5873)2+ h(5881)1- h(5885)4+ h(5889)4+
h(5893)2+ h(5897)1- h(5901)12+ h(5905)4+ h(5909)2+ h(5917)4+ h(5921)2+ h(5933)4-
h(5937)2+ h(5941)2- h(5945)8+ h(5953)1- h(5957)4+ h(5961)2+ h(5965)2- h(5969)2+
h(5973)8+ h(5977)2+ h(5981)1- h(5989)4+ h(5993)2- h(5997)2+ h(6001)8+ h(6005)4+
h(6009)2+ h(6013)2+ h(6017)2+ h(6029)1- h(6033)2+ h(6037)1- h(6041)2+ h(6045)8+
h(6049)2+ h(6053)3- h(6061)4+ h(6065)2- h(6073)1- h(6077)2+ h(6081)22+ h(6085)10-
h(6089)1- h(6097)28+ h(6101)1- h(6105)8+ h(6109)2- h(6113)5- h(6117)2+ h(6121)1-
h(6133)3- h(6141)4+ h(6145)4- h(6149)4+ h(6153)12+ h(6157)10+ h(6161)2- h(6169)2+
h(6173)1- h(6177)4+ h(6181)2+ h(6185)6- h(6189)2+ h(6193)2+ h(6197)1- h(6205)4-
h(6209)6+ h(6213)4+ h(6217)1- h(6221)1- h(6229)1- h(6233)2+ h(6245)4- h(6249)2+
h(6257)1- h(6261)2+ h(6265)4+ h(6269)1- h(6277)1- h(6281)2+ h(6285)4+ h(6289)6+
h(6293)4+ h(6297)2+ h(6301)1- h(6305)4- h(6313)2+ h(6317)1- h(6329)1- h(6333)2+
h(6337)1- h(6341)4+ h(6349)2+ h(6353)1- h(6357)4+ h(6361)1- h(6365)4+ h(6369)4+
h(6373)1- h(6377)2+ h(6385)2- h(6389)1- h(6393)2+ h(6397)1- h(6401)12- h(6405)8+
h(6409)8- h(6421)1- h(6429)2+ h(6433)2+ h(6437)2- h(6441)4+ h(6445)4- h(6449)1-
h(6457)2+ h(6461)4+ h(6465)4+ h(6469)1- h(6473)1- h(6477)4+ h(6481)5- h(6485)2-
h(6493)2+ h(6497)8+ h(6501)4+ h(6505)4+ h(6509)2+ h(6513)4+ h(6521)1- h(6529)1-

There are 440 discriminants in the range [4353,6529]

Return to main page

php/buell_239.html0000644000175100017510000010100711611727466013241 0ustar keithkeith
Class nubers for forms of odd positive fundamental discriminant d, 6533 ≤ d ≤ 8693
h(6533)2+ h(6537)2+ h(6541)2+ h(6545)8+ h(6549)12+ h(6553)1- h(6557)6+ h(6565)8-
h(6569)1- h(6573)4+ h(6577)1- h(6581)1- h(6585)4+ h(6589)2+ h(6593)2+ h(6601)12+
h(6605)4+ h(6609)2+ h(6613)4+ h(6617)2- h(6621)2+ h(6629)2+ h(6637)3- h(6641)2-
h(6645)4+ h(6649)4- h(6653)1- h(6657)4+ h(6661)1- h(6665)4+ h(6673)1- h(6677)2+
h(6681)12+ h(6685)12+ h(6689)1- h(6693)4+ h(6697)4+ h(6701)1- h(6709)1- h(6717)2+
h(6721)4+ h(6729)2+ h(6733)1- h(6737)1- h(6745)8+ h(6749)2- h(6753)2+ h(6757)8-
h(6761)1- h(6765)8+ h(6769)2+ h(6773)4+ h(6781)1- h(6785)4+ h(6789)4+ h(6793)1-
h(6797)2+ h(6801)2+ h(6805)8+ h(6809)18+ h(6817)2- h(6821)2+ h(6829)1- h(6833)1-
h(6837)4+ h(6841)1- h(6853)4+ h(6857)1- h(6861)2+ h(6865)2- h(6869)1- h(6873)4+
h(6881)2+ h(6893)4- h(6901)6+ h(6905)4+ h(6913)2+ h(6917)1- h(6933)2+ h(6937)2+
h(6941)2+ h(6945)20+ h(6949)5- h(6953)8- h(6961)1- h(6965)4+ h(6969)4+ h(6973)2+
h(6977)1- h(6981)8+ h(6985)4+ h(6989)4- h(6997)3- h(7001)1- h(7005)4+ h(7009)2+
h(7013)1- h(7017)2+ h(7021)4+ h(7033)2- h(7037)2+ h(7041)2+ h(7045)4- h(7049)20+
h(7053)6+ h(7057)21- h(7061)2+ h(7069)1- h(7073)2+ h(7077)8+ h(7081)4+ h(7085)4-
h(7089)4+ h(7093)4- h(7097)2+ h(7109)1- h(7113)2+ h(7117)6+ h(7121)1- h(7129)1-
h(7133)2+ h(7141)2- h(7145)4+ h(7149)2+ h(7153)2+ h(7157)4+ h(7161)8+ h(7165)2-
h(7169)2+ h(7177)1- h(7181)2+ h(7185)4+ h(7189)4+ h(7193)1- h(7197)2+ h(7201)2+
h(7205)8+ h(7213)1- h(7217)2+ h(7221)20+ h(7229)5- h(7233)2+ h(7237)1- h(7241)2-
h(7249)6+ h(7253)1- h(7257)4+ h(7261)2- h(7265)2- h(7269)2+ h(7273)6+ h(7277)2+
h(7285)4+ h(7289)8+ h(7293)8+ h(7297)1- h(7305)4+ h(7309)1- h(7313)2+ h(7321)1-
h(7329)4+ h(7333)1- h(7337)4+ h(7341)2+ h(7345)4- h(7349)1- h(7357)2+ h(7361)4+
h(7365)4+ h(7369)1- h(7373)2- h(7377)2+ h(7385)4+ h(7393)1- h(7397)4- h(7401)2+
h(7405)4+ h(7409)2+ h(7413)4+ h(7417)1- h(7421)2- h(7429)4+ h(7433)1- h(7437)8+
h(7441)6+ h(7445)4+ h(7449)16+ h(7453)12+ h(7457)1- h(7465)18- h(7469)4+ h(7473)12+
h(7477)1- h(7481)3- h(7485)4+ h(7489)1- h(7493)2+ h(7501)2- h(7505)8+ h(7509)2+
h(7513)10+ h(7517)1- h(7521)4+ h(7529)1- h(7537)3- h(7541)1- h(7545)4+ h(7549)1-
h(7553)4+ h(7557)8+ h(7561)1- h(7565)8+ h(7573)9- h(7577)1- h(7585)8- h(7589)1-
h(7593)2+ h(7597)2+ h(7601)6+ h(7609)2+ h(7613)2+ h(7617)2+ h(7621)1- h(7629)2+
h(7633)2- h(7637)2+ h(7645)8+ h(7649)1- h(7653)2+ h(7657)4+ h(7661)2+ h(7665)24+
h(7669)1- h(7673)3- h(7681)1- h(7685)8+ h(7689)4+ h(7697)2+ h(7701)4+ h(7705)20+
h(7709)6- h(7717)1- h(7721)6+ h(7729)2+ h(7733)4+ h(7737)2+ h(7741)1- h(7745)12-
h(7753)3- h(7757)1- h(7761)8+ h(7765)2- h(7769)4+ h(7773)2+ h(7777)4+ h(7781)2+
h(7789)1- h(7793)1- h(7797)4+ h(7801)2- h(7805)4+ h(7809)4+ h(7813)4+ h(7817)5-
h(7829)1- h(7833)16+ h(7837)4- h(7841)1- h(7845)4+ h(7849)2+ h(7853)1- h(7861)10+
h(7869)4+ h(7873)9- h(7877)1- h(7881)24+ h(7885)4+ h(7897)4- h(7901)1- h(7905)8+
h(7909)2+ h(7913)2- h(7917)8+ h(7933)1- h(7937)1- h(7941)2+ h(7945)4+ h(7949)1-
h(7953)4+ h(7957)8+ h(7961)2+ h(7969)2- h(7973)4+ h(7977)2+ h(7981)2+ h(7985)2-
h(7989)2+ h(7993)1- h(7997)2+ h(8005)8- h(8009)1- h(8013)2+ h(8017)3- h(8021)2-
h(8029)4+ h(8033)4+ h(8041)4+ h(8045)4+ h(8049)10+ h(8053)1- h(8057)6+ h(8061)2+
h(8065)2- h(8069)3- h(8077)4- h(8081)1- h(8089)1- h(8093)1- h(8097)14+ h(8101)13-
h(8105)16+ h(8113)12+ h(8117)1- h(8121)10+ h(8129)2+ h(8133)2+ h(8137)2+ h(8141)2+
h(8149)8+ h(8153)2+ h(8157)2+ h(8161)1- h(8165)4+ h(8169)4+ h(8173)6+ h(8177)4-
h(8185)14- h(8189)2+ h(8193)2+ h(8197)2+ h(8201)2+ h(8205)4+ h(8209)1- h(8213)2+
h(8221)1- h(8229)16+ h(8233)1- h(8237)1- h(8241)4+ h(8245)4- h(8249)2- h(8257)2+
h(8261)2+ h(8265)8+ h(8269)1- h(8273)1- h(8277)12+ h(8285)6- h(8293)1- h(8297)1-
h(8301)2+ h(8305)8+ h(8309)10+ h(8313)4+ h(8317)1- h(8321)10- h(8329)1- h(8333)4+
h(8337)4+ h(8341)2+ h(8345)4- h(8353)1- h(8357)4+ h(8365)4+ h(8369)1- h(8373)6+
h(8377)1- h(8385)8+ h(8389)1- h(8393)4+ h(8401)2+ h(8409)2+ h(8413)2+ h(8417)2+
h(8421)4+ h(8429)1- h(8437)4+ h(8441)26+ h(8445)4+ h(8449)4+ h(8453)2+ h(8457)2+
h(8461)1- h(8465)14- h(8473)16+ h(8481)4+ h(8485)2- h(8489)4+ h(8493)4+ h(8497)2-
h(8501)5- h(8509)2+ h(8513)1- h(8517)4+ h(8521)1- h(8529)2+ h(8533)4+ h(8537)1-
h(8545)12- h(8549)2+ h(8553)2+ h(8557)2+ h(8561)2+ h(8565)4+ h(8569)20+ h(8573)1-
h(8581)3- h(8585)8+ h(8589)4+ h(8593)2- h(8597)3- h(8601)8+ h(8605)8+ h(8609)1-
h(8617)2+ h(8621)4+ h(8629)1- h(8633)4+ h(8637)6+ h(8641)1- h(8645)8+ h(8653)8-
h(8657)2+ h(8661)14+ h(8665)2- h(8669)1- h(8677)1- h(8681)1- h(8689)5- h(8693)1-

There are 440 discriminants in the range [6533,8693]

Return to main page

php/buell_240.html0000644000175100017510000004735311611727672013245 0ustar keithkeith
Class numbers for forms of odd positive fundamental discriminant d, 8697 ≤ d ≤ 9993
h(8697)4+ h(8701)8+ h(8705)8+ h(8709)2+ h(8713)3- h(8717)2+ h(8729)4+ h(8733)4+
h(8737)1- h(8741)1- h(8745)24+ h(8749)4+ h(8753)1- h(8761)27- h(8765)2- h(8769)12+
h(8773)14+ h(8777)2+ h(8781)2+ h(8785)4+ h(8789)12+ h(8797)2+ h(8801)8+ h(8805)4+
h(8809)2+ h(8813)2+ h(8817)2+ h(8821)1- h(8837)3- h(8841)8+ h(8845)8+ h(8849)1-
h(8853)4+ h(8857)2- h(8861)1- h(8873)2+ h(8877)4+ h(8881)2+ h(8885)2- h(8889)2+
h(8893)1- h(8897)4+ h(8905)12- h(8909)6+ h(8913)2+ h(8917)2- h(8921)2+ h(8929)1-
h(8933)1- h(8941)1- h(8945)4- h(8949)8+ h(8953)2+ h(8961)4+ h(8965)4+ h(8969)1-
h(8977)2+ h(8981)2+ h(8985)4+ h(8989)2- h(8997)2+ h(9001)1- h(9005)4+ h(9013)1-
h(9017)2+ h(9021)16+ h(9029)7- h(9033)2+ h(9037)2+ h(9041)1- h(9049)7- h(9053)2+
h(9057)2+ h(9061)4- h(9069)2+ h(9073)6+ h(9077)4+ h(9085)4+ h(9089)4- h(9093)4+
h(9097)2+ h(9101)14+ h(9105)4+ h(9109)1- h(9113)4+ h(9121)2+ h(9129)4+ h(9133)3-
h(9137)1- h(9141)4+ h(9145)8+ h(9149)6+ h(9157)1- h(9161)1- h(9165)8+ h(9169)2-
h(9173)1- h(9177)8+ h(9181)5- h(9185)4+ h(9193)2- h(9197)2- h(9201)2+ h(9205)4+
h(9209)1- h(9213)8+ h(9217)18- h(9221)1- h(9229)10+ h(9233)2+ h(9237)2+ h(9241)1-
h(9249)2+ h(9253)2+ h(9257)1- h(9265)4- h(9269)4+ h(9273)4+ h(9277)1- h(9281)3-
h(9285)4+ h(9289)14+ h(9293)3- h(9301)6+ h(9305)8- h(9309)4+ h(9313)2+ h(9321)20+
h(9329)2+ h(9337)1- h(9341)1- h(9345)16+ h(9349)1- h(9353)2+ h(9357)2+ h(9361)4+
h(9365)2- h(9373)4+ h(9377)1- h(9381)4+ h(9385)2- h(9389)2- h(9393)4+ h(9397)1-
h(9401)4+ h(9413)3- h(9417)4+ h(9421)1- h(9429)4+ h(9433)1- h(9437)1- h(9445)4+
h(9449)2+ h(9453)4+ h(9461)1- h(9465)4+ h(9469)4+ h(9473)1- h(9481)2+ h(9485)4+
h(9489)2+ h(9493)2+ h(9497)1- h(9501)2+ h(9505)28+ h(9509)2- h(9517)6+ h(9521)1-
h(9529)2- h(9533)1- h(9541)4+ h(9545)4+ h(9553)10- h(9557)2+ h(9561)2+ h(9565)6-
h(9569)2+ h(9573)2+ h(9577)2- h(9581)4+ h(9589)2+ h(9593)2- h(9597)8+ h(9601)1-
h(9605)4- h(9609)2+ h(9613)1- h(9617)2+ h(9629)1- h(9637)2+ h(9641)2+ h(9645)4+
h(9649)1- h(9661)1- h(9665)2- h(9669)20+ h(9673)4- h(9677)1- h(9681)4+ h(9685)4-
h(9689)1- h(9697)1- h(9701)4+ h(9705)4+ h(9709)4+ h(9713)2+ h(9717)4+ h(9721)1-
h(9733)1- h(9737)4+ h(9741)4+ h(9745)12+ h(9749)3- h(9753)2+ h(9757)10+ h(9761)2+
h(9769)1- h(9773)2- h(9777)2+ h(9781)1- h(9785)4+ h(9789)8+ h(9793)2+ h(9797)8+
h(9805)12- h(9809)4+ h(9813)6+ h(9817)1- h(9821)4+ h(9829)5- h(9833)3- h(9841)8+
h(9845)8+ h(9853)2+ h(9857)1- h(9861)4+ h(9865)2- h(9869)6+ h(9877)4+ h(9881)4-
h(9885)4+ h(9889)4+ h(9893)2- h(9897)6+ h(9901)1- h(9905)12+ h(9913)2+ h(9917)2+
h(9921)2+ h(9929)1- h(9933)8+ h(9937)6+ h(9941)1- h(9949)1- h(9953)8- h(9957)2+
h(9961)2+ h(9965)2- h(9969)2+ h(9973)1- h(9977)2+ h(9985)2- h(9989)2+ h(9993)2+

There are 264 discriminants in the range [8697,9993]

Return to main page

php/buell_241.html0000644000175100017510000010060211611727765013234 0ustar keithkeith
Class numbers of forms for even fundamental positive discriminant d, 2 ≤ d ≤ 4328
h(8)1- h(12)2+ h(24)2+ h(28)2+ h(40)2- h(44)2+ h(56)2+ h(60)4+
h(76)2+ h(88)2+ h(92)2+ h(104)2- h(120)4+ h(124)2+ h(136)4+ h(140)4+
h(152)2+ h(156)4+ h(168)4+ h(172)2+ h(184)2+ h(188)2+ h(204)4+ h(220)4+
h(232)2- h(236)2+ h(248)2+ h(264)4+ h(268)2+ h(280)4+ h(284)2+ h(296)2-
h(312)4+ h(316)6+ h(328)4- h(332)2+ h(344)2+ h(348)4+ h(364)4+ h(376)2+
h(380)4+ h(408)4+ h(412)2+ h(424)2- h(428)2+ h(440)4+ h(444)4+ h(456)4+
h(460)4+ h(472)2+ h(476)4+ h(488)2- h(492)4+ h(508)2+ h(520)4- h(524)2+
h(536)2+ h(552)4+ h(556)2+ h(568)6+ h(572)4+ h(584)4+ h(604)2+ h(616)4+
h(620)4+ h(632)2+ h(636)4+ h(652)2+ h(664)2+ h(668)2+ h(680)4- h(696)4+
h(712)4+ h(716)2+ h(728)4+ h(732)4+ h(744)4+ h(748)4+ h(760)4+ h(764)2+
h(776)4+ h(780)8+ h(796)2+ h(808)2- h(812)4+ h(824)2+ h(840)8+ h(844)2+
h(856)2+ h(860)4+ h(872)2- h(876)8+ h(888)4+ h(892)6+ h(904)8- h(908)2+
h(920)4+ h(924)8+ h(940)12+ h(952)4+ h(956)2+ h(984)4+ h(988)4+ h(1004)2+
h(1016)6+ h(1020)8+ h(1032)4+ h(1036)4+ h(1048)2+ h(1052)2+ h(1064)4+ h(1068)4+
h(1084)2+ h(1096)4- h(1112)2+ h(1128)4+ h(1132)2+ h(1144)4+ h(1148)4+ h(1160)4-
h(1164)8+ h(1180)4+ h(1192)2- h(1196)4+ h(1208)2+ h(1212)4+ h(1228)2+ h(1240)4+
h(1244)2+ h(1256)2- h(1272)4+ h(1276)4+ h(1288)8+ h(1292)8+ h(1304)6+ h(1308)4+
h(1320)8+ h(1324)2+ h(1336)2+ h(1340)4+ h(1356)4+ h(1384)6- h(1388)2+ h(1416)4+
h(1420)4+ h(1432)2+ h(1436)6+ h(1448)2- h(1464)4+ h(1468)2+ h(1480)4- h(1484)4+
h(1496)4+ h(1516)2+ h(1528)2+ h(1532)2+ h(1544)4+ h(1560)8+ h(1564)4+ h(1576)2-
h(1580)4+ h(1592)2+ h(1596)16+ h(1608)4+ h(1612)4+ h(1624)4+ h(1628)4+ h(1640)8+
h(1644)4+ h(1660)4+ h(1672)4+ h(1676)2+ h(1688)2+ h(1704)4+ h(1708)12+ h(1720)4+
h(1724)2+ h(1736)8+ h(1740)8+ h(1752)8+ h(1756)10+ h(1768)8- h(1772)6+ h(1784)2+
h(1788)4+ h(1804)4+ h(1816)2+ h(1820)8+ h(1832)2- h(1848)8+ h(1852)2+ h(1864)4+
h(1868)2+ h(1880)4+ h(1884)4+ h(1896)4+ h(1912)2+ h(1916)2+ h(1928)4+ h(1932)8+
h(1948)2+ h(1964)2+ h(1976)4+ h(1992)4+ h(1996)10+ h(2008)2+ h(2012)2+ h(2024)12+
h(2040)8+ h(2044)4+ h(2056)8+ h(2060)4+ h(2072)4+ h(2076)4+ h(2092)2+ h(2104)2+
h(2108)4+ h(2120)4- h(2136)4+ h(2140)4+ h(2152)2- h(2168)2+ h(2172)4+ h(2184)8+
h(2188)2+ h(2204)4+ h(2216)2- h(2220)8+ h(2236)4+ h(2248)4+ h(2252)2+ h(2264)2+
h(2280)8+ h(2284)2+ h(2296)12+ h(2316)8+ h(2328)8+ h(2332)4+ h(2344)2- h(2348)2+
h(2360)4+ h(2364)4+ h(2380)8+ h(2392)4+ h(2396)2+ h(2408)4+ h(2424)4+ h(2428)2+
h(2440)4- h(2444)4+ h(2456)2+ h(2460)8+ h(2472)4+ h(2476)2+ h(2488)2+ h(2492)4+
h(2504)4- h(2508)8+ h(2524)2+ h(2536)2- h(2540)4+ h(2552)4+ h(2568)4+ h(2572)2+
h(2584)16+ h(2588)2+ h(2604)8+ h(2616)4+ h(2620)4+ h(2632)8+ h(2636)6+ h(2648)2+
h(2652)8+ h(2668)4+ h(2680)4+ h(2684)4+ h(2696)8+ h(2712)4+ h(2716)4+ h(2728)4+
h(2732)2+ h(2748)4+ h(2760)8+ h(2764)2+ h(2776)2+ h(2780)4+ h(2792)2- h(2796)4+
h(2812)4+ h(2824)8+ h(2828)4+ h(2840)4+ h(2856)8+ h(2860)8+ h(2872)2+ h(2876)2+
h(2892)8+ h(2908)10+ h(2920)12- h(2924)8+ h(2936)2+ h(2956)2+ h(2968)4+ h(2972)2+
h(2984)2- h(3004)2+ h(3016)4- h(3020)4+ h(3032)2+ h(3036)8+ h(3048)4+ h(3052)4+
h(3064)2+ h(3068)4+ h(3080)8+ h(3084)4+ h(3112)2- h(3116)4+ h(3128)4+ h(3144)12+
h(3148)2+ h(3160)4+ h(3164)8+ h(3176)2- h(3180)8+ h(3192)8+ h(3196)16+ h(3208)4+
h(3212)4+ h(3224)4+ h(3228)4+ h(3244)2+ h(3256)4+ h(3260)4+ h(3272)4- h(3288)4+
h(3292)2+ h(3304)4+ h(3308)2+ h(3320)4+ h(3324)4+ h(3336)4+ h(3340)4+ h(3352)2+
h(3356)6+ h(3368)6- h(3372)4+ h(3404)4+ h(3416)4+ h(3432)8+ h(3436)2+ h(3448)2+
h(3452)2+ h(3464)4+ h(3480)16+ h(3484)4+ h(3496)12+ h(3512)2+ h(3516)4+ h(3532)2+
h(3544)2+ h(3548)2+ h(3560)8+ h(3576)12+ h(3580)12+ h(3592)12+ h(3596)12+ h(3608)4+
h(3612)8+ h(3624)12+ h(3628)2+ h(3640)16+ h(3644)2+ h(3656)4- h(3660)8+ h(3676)2+
h(3688)2- h(3692)4+ h(3704)2+ h(3720)8+ h(3736)6+ h(3740)8+ h(3752)4+ h(3756)8+
h(3768)4+ h(3772)8+ h(3784)4+ h(3788)2+ h(3804)4+ h(3820)4+ h(3832)2+ h(3836)8+
h(3848)4- h(3864)8+ h(3868)2+ h(3880)4- h(3884)2+ h(3896)2+ h(3912)4+ h(3916)8+
h(3928)10+ h(3932)2+ h(3944)4- h(3948)8+ h(3964)2+ h(3976)16+ h(3980)4+ h(3992)2+
h(4008)4+ h(4012)8+ h(4024)2+ h(4028)4+ h(4040)4- h(4044)8+ h(4060)8+ h(4072)2-
h(4076)2+ h(4088)4+ h(4092)16+ h(4108)4+ h(4120)4+ h(4124)2+ h(4136)4+ h(4152)4+
h(4156)2+ h(4168)4- h(4172)4+ h(4184)2+ h(4188)4+ h(4204)2+ h(4216)4+ h(4220)4+
h(4236)4+ h(4252)2+ h(4264)4- h(4268)8+ h(4280)4+ h(4296)4+ h(4316)4+ h(4328)2-

There are 440 discriminants in the range [24328]

Return to main page

php/buell_242.html0000644000175100017510000010103211611730003013206 0ustar keithkeith
Class numbers of forms for even fundamental positive discriminant d, 4344 ≤ d ≤ 8668
h(4344)12+ h(4348)14+ h(4360)12- h(4364)6+ h(4376)2+ h(4380)8+ h(4396)4+ h(4408)4+
h(4412)2+ h(4424)8+ h(4440)8+ h(4444)20+ h(4456)2- h(4460)4+ h(4472)4+ h(4476)4+
h(4488)16+ h(4492)2+ h(4504)10+ h(4520)4- h(4524)8+ h(4540)4+ h(4552)4- h(4556)8+
h(4568)2+ h(4584)4+ h(4588)4+ h(4604)2+ h(4616)8+ h(4620)16+ h(4632)8+ h(4636)4+
h(4648)4+ h(4652)2+ h(4664)4+ h(4668)4+ h(4684)6+ h(4696)2+ h(4712)4+ h(4728)4+
h(4744)8+ h(4748)2+ h(4760)8+ h(4764)12+ h(4776)4+ h(4780)4+ h(4792)2+ h(4796)4+
h(4808)4+ h(4812)4+ h(4828)4+ h(4844)12+ h(4856)2+ h(4872)8+ h(4876)4+ h(4888)4+
h(4892)6+ h(4904)10- h(4908)8+ h(4920)8+ h(4924)2+ h(4936)4+ h(4940)8+ h(4952)2+
h(4956)16+ h(4972)8+ h(4984)4+ h(4988)4+ h(5016)8+ h(5020)4+ h(5032)4- h(5036)2+
h(5048)2+ h(5052)4+ h(5064)4+ h(5068)4+ h(5080)4+ h(5084)8+ h(5116)2+ h(5128)4+
h(5132)2+ h(5144)2+ h(5160)16+ h(5164)2+ h(5176)14+ h(5180)8+ h(5192)4+ h(5196)16+
h(5208)8+ h(5212)2+ h(5224)2- h(5228)2+ h(5240)4+ h(5244)8+ h(5260)4+ h(5272)2+
h(5276)2+ h(5288)2- h(5304)8+ h(5308)10+ h(5320)8+ h(5336)4+ h(5340)8+ h(5352)4+
h(5356)12+ h(5368)12+ h(5372)4+ h(5384)4+ h(5388)4+ h(5404)16+ h(5416)2- h(5420)4+
h(5432)4+ h(5448)4+ h(5452)4+ h(5464)2+ h(5468)6+ h(5480)4- h(5484)8+ h(5496)4+
h(5512)4- h(5516)4+ h(5528)2+ h(5532)4+ h(5548)8+ h(5560)4+ h(5564)4+ h(5576)8+
h(5592)4+ h(5596)2+ h(5608)2- h(5612)4+ h(5624)12+ h(5628)8+ h(5640)8+ h(5644)8+
h(5656)4+ h(5660)4+ h(5672)2- h(5676)8+ h(5692)2+ h(5704)8+ h(5708)2+ h(5720)8+
h(5736)4+ h(5740)8+ h(5752)2+ h(5756)2+ h(5768)8+ h(5772)16+ h(5784)16+ h(5788)2+
h(5804)2+ h(5816)2+ h(5820)8+ h(5836)2+ h(5848)8+ h(5852)8+ h(5864)2- h(5884)2+
h(5896)4+ h(5912)6+ h(5916)8+ h(5928)8+ h(5932)2+ h(5944)10+ h(5948)2+ h(5960)4-
h(5964)8+ h(5980)24+ h(5992)4+ h(5996)2+ h(6008)2+ h(6024)4+ h(6028)8+ h(6040)4+
h(6044)2+ h(6056)2- h(6060)8+ h(6072)8+ h(6088)12- h(6092)6+ h(6104)4+ h(6108)12+
h(6124)2+ h(6136)28+ h(6140)4+ h(6152)4+ h(6168)4+ h(6172)2+ h(6184)6- h(6188)8+
h(6204)8+ h(6216)8+ h(6220)4+ h(6232)4+ h(6236)2+ h(6248)4+ h(6252)4+ h(6268)6+
h(6280)4- h(6284)2+ h(6296)2+ h(6312)4+ h(6316)2+ h(6328)8+ h(6332)2+ h(6344)4-
h(6360)16+ h(6364)4+ h(6376)2- h(6380)8+ h(6392)8+ h(6396)24+ h(6412)4+ h(6424)4+
h(6428)2+ h(6440)8+ h(6456)4+ h(6460)8+ h(6472)4- h(6476)2+ h(6488)2+ h(6492)4+
h(6504)4+ h(6508)6+ h(6520)4+ h(6524)8+ h(6536)4+ h(6540)8+ h(6556)12+ h(6568)2-
h(6572)4+ h(6584)6+ h(6604)4+ h(6616)18+ h(6620)4+ h(6632)2- h(6636)8+ h(6648)4+
h(6652)2+ h(6668)2+ h(6680)4+ h(6684)4+ h(6712)2+ h(6716)8+ h(6744)4+ h(6748)4+
h(6764)4+ h(6780)8+ h(6792)4+ h(6796)2+ h(6808)4+ h(6812)4+ h(6824)2- h(6828)4+
h(6844)4+ h(6856)12- h(6872)2+ h(6888)8+ h(6892)2+ h(6904)2+ h(6908)4+ h(6920)4-
h(6924)8+ h(6940)12+ h(6952)4+ h(6956)4+ h(6968)4+ h(6972)16+ h(6988)2+ h(7004)8+
h(7016)2- h(7032)12+ h(7036)2+ h(7048)8+ h(7052)8+ h(7064)10+ h(7068)8+ h(7080)8+
h(7084)24+ h(7096)2+ h(7112)8+ h(7116)4+ h(7132)2+ h(7144)4+ h(7148)6+ h(7160)4+
h(7176)8+ h(7180)4+ h(7192)4+ h(7196)4+ h(7208)8+ h(7212)8+ h(7224)24+ h(7228)4+
h(7240)4- h(7244)6+ h(7256)2+ h(7276)4+ h(7288)2+ h(7292)2+ h(7304)4+ h(7320)8+
h(7324)2+ h(7336)4+ h(7340)4+ h(7352)2+ h(7356)4+ h(7368)4+ h(7372)4+ h(7384)4+
h(7388)6+ h(7404)12+ h(7420)8+ h(7432)4+ h(7464)12+ h(7468)2+ h(7480)8+ h(7484)2+
h(7496)4+ h(7512)8+ h(7516)2+ h(7528)6- h(7532)4+ h(7544)8+ h(7548)8+ h(7564)4+
h(7576)2+ h(7580)4+ h(7592)4- h(7608)4+ h(7612)4+ h(7624)4- h(7628)6+ h(7640)4+
h(7656)16+ h(7660)4+ h(7672)8+ h(7676)4+ h(7692)4+ h(7708)4+ h(7720)4- h(7724)2+
h(7736)14+ h(7752)8+ h(7756)4+ h(7768)2+ h(7772)4+ h(7784)4+ h(7788)16+ h(7804)2+
h(7816)12+ h(7820)8+ h(7832)8+ h(7836)4+ h(7852)4+ h(7864)2+ h(7868)8+ h(7880)4-
h(7896)8+ h(7912)4+ h(7916)2+ h(7928)2+ h(7932)4+ h(7944)4+ h(7948)6+ h(7960)4+
h(7964)4+ h(7976)2- h(7980)16+ h(7996)2+ h(8008)8+ h(8012)2+ h(8024)8+ h(8040)16+
h(8044)2+ h(8056)4+ h(8060)8+ h(8072)4+ h(8076)16+ h(8088)8+ h(8104)14- h(8108)10+
h(8120)8+ h(8124)20+ h(8140)16+ h(8152)2+ h(8156)2+ h(8168)2- h(8184)8+ h(8188)4+
h(8204)4+ h(8216)4+ h(8220)24+ h(8236)4+ h(8248)2+ h(8252)2+ h(8264)4+ h(8268)8+
h(8284)4+ h(8296)4- h(8312)2+ h(8328)4+ h(8332)2+ h(8344)4+ h(8348)2+ h(8360)8+
h(8364)8+ h(8376)4+ h(8380)4+ h(8392)4+ h(8396)6+ h(8408)2+ h(8412)4+ h(8440)4+
h(8444)2+ h(8456)8+ h(8472)12+ h(8476)4+ h(8488)2- h(8492)4+ h(8504)2+ h(8508)4+
h(8520)8+ h(8524)2+ h(8536)16+ h(8540)8+ h(8552)2- h(8556)24+ h(8572)6+ h(8584)4-
h(8588)4+ h(8616)4+ h(8620)4+ h(8632)4+ h(8636)8+ h(8648)8+ h(8652)8+ h(8668)4+

There are 440 discriminants in the range [43448668]

Return to main page

php/buell_243.html0000644000175100017510000002513611611730020013220 0ustar keithkeith
Class numbers for forms of even fundamental positive discriminant d, 8680 ≤ d ≤ 9992
h(8680)24+ h(8684)4+ h(8696)2+ h(8716)2+ h(8728)2+ h(8732)4+ h(8744)2- h(8760)8+
h(8764)4+ h(8776)4+ h(8780)4+ h(8792)4+ h(8796)4+ h(8808)4+ h(8812)2+ h(8824)2+
h(8828)6+ h(8840)8- h(8844)16+ h(8860)4+ h(8872)2- h(8876)4+ h(8888)4+ h(8904)8+
h(8908)4+ h(8920)12+ h(8924)4+ h(8936)2- h(8940)8+ h(8952)4+ h(8956)2+ h(8968)4+
h(8972)2+ h(8984)2+ h(8988)8+ h(9004)14+ h(9020)8+ h(9032)4- h(9048)8+ h(9052)12+
h(9064)4+ h(9068)2+ h(9080)4+ h(9084)4+ h(9096)4+ h(9112)8+ h(9116)4+ h(9128)4+
h(9132)4+ h(9148)2+ h(9160)4- h(9164)4+ h(9176)4+ h(9192)12+ h(9208)14+ h(9224)8+
h(9228)8+ h(9240)16+ h(9244)2+ h(9256)4- h(9260)4+ h(9272)4+ h(9276)4+ h(9292)4+
h(9304)2+ h(9308)4+ h(9320)4- h(9336)4+ h(9340)20+ h(9352)8+ h(9356)2+ h(9368)2+
h(9372)8+ h(9384)8+ h(9388)2+ h(9404)2+ h(9416)4+ h(9420)8+ h(9436)8+ h(9448)10-
h(9452)4+ h(9480)8+ h(9484)2+ h(9496)2+ h(9512)4- h(9516)16+ h(9528)4+ h(9532)2+
h(9544)4+ h(9548)8+ h(9560)4+ h(9564)4+ h(9580)4+ h(9592)4+ h(9596)10+ h(9608)8-
h(9624)4+ h(9628)4+ h(9640)16+ h(9644)2+ h(9656)4+ h(9660)16+ h(9672)8+ h(9676)24+
h(9688)4+ h(9692)2+ h(9704)2- h(9708)4+ h(9724)8+ h(9736)16+ h(9740)4+ h(9752)4+
h(9768)8+ h(9772)4+ h(9784)2+ h(9788)2+ h(9804)16+ h(9816)8+ h(9820)4+ h(9832)2-
h(9836)6+ h(9848)2+ h(9852)4+ h(9868)14+ h(9880)8+ h(9884)4+ h(9896)2- h(9912)8+
h(9916)4+ h(9928)8- h(9932)4+ h(9944)8+ h(9948)4+ h(9960)16+ h(9964)4+ h(9976)4+
h(9980)12+ h(9992)8+

There are 138 discriminants in the range [86809992]

Return to main page

php/buell_classnumber_tables.html0000644000175100017510000000547613241431312016570 0ustar keithkeith Class number tables for quadratic forms for fundamental discriminants d in the range |d| < 10000

Class number tables for quadratic forms for fundamental discriminants d in the range < |d| < 10000

These tables were generated by the BCMATH program at http://www.numbertheory.org/php/classnopostable_qforms.html and are in the format of those in Appendix 2, 236-243, Binary Quadratic Forms, D.A. Buell, Springer 1989.
Unike Buell's tables, for negative discriminants we do not list genera values.

Odd positive discrimants
page 236, 5 ≤ d ≤ 2181
page 237, 2185 ≤ d ≤ 4349
page 238, 4353 ≤ d ≤ 6529
page 239, 6533 ≤ d ≤ 8693
page 240, 8697 ≤ d ≤ 9993
Even positive discrimants
page 241, 2 ≤ d ≤ 4328
page 242, 4344 ≤ d ≤ 8668
page 243, 8680 ≤ d ≤ 9992
Odd negative discrimants d = -Δ
page 224, 3 ≤ Δ ≤ 1615
page 225, 1619 ≤ Δ ≤ 3247
page 226, 3251 ≤ Δ ≤ 4863
page 227, 4867 ≤ Δ ≤ 6499
page 228, 6503 ≤ Δ ≤ 8131
page 229, 8135 ≤ Δ ≤ 9743
page 230, 9755 ≤ Δ ≤ 9995
Even negative discrimants d = -Δ
page 231, 4 ≤ Δ ≤ 3256
page 232, 3268 ≤ Δ ≤ 6488
page 233, 6504 ≤ Δ ≤ 9780
page 234, 9784 ≤ Δ ≤ 9992

Last modified 22nd July 2011
Return to Keith Matthews' BCMATH page
php/carmichael.html0000644000175100017510000001676213641523066013641 0ustar keithkeith Finding the inverse image of Euler's function phi(n) and testing Carmichael's conjecture

Solving φ(x)=n, where φ(x) is Euler's totient function - testing Carmichael's conjecture

Euler's function φ(m) is the number of integers x, 1 ≤ x ≤ m satisfying gcd(x,m)=1. Thus

φ(1)=1, φ(2)=1, φ(3)=2, φ(4)=2, φ(5)=4, φ(6)=2, φ(7)=6, φ(8)=4, φ(9)=6, φ(10)=4.

Also if m=p1a1⋯ptat is the prime-power factorization of m, then φ(m)=p1a1-1(p1-1)⋯ptat-1(pt-1).

Carmichael's Totient Function Conjecture (1922, first stated in reference 6 below) states that Euler's function takes each value at least twice.

In April 1997, Anthony J. Towns, then a student in my MP206 class, wrote an amazingly clever C program for solving φ(x)=n and which also finds the y > 1 such that φ(y) divides n.

The BCMATH and BC versions start by determining the primes p such that p-1 divides n. The algorithm then traverses the tree described in section 4 of reference 1 below, from left to right.

One limitation of our implementation is the use of a primitive factoring program which uses the Brent-Pollard algorithm and Pollard's p-1 algorithm. It should work on integers with no more than 20 digits. See the CALC version that works on larger numbers.

e=0 determines solubility and prints out all solutions x of φ(x)=n, while e=1 tests Carmichael's conjecture.
f=0 determines solubility and prints out all solutions y of φ(y) divides n, while f=1 prints only the x satisfying φ(x)=n.

The algorithm deals with the set S(n) of primes p such that p-1 divides n. It produces sequences p1 < p2 < ··· < pj of primes in S(n), together with corresponding non-negative integers γ1, ... , γj as follows:
e1 = p1γ1(p1-1) divides n0 = n;
e2 = p2γ2(p2-1) divides n1 =n0/e1;
···
ej = pjγj(pj-1) divides nj-1 =nj-2/ej-1.
Then e1e2···ej divides n and with y = p1γ1+1···pjγj+1, we have e1e2···ej = φ(y) divides n.

Either a branch ends with a y such that φ(y) < n, or a y with φ(y) = n

Here is the tree when n = 8, traversed from left to right. The solutions y, apart from 1, such that φ(y) divides 8, are listed, as are the corresponding (pjj,nj-1):

2, 6, 30 10, 4, 12, 20, 8, 24, 16, 3, 15, 5,

with the boldfaced integers being the solutions x of φ(x)=8.

(2,0,8)     →    (2,1,4)      →     (2,2,2)    →    (2,3,1)    →    (3,0,4)    →    (5,0,2)
   ↓↑↘↖            ↓↑ ↘↖            ↓↑                                       ↓↑
   ↓↑    ↘↖        ↓↑     ↘↖        ↓↑                                       ↓↑
(3,0,4) (5,0,2) (3,0,2)  (5,0,1)  (3,0,1)                                (5,0,1)
   ↓↑
(5,0,1)

References

  1. Complexity of inverting the Euler function, Scott Contini, Ernie Croot and Igor Shparlinski, Math. Comp 75 (2006) 983-996.
  2. The number of solutions of φ(x) = m, Kevin Ford, Annals of Math. 150 (1999), 283-311.
  3. Carmichael's conjecture on the Euler function is valid below 1010,900,000, Aaron Schafly and Stan Wagon, Math. Comp. 63 (1994) 415-419.
  4. On Carmichael's conjecture, Carl Pomerance, Proc. Amer. Math. Soc. 43 (1974) 297-298.
  5. Sur l'equation φ(x)=m, André Schinzel, Elemente der Mathematik, 11 (1956) 75-78.
  6. On a conjecture of Carmichael, V.L. Klee Jr., Bull. Amer. Math. Soc. 53 (1947) 1183-1186.
  7. Note on Euler's φ-function, R.D. Carmichael, Bull. Amer. Math. Soc. 28 (1922) 109-110.
  8. On Euler's φ-function, R.D. Carmichael, Bull. Amer. Math. Soc. 28 (1907) 241-243.
    • Errata: Volume 13: Bull. Amer. Math. Soc., Volume 54, Number 12 (1948), 1192-1192.
      • Errata: Bull. Amer. Math. Soc., Volume 55, Number 2 (1949), 212-212.
Enter n (≥ 1):
Enter e (0 or 1):
Enter f (0 or 1):

Last modified 9th September 2010
Return to number-theoretic functions page
php/carmichael_.php0000644000175100017510000001315011613175213013601 0ustar keithkeith\n"; print "The number of solutions x of φ(x)=$n is hence 0
\n"; return; } $prime_count=divisor_pminus1($n); if(gt($prime_count,"100")){ $verbose="1"; } $temp=bcadd($n,"2"); $prime_found[$prime_count]="0"; $number="0"; $fnumber="0"; $index="0"; $q["0"]="2"; if(ezero($verbose)){ if(neqzero($f)){ print "The solutions x of φ(x)=$n (if any) are listed in bold.
\n"; flush(); }else{ print "The solutions y of φ(y) divides $n, are listed,
\n"; print "with the solutions x of φ(x)=$n (if any) highlighted in bold.
\n"; } }else{ print "Testing Carmichael's conjecture for φ(x)=$n:
\n"; flush(); } if(eq($n,"1")){ print "1 2
\n"; print "The number of solutions x is 2
\n"; return; } $phi_n["0"]=$n; while("1"){ if(eq($phi_n[$index],"1")) { $result="1"; $number=bcadd($number,"1"); for($i="0";lt($i,$index);$i=bcadd($i,"1")){ for($j="0";lt($j,$a[$i]);$j=bcadd($j,"1")){ $result=bcmul($result,$q[$i]); } } print "$result "; flush(); if(eq($number,"2") && neqzero($verbose)){ print " are two solutions
\n"; flush(); return; } $index=bcsub($index,"1"); }else{ $temp=bcadd($phi_n[$index],"1"); if(ezero($q[$index]) || lt($index,$prime_count) && (gt($q[$index],$temp))){ if(ezero($index)){ print "
\n"; flush(); print "The number of solutions x is $number
\n"; if(ezero($verbose) && ezero($f)) { $temp=bcadd($number,$fnumber); print "The number of solutions y is $temp
\n"; flush(); } return; } $temp0=bcsub($index,"1"); $temp=bcmod($phi_n[$index],$q[$temp0]); if(ezero($temp)){ $a[$temp0]=bcadd($a[$temp0],"1"); $phi_n[$index]=bcdiv($phi_n[$index],$q[$temp0]); $q[$index]=$q[$temp0]; if(neq($phi_n[$index],"1") && ezero($verbose) && ezero($f)) { $fnumber=bcadd($fnumber,"1"); $result="1"; for($i="0";lt($i,$index);$i=bcadd($i,"1")){ for($j="0";lt($j,$a[$i]);$j=bcadd($j,"1")){ $result=bcmul($result,$q[$i]); } } print "$result "; flush(); } }else{ $index=$temp0; } }else{ $temp0=bcsub($q[$index],"1"); $temp=bcmod($phi_n[$index],$temp0); if(ezero($temp)){ $temp1=bcadd($index,"1"); $phi_n[$temp1]=bcdiv($phi_n[$index],$temp0); $q[$temp1]=$q[$index]; $a[$index]="1"; $index=$temp1; if(neq($phi_n[$index],"1") && ezero($verbose) && ezero($f)) { $fnumber=bcadd($fnumber,"1"); $result="1"; for($i="0";lt($i,$index);$i=bcadd($i,"1")){ for($j="0";lt($j,$a[$i]);$j=bcadd($j,"1")){ $result=bcmul($result,$q[$i]); } } print "$result "; flush(); } } } } for($u="0";lt($u,$prime_count);$u=bcadd($u,"1")){ if(eq($q[$index],$prime_found[$u])){ $temp=bcadd($u,"1"); $q[$index]=$prime_found[$temp]; break; } } } } function divisor_pminus1($n){ global $prime_found; global $kglobal; global $qglobal; global $sorted_array; /* if(neqzero($verbose)){ print "The divisors of $n are "; }*/ $t=omega($n); $list_length=bcadd($kglobal["0"],"1"); $prime_count="0"; for($k="0";lt($k,$list_length);$k=bcadd($k,"1")){ $list[$k]=bcpow($qglobal["0"],$k); $d=$list[$k]; $l=bcadd($d,"1"); $f=lucas($l,"0"); if(neqzero($f)){ $temp=bcmod($n,$d); if(ezero($temp)){ $prime_found[$prime_count]=$l; $prime_count=bcadd($prime_count,"1"); } } /* if(neqzero($verbose)){ print "$d "; }*/ } for($i="1";lt($i,$t);$i=bcadd($i,"1")){ $e=$list_length; for($k="0";lt($k,$list_length);$k=bcadd($k,"1")){ for($j="1";le($j,$kglobal[$i]);$j=bcadd($j,"1")){ $temp=bcpow($qglobal[$i],$j); $d=bcmul($list[$k],$temp); $l=bcadd($d,"1"); $f=lucas($l,"0"); if(neqzero($f)){ $temp=bcmod($n,$d); if(ezero($temp)){ $prime_found[$prime_count]=$l; $prime_count=bcadd($prime_count,"1"); } } $list[$e]=$d; /* if(neqzero($verbose)){ print "$d "; }*/ $e=bcadd($e,"1"); } } $temp=bcadd($kglobal[$i],"1"); $list_length=bcmul($list_length,$temp); /*print"
\n";*/ } /* if(neqzero($verbose)){ print "There are $prime_count primes p such that p-1 divides $n: "; for($m="0";lt($m,$prime_count);$m=bcadd($m,"1")){ print "$prime_found[$m] "; } print"
\n"; }*/ sort_array($prime_found,$prime_count); for($m="0";lt($m,$prime_count);$m=bcadd($m,"1")){ $prime_found[$m]=$sorted_array[$m]; } if(gt($prime_count,"100")){ print "There are $prime_count primes to be processed and this may take some time
\n"; flush(); print "So we settle for finding two solutions
\n"; flush(); } return($prime_count); } ?> php/carmichael.php0000644000175100017510000000140012747020146013440 0ustar keithkeith \n"; } else{ $n=$Nvalue; $e=$Evalue; $f=$Fvalue; carmichael($n,$e,$f); } print "

\n"; print "Return to main page
\n"; ?> php/carnielli.html0000644000175100017510000000707413763017773013517 0ustar keithkeith Walter Carnielli's generalization of the 3x+1 mapping

Walter Carnielli's generalization of the 3x+1 mapping

The following mapping Td: ℤ → ℤ was defined in an email from Professor Walter Carnielli to Keith Matthews (26th December 2010).
Let d ≥ 2. Then

                       Td(n) = n/d if n ≡ 0 (mod d)
                       Td(n) = ((d+1)n + d - i)/d if n ≡ i (mod d), 1 ≤ i ≤ d-1.
For example, d = 2 gives the 3x+1 mapping:
                       T2(n) = n/2 if n ≡ 0 (mod 2)
                       T2(n) = (3n + 1)/2 if n ≡ 1 (mod 2).
This is a special case of a version of a mapping studied by Herbert Möller and also an example of a relatively prime mapping, in the language of Matthews and Watts, where m0=1 and mi = d+1 for 1 ≤ i < d and where we have the inequality
 
                       m0m1⋯md =(d+1)d-1 < dd.
So it seems certain that the sequence of iterates
                       n, Td(n), Td2(n), ... 
always eventually enters a cycle and that there are only finitely many such cycles as was conjectured by Professor Carnielli.

It is easy to prove that

For d = 7,14, 18 and 21, we appear to get no cycles other than those in (i) and (ii).
It would be interesting to determine all d with this property. See the Table, which was constructed using the author's faster CALC program.

We search all trajectories x, Td(x), Td2(x),... where |x| ≤ R ⁄ 2 = 60000 ⁄ 2 for cycling by Floyd's method of testing for equality of kth and 2kth iterates for k ≤ U = 1000000.
Here we list cycles found other than those of cases (i) and (ii) for all d satisfying m ≤ d ≤ n, where m and n satisfy 2 ≤ m ≤ n ≤ 100.
We choose the cycle element with smallest absolute value as starting point.
Finally, we limit the number of cycles for each d to 500.

Enter m (2 ≤ m ≤ 100 ):
Enter n (m ≤ n ≤ 100 ):
print a complete cycle and the cycle-length
print only the start of a cycle and the cycle-length

Last modified 6th December 2020
Return to main page
php/carnielli_.php0000644000175100017510000001143511610601017013450 0ustar keithkeith INFINITY. The complete cycles are printed if verbose = 1, not printed if 0. U is the no. of iterations when testing for T^n(a)=T^{2n}(a) to find a cycle starting from a. */ function cycle($d,$verbose){ $R="60000"; $U="1000000"; $INFINITY="1000000000000";/*10^12 */ $L="500"; $c="0"; $diverge_flag="0"; $RR=bcadd($R,"1"); for($i="0";le($i,$R);$i=bcadd($i,"1")){ $flag_array[$i]=$RR; } for($n="0";le($n,$R);$n=bcadd($n,"1")){ if(gt($flag_array[$n],$n)){ if(bcmod($n,"2")==0){ $p=int($n,"2"); }else{ $temp=bcadd($n,"1"); $temp=bcsub("0",$temp); $p=int($temp,"2"); } $q=$p; $a=$p; $b=$a; $end="0"; for($k="0";le($k,$U);$k=bcadd($k,"1")){ $a=carnielli_function($d,$a); $temp=bcabs($a); if(gt($temp,$INFINITY)){ if(ezero($diverge_flag)){ echo "divergent trajectory starting from $q
\n"; flush(); $diverge_flag="1"; } break; } $b=carnielli_function($d,$b); $b=carnielli_function($d,$b); if(eq($b,$a)){/* cycle detected starting at p */ break; } $temp=int($R,"2"); if(le(bcabs($a),$temp)){ $p=bcabs($a); $temp1=bcmul("2",$p); $temp2=bcsub($temp1,"1"); if(gezero($a)){ $r=$temp1; }else{ $r=$temp2; } if(lt($flag_array[$r],$n)){ $end="1"; break; }else{ $flag_array[$r]=$n; } } } if(eq($end,"1")){ continue; } if(eq($b,$a)){ if(ezero($c)){/* store $a the start of the first cycle */ $z["0"]=$a; $c=bcadd($c,"1"); p_cycle($a,$d,$c,$verbose); }else{/* store the start of subsequent cycles */ $s=is_cycle($a,$d,$z,$c); if(eq($s,"1")){/* this is a new cycle */ $c=bcadd($c,"1"); if(le($c,$L)){ $z[$c]=$a; p_cycle($a,$d,$c,$verbose); }else{ echo "cycle limit $L reached
\n"; flush(); return; } } } } } } /*echo "
\n"; flush();*/ return($c); } function p_cycle($a,$d,$c,$verbose){ /* this prints the cycle starting with $a */ $i="0"; $b=$a; $min_elt=$a; do{ $b=carnielli_function($d,$b); if(lt(bcabs($b),bcabs($min_elt))){ $min_elt=$b; } $i=bcadd($i,"1"); }while(neq($b,$a)); if(gt($i,"1") && neq($a,"1")){ echo "cycle[$c]: "; flush(); if(!$verbose){ echo "$min_elt,"; echo " cycle_length $i
\n"; flush(); return; } $i="0"; $a=$min_elt; $b=$a; do{ echo "$b, "; flush(); $b=carnielli_function($d,$b); $i=bcadd($i,"1"); }while(neq($b,$a)); echo " cycle-length $i
\n"; flush(); return; }else{ return; } } function is_cycle($a,$d,$z,$c){ /* the cycle starting from $a is distinct from those starting from $z[0],...$z[$c] if and only if 1 is returned. */ $b=$a; for($k="0";gezero($k);$k=bcadd($k,"1")) { for($i="0";le($i,$c);$i=bcadd($i,"1")) { if(eq($b,$z[$i])){ return("0"); } } $b=carnielli_function($d,$b); if(eq($b,$a)){/* this is a new cycle */ break; } } return("1"); } ?> php/carnielli.php0000644000175100017510000000271312747113625013327 0ustar keithkeith \n"; echo "Return to main page
\n"; return; } if($check2=="0"){ echo "$nvalue is invalid
\n"; echo "Return to main page
\n"; return; } $m=$mvalue; $n=$nvalue; $limit="100"; if(lt($m,"2")){ echo "m < 2
\n"; echo "Return to main page
\n"; return; } if(gt($m,$n)){ echo "m > n
\n"; echo "Return to main page
\n"; return; } if(gt($m,$limit)){ echo "m > $limit
\n"; echo "Return to main page
\n"; return; } /* So now 2 <= m <= n <= limit */ $verbose=$_POST['verbose']; for($d=$m;le($d,$n);$d=bcadd($d,"1")){ print "d=$d: "; $c=cycle($d,$verbose); $dplus1=bcadd($d,"1"); if(eq($c,$dplus1)){ print "no extra cycles

\n"; }else{ print "
\n"; flush(); } } echo "

\n"; flush(); echo "Return to main page
\n"; flush(); ?> php/caveney.html0000644000175100017510000001001113241433671013156 0ustar keithkeith A generalization of the 3x+1 mapping due to Geoffrey C. Caveney

A generalization of the 3x+1 mapping due to Geoffrey C. Caveney

In a posting to sci.math on February 1, 1998, Geoffrey Caveney defined a mapping fa,b: ℤ → ℤ as follows: Let a > b > 1, gcd(a,b) = 1. Then

For example, a = 3, b = 2 gives the 3x+1 mapping:

Caveney was not aware that his mapping was a special case of a mapping studied by Herbert Möller in 1978, which in turn was generalized in 1984 to the case of a relatively prime mapping by K.R. Matthews and A.M. Watts. Caveney's mapping can also be written as a b-branched mapping:

This reduces to W. Carnielli's mapping if a = b+1, as ri = b - i if 1 ≤ i < b.

According to Möller, it seems certain that for x ∈ ℤ, the sequence of iterates x, T(x), T2(x), ... always eventually enters a cycle if a < bb/(b-1) and that regardless of this inequality, there are only finitely many such cycles. Also if a > bb/(b-1), the prediction is that most trajectories will be divergent.

We note that writing a=b+x, x ≥ 1, we have log(1+x/b) < x/b, (1+x/b)b < ex, so if x + b > ex, we have (1+x/b)b < b+x and hence (b+x)b-1 < bb.
Hence a < bb/(b-1) if b > ea-b -(a-b). In particular, we have the following inequalities:

  1. b+1 < bb/(b-1) iff b ≥ 2.
  2. b+2 < bb/(b-1) iff b ≥ 3.
  3. b+3 < bb/(b-1) iff b ≥ 12.
  4. b+4 < bb/(b-1) iff b ≥ 42.
Caveny experimented with a/b: 4/3, 5/3, 5/4, 6/5, 7/5, 8/5 and 7/6. It seems that for f7,5, where

all iterates will eventually enter one of the following cycles:
  1. 0,0
  2. -1,-1
  3. 1,2,3,5,1
  4. -2,-2
  5. 6,9,13,19,27,38,54,76,107,150,30,6
  6. -17,-23,-32,-44,-61,-85,-17
  7. -33,-46,...,-165,-33 (length 58)
It seems that for f5,3, where

all iterates will eventually enter one of the following cycles:
  1. 0,0
  2. -1,-1
  3. 4,7,12,4
  4. 8,14,24,8.
For f8,5, we have found five cycles:
  1. 0,0
  2. -1,-1
  3. 4,7,1,2,20,4
  4. -11,-17,-27,-43,-68,-108,-172,-275,-55,-11
  5. -49,-78,...,-245,-49 (length 62)
Here a = 8 > bb/(b-1) = 55/4 = 7.476···. It seems certain that the trajectories starting with 8 and -98 diverge.


The viewer can experiment with f5,3 and f7,5:

Enter y:

Mapping f5,3
Mapping f7,5

Last modified 22nd August 2011
Return to main page
php/caveney_.php0000644000175100017510000000263011624316114013143 0ustar keithkeith="0";$i=bcadd($i,"1")){ print "i=$i: $x\n
"; if(eq($x,"0") ||eq($x,"-1") || eq($x,"1") || eq($x,"-2") || eq($x,"6") || eq($x,"-17") || eq($x,"-33")){ print "With starting number = $y,\n
"; flush(); print "the number of iterations taken to reach $x under f$a, $b is $i\n
"; flush(); return; } $x=t($x,$a,$b); } } function caveney53($y){ $a="5"; $b="3"; $x=$y; for($i="0";$i>="0";$i=bcadd($i,"1")){ print "i=$i: $x\n
"; if(eq($x,"0") ||eq($x,"-1") || eq($x,"4") || eq($x,"8")){ print "With starting number = $y\n
"; flush(); print "the number of iterations taken to reach $x under f$a, $b is $i\n
"; flush(); return; } $x=t($x,$a,$b); /* if(eq($i,"100")){ return; }*/ } } ?> php/caveney.php0000644000175100017510000000113312747114175013013 0ustar keithkeith \n"; } else { $mapping=$_POST['mapping']; /*printf("value of mapping %s\n",$mapping);*/ if($mapping=="1"){ caveney53($Mvalue); } if($mapping=="2"){ caveney75($Mvalue); } } print "

\n"; print "Return to main page
\n"; ?> php/ceil_cfrac.html0000644000175100017510000000712413241425054013605 0ustar keithkeith Calculating the backward continued fraction of a quadratic irrational

Calculating the backward continued fraction of a quadratic irrational

This program finds the backward continued fraction expansion of a quadratic irrational α = (u + t√d)/v, where d,t,u,v are integers, d >1, and nonsquare, t and v nonzero.
With ξ0 = α, for i ≥ 0, ai = int(ζi) + 1 and ζi+1 = 1/(ai - ζi), we get a finite continued fraction which eventually becomes periodic

where ai ≥ 2 for i ≥ 1.

Here a quadratic surd α is reduced if α > 1 > α' > 0 and these are the surds which have a purely periodic continued fraction expansion. See implementation as a BC program.

This continued fraction is mentioned in F. Hirzebruch's paper Hilbert modular surfaces, L'Enseignement Math. 19 (1973) and a paper by Don Zagier, A Kronecker Limit Formula for Real Quadratic fields, Math. Ann, 213, 153-184 (1975) especially pages 177-183. Also see Zetafunktionen und quadratische Körper, Eine Einführung in die höhere Zahlentheorie, Don Zagier, Springer 1981.
Hirzebruch on page 241 proved that if p=4n+3 is a prime and h(p) = 1, then h(-p) = (a1 + ··· + ar)/3 - r, where r is the period length of the least integer continued fraction of √p.

Here h(p) is the class number of the real quadratic field ℚ(√p) and h(-p) is the class number of the imaginary quadratic field ℚ(√-p).

Hirzebruch also noted that h(-p) = (-b1+b2 - ··· + b2s)/3, where the bi are partial quotients of the simple continued fraction expansion of √p and 2s is the period length.

The convergents Ai/Bi are calculated as follows:
A-1 = 1, B-1 = 0, A0 = a0, B0 = 1,
Ai = aiAi-1 - Ai-2, Bi = aiBi-1 - Bi-2, i ≥ 1.

We first convert α to (P + √d)/Q, where Q divides d - P2 and gcd(P, Q, (d - P2)/Q) = 1.
We print the partial quotients an, the convergents Ai/Bi and complete quotients ζi with the period partial quotients in bold font.

Enter d (1 < d < 1010 and not a square):
Enter t (nonzero):
Enter u:
Enter v: (nonzero)

Last modified 23rd November 2011
Return to main page php/ceil_cfrac_.php0000644000175100017510000000273311662534525013601 0ustar keithkeith$k=$a, "; }else{ print "a$k=$a, "; } if(gtzero($k)){ $am=bcsub(bcmul($a,$aminus1),$aminus2); $bm=bcsub(bcmul($a,$bminus1),$bminus2); }else{ $am=$a; $bm="1"; } print "A$k/B$k=$am/$bm, "; print "ζ$k=($p+√$d)/$q
\n"; $aminus2=$aminus1; $aminus1=$am; $bminus2=$bminus1; $bminus1=$bm; $p=bcsub(bcmul($a,$q),$p); $temp=bcsub(bcmul($p,$p),$d); $q=bcdiv($temp,$q); if(eq($p,$p_reduced) && eq($q,$q_reduced)){ $k=bcadd($k,"1"); print "ζ$k$k0
\n"; break; } $k=bcadd($k,"1"); } $g=bcsub($k,$k0); return($g); } function reduced($d,$p,$q){ $f=bcsqrt($d); $temp=bcsub($q,$p); $g=bcabs($temp); if(ge($f,$g) && gt($p,$f)){ return("1"); }else{ return("0"); } } ?> php/ceil_cfrac.php0000644000175100017510000000423512747075617013450 0ustar keithkeith \n"; } else if(bccomp($M1value,"1")<="0"){ print "d <= 1
\n"; } else if(bccomp($M1value,"10000000000")>="0"){ print "d >= 10000000000
\n"; } else if(bccomp($M2value,"0")=="0"){ print "t = 0
\n"; } else if(bccomp($M4value,"0")=="0"){ print "v = 0
\n"; } else { $d=$M1value; $f=bcsqrt($d); $x=bcmul($f,$f); if(eq($x,$d)){ print "d is the square of $f
\n"; return; } $t=$M2value; $u=$M3value; $v=$M4value; $z=sign($t); if(eq($z,"-1")){ $u=bcmul($u,$z); $v=bcmul($v,$z); } $x=bcmul($t,$t); $d=bcmul($d,$x); $w=bcabs($v); $x=bcmul($u,$u); $x=bcsub($d,$x); $x=bcmod($x,$w); if(neqzero($x)){ $x=bcmul($v,$v); $d=bcmul($x,$d); $u=bcmul($u,$w); $v=bcmul($v,$w); } $t1=bcmul($u,$u); $t1=bcsub($t1,$d); $t1=bcdiv($t1,$v); $t2=gcd3($u,$v,$t1); $u=bcdiv($u,$t2); $v=bcdiv($v,$t2); $t1=bcmul($t2,$t2); $d=bcdiv($d,$t1); if(ge($d,"10000000000")){ print "actual d ≥ 1010
\n"; print "Return to main page
\n"; return; } print "least integer continued fraction expansion:
\n"; $t=zagier0($d,$u,$v); print "period length = $t
\n"; } print "

\n"; print "Return to main page
\n"; ?> php/ceil_cfrac.png0000644000175100017510000000117311661311057013424 0ustar keithkeithPNG  IHDRJV0PLTE/ݠ{tRNS8j~P卑IDATXGc`H7^Sl5fch`&0M4=0 && b>=0 && c>=0 && d>=0){ return(1) }else{ return(0) } } /* nprod(l,m) finds the least n such that A_n and D=A_0...A_n are non-negative. * The matrix of globabl variables D=[globala,globalb,globalc,globald] is * returned along with n. See Proposition 4.1, J.L. Davison, 'An algorithm for * the continued fraction of e^{l/m}', Proceedings of the Eighth Manitoba * Conference on Numerical Mathematics and Computing (Univ. Manitoba, Winnipeg, * 1978), 169--179, Congress. Numer., XXII, Utilitas Math. */ define nprod(l,m){ auto k,a1,b1,c1,d1,temp1,temp2,s,t,t1,t2 globala=m+l;globalb=m;globalc=m;globald=m-l for(k=1;1;k++){ s=positivity(globala,globalb,globalc,globald) if(s){ break } t=(2*k+1)*m t1=globala+globalb t2=globalc+globald temp1=t*t1 temp2=t*t2 a1=temp1+globala*l b1=temp1-globalb*l c1=temp2+globalc*l d1=temp2-globald*l globala=a1 globalb=b1 globalc=c1 globald=d1 } return(k-1) } define abs(n){ if(n>=0) return(n) return(-n) } /* gcd(m,n) for any integers m and n */ /* Euclid's division algorithm is used. */ /* We use gcd(m,n)=gcd(m,|n|) */ define gcd(m,n){ auto a,b,c a=abs(m) if(n==0) return(a) b=abs(n) c=a%b while(c>0){ a=b b=c c=a%b } return(b) } define reduce(a,b,c,d){ auto g g=gcd(a,b) g=gcd(g,c) g=gcd(g,d) return(g) } /* * Input: a non-singular matrix A=[p,q;r,s], p,q,r,s>=0, A!=I_2, A!=[0,1;1,0]. * With L=[1,0;1,1] and R=[1,1;0,1], we express A uniquely as * a product of non-negative powers of L and R, followed by a row-balanced B. * B=[a,b;c,d] is row-balanced if (ad) or (cb) * and a,b,c>=0. We exclude A=I_2 and A=[0,1;1,0]. * See 'On continued fractions and finite automata', G.N. Raney, * Math. Annalen, 206, 265-283 (1973). */ define raney(p,q,r,s){ auto i,j,k k=0 while(1){ i=0 while(p>=r && q>=s){ p=p-r q=q-s i=i+1 } if(i){ globalr=globalr+i flagr=1 if(flagl*flagr){ flagl=0 print globall,"," globall=0 count=count+1 } k=k+1 } j=0 while(r>=p && s>=q){ r=r-p s=s-q j=j+1 } if(j){ globall=globall+j flagl=1 if(flagr*flagl){ flagr=0 print globalr,"," globalr=0 count=count+1 } k=k+1 } if((ps) || (p>r && s>q)){ break } } globala=p globalb=q globalc=r globald=s return(k) } /* We perform the algorithm of J.L. Davison's paper. * With n>=0, we first find the n* of Davison's Proposition 4.1 * and apply raney's factorisation to A_0...A_k, for n*<=k<=n*+n. * The number (count) of partial quotients of e^{l/m} found is returned. * count becomes positive for all large n. */ define cfrac(l,m,n){ auto i,j,k,t count=0 flagr=0 flagl=0 globalr=0 globall=0 k=nprod(l,m) g=reduce(globala,globalb,globalc,globald) if(g>1){ globala=globala/g globalb=globalb/g globalc=globalc/g globald=globald/g } i=k j=k+n while(i<=j){ if(i==k){ a=1 b=0 c=0 d=1 }else{ t=(2*i+1)*m t1=globala+globalb t2=globalc+globald temp1=t*t1 temp2=t*t2 a1=temp1+globala*l b1=temp1-globalb*l c1=temp2+globalc*l d1=temp2-globald*l globala=a1 globalb=b1 globalc=c1 globald=d1 } i=i+1 t=raney(globala,globalb,globalc,globald); /* the input matrix will not be I_2 or [0,1;1,0] here. */ g=reduce(globala,globalb,globalc,globald) if(g>1){ globala=globala/g globalb=globalb/g globalc=globalc/g globald=globald/g } } print "...\nThe number of partial quotients found for e^(",l,"/",m,") is " return(count) } php/cfrac.html0000644000175100017510000001133113774013057012613 0ustar keithkeith CONTINUED FRACTION BCMATH PROGRAMS

Continued fraction BCMATH programs

  1. Euclid's algorithm and the regular continued fraction expansion of a rational number.
  2. The optimal continued fraction (OCF) expansion of a rational number.
  3. Nearest integer version of Euclid's algorithm.
  4. Calculating the fraction represented by the simple continued fraction a0+1/a1+ ··· +1/an.
  5. Finding the backward continued fraction of a quadratic irrational.
  6. Finding the simple continued fraction of a quadratic irrational.
    • Finding the simple continued fraction of √d over a range of consecutive d.
    • Finding the period-length of the simple continued fraction of √d using midpoint criteria.
    • Finding the positive and negative representations of a quadratic surd, as far as the end of the first period.
    • Testing a quadratic surd for being RCF-reduced.
  7. Finding the nearest integer continued fraction (NICF-H) of a quadratic irrational.
  8. Finding the nearest integer continued fraction (NICF-P)
  9. Finding the optimal continued fraction of a quadratic irrational.
    • Finding the optimal continued fraction of √d over a range of consecutive d.
  10. Finding the nearest square continued fraction of a quadratic irrational.
    • Finding the nearest square continued fraction of √d over a range of consecutive d.
    • Testing a quadratic surd for being NSCF-reduced.
    • Testing a quadratic surd for being NSCF-reduced. This is more elegant than the previous test.
  11. Solving the Pell equation x2 – dy2 = ±1 using midpoint criteria,
  12. Solving the diophantine equation x2 – xy – (D – 1)y2/4 = ±1, using the nearest square continued fraction of (1+√D)/2, D ≡ 1(mod 4).
  13. Calculating the quadratic irrationality whose periodic simple continued fraction is given.
  14. Producing a quadratic surd equivalent to a given one.
  15. Finding the simple continued fraction of
  16. Finding a Sturm sequence for a squarefree polynomial.
  17. Factorising
  18. Guessing the simple continued fraction expansion of logba
  19. Guessing the simple continued fraction expansion of logb(a /d)
  20. Finding the simple continued fraction of ep/q.
  21. Finding the simple continued fraction of (m/n)e1/q.

Last modified 2nd January 2021
Return to main page php/cfrac_nthroot.html0000644000175100017510000000461413241425152014366 0ustar keithkeith Calculating the first m+1 partial quotients of the n-th root of a positive rational using Lagrange's method

Calculating the first m+1 partial quotients of the n-th root of a positive rational using Lagrange's method

The method of Lagrange (1797) is used to find the the first m+1 partial quotients of (b/c)1/n, b ≥ 1, c ≥ 1, b ≠ c.
We apply the algorithm for finding the continued fraction of the unique real root > 1 of a polynomial f(x) ∈ Z[x] to the case where f(x) = cxn - b if b/c > 1, f(x) = bxn - c if b/c < 1.

References

  1. Number Theory with Computer Applications, R. Kumanduri and C. Romero, Prentice Hall 1997, page 261
  2. Elements of Computer Algebra with Applications, A.G. Akritas, Wiley 1989, 333-399.
  3. Art of computer programming, volume 2, D.E. Knuth, problem 13, Ch. 4.5.3.
  4. Continued fractions for some algebraic numbers, S. Lang and H. Trotter, J. für Math. 255 (1972) 112-134; Addendum 267 (1974) ibid. 219-220.
  5. A new proof of Vincent's theorem, A. Alesina, M. Galuzzi, L'Enseignement Math 44 (1988), 219-256.
For a program that develops the continued fraction of all real roots of a suitably general polynomial, see CALC.

Enter b (≥ 1):
Enter c (≥ 1, c ≠ b):
Enter n (1 < n ≤ 100):
Enter m (0 ≤ m < 1000):

Last modified 30th June 2006
Return to main page php/cfrac_nthroot.php0000644000175100017510000000456112747102471014220 0ustar keithkeith \n"; } else{ $b=$Bvalue; $c=$Cvalue; $n=$Nvalue; $m=$Mvalue; if(bccomp($b,"1")<="0"){ print "b ≤ 1
\n"; }else if(bccomp($c,"1")<"0"){ print "c < 1
\n"; }else if(bccomp($c,$b)=="0"){ print "c = b
\n"; }else if(bccomp($n,"1")<="0"){ print "n ≤ 1
\n"; }else if(bccomp($m,"0")<"0"){ print "$m < 0
\n"; }else if(bccomp($m,"999")>"0"){ print "m ≥ 1000
\n"; }else{ $g=gcd($b,$c); $bb=bcdiv($b,$g); $cc=bcdiv($c,$g); $p=bcadd($m,"1"); echo "The first "; if(bccomp($m,"0")=="0"){ echo "partial quotient "; }else{ echo "$p partial quotients "; } echo "of the continued fraction of "; if(bccomp($cc,"1")=="1"){ echo "($bb/$cc)1/$n"; }else{ echo "$bb1/$n"; } if(bccomp($m,"0")=="1"){ echo " are
\n"; }else{ echo " is
\n"; } if(bccomp($bb,$cc)<"0"){ $temp=$bb; $bb=$cc; $cc=$temp; if(bccomp($m,"0")=="0"){ echo"0
\n"; }else{ echo"0, "; $m=bcsub($m,"1"); lagrange1($bb,$cc,$n,$m); } }else{ lagrange1($bb,$cc,$n,$m); } } } print "

\n"; print "Return to main page
\n"; ?> php/cfrac_.php0000644000175100017510000000675312210472005012573 0ustar keithkeith= 1. * qn(a[],n) returns q[n], where * q[0]=1,q[1]=a[1],q[i+1]=a[i+1]*q[i]+q[i-1] if i >= 1. * Hence pn/qn is the value of the simple continued fraction * [a[0],a[1],...,a[n]]. * printcfrac($d,$t,$u,$v) prints ($u+$t\sqrt($d))/$v * standardform($d,$t,$u,$v) converts (u+$t\sqrt($d))/$v to standard form */ function pn($a,$n){ global $A; $A["-1"]="1"; $A["-2"]="0"; if(gezero($n)){ $A[0]=$a[0]; if($n=="0"){ return($a[0]); } } if(ge($n,"1")){ $x=bcmul($a[0],$a[1]); $y=bcadd($x,"1"); $A[1]=$y; if(eq($n,"1")){ return($y); } } $x=$a[0]; $z=bcmul($a[0],$a[1]); $y=bcadd($z,"1"); for($i="2";le($i,$n);$i=bcadd($i,"1")){ $t=bcmul($a[$i],$y); $z=bcadd($t,$x); $A[$i]=$z; $x=$y; $y=$z; } return($z); } function qn($a,$n){ global $B; $B["-1"]="0"; $B["-2"]="1"; if(gezero($n)){ $B[0]="1"; if(ezero($n)){ return("1"); } } if(ge($n,"1")){ $B[1]=$a[1]; if(eq($n,"1")){ return($a[1]); } } $x="1";$y=$a[1]; for($i="2";le($i,$n);$i=bcadd($i,"1")){ $t=bcmul($a[$i],$y); $z=bcadd($t,$x); $B[$i]=$z; $x=$y; $y=$z; } return($z); } /* printing ($temp1+$temp4xsqrt($d)$temp3 */ function printcfrac($d,$temp4,$temp1,$temp3){ if(neq($temp3,"1")){ if(ezero($temp1)){ if(eq($temp4,"1")){ echo "(√$d)/$temp3
\n"; }else if(eq($temp4,"-1")){ echo "(-√$d)/$temp3
\n"; }else{ echo "($temp4√$d)/$temp3
\n"; } }else{echo "($temp1"; if(eq($temp4,"1")){ echo " + √$d)/$temp3
\n"; }else if(eq($temp4,"-1")){ echo " - √$d)/$temp3
\n"; }else if(gt($temp4,"1")){ echo " +$temp4√$d)/$temp3
\n"; }else{ $temp=bcsub("0",$temp4); echo " - $temp√$d)/$temp3
\n"; } } }else{ if(ezero($temp1)){ if(eq($temp4,"1")){ echo "√$d
\n"; }else if(eq($temp4,"-1")){ echo "-√$d
\n"; }else{ echo "$temp4√$d
\n"; } }else{echo "$temp1"; if(eq($temp4,"1")){ echo " + √$d
\n"; }else if(eq($temp4,"-1")){ echo " - √$d
\n"; }else if(gt($temp4,"1")){ echo " + √$d
\n"; }else{ $temp=bcsub("0",$temp4); echo " - $temp√$d
\n"; } } } } /* converts (u+$t\sqrt($d))/$v to standard form */ function standardform($d,$t,$u,$v){ global $globalstandard_formd; global $globalstandard_formp; global $globalstandard_formq; $z=sign($t); if(eq($z,"-1")){ $u=bcmul($u,$z); $v=bcmul($v,$z); } $x=bcmul($t,$t); $d=bcmul($d,$x); $w=bcabs($v); $x=bcmul($u,$u); $x=bcsub($d,$x); $x=bcmod($x,$w); if(neqzero($x)){ $x=bcmul($v,$v); $d=bcmul($x,$d); $u=bcmul($u,$w); $v=bcmul($v,$w); } $t1=bcmul($u,$u); $t1=bcsub($t1,$d); $t1=bcdiv($t1,$v); $t2=gcd3($u,$v,$t1); $globalstandard_formp=bcdiv($u,$t2); $globalstandard_formq=bcdiv($v,$t2); $t1=bcmul($t2,$t2); $globalstandard_formd=bcdiv($d,$t1); } ?> php/cfrac_trinomial0.html0000644000175100017510000000506013241426660014750 0ustar keithkeith Calculating the first m+1 partial quotients of the unique positive root of a trinomial ax^n + bx^{n-1} + c

Calculating the first m + 1 partial quotients of the unique positive root of a trinomial axn + bxn-1 + c

We are dealing with polyomial f(x)=axn + bxn-1 + c with integer coefficients, a > 0, c < 0. This will have a unique positive root α which we will assume is greater than 1.
The method of Lagrange (1797) is used to find the the first m + 1 partial quotients of α.

References

  1. Number Theory with Computer Applications, R. Kumanduri and C. Romero, Prentice Hall 1997, page 261
  2. Elements of Computer Algebra with Applications, A.G. Akritas, Wiley 1989, 333-399.
  3. Art of computer programming, volume 2, D.E. Knuth, problem 13, Ch. 4.5.3.
  4. Continued fractions for some algebraic numbers, S. Lang and H. Trotter, J. für Math. 255 (1972) 112-134; Addendum 267 (1974) ibid. 219-220.
  5. A new proof of Vincent's theorem, A. Alesina, M. Galuzzi, L'Enseignement Math 44 (1988), 219-256.
  6. An explanation of some exotic continued fractions found by Brillart, H.M. Stark, Computers in number theory, Academic Press 1971, 21-35.
For a program that develops the continued fraction of all real roots of a suitably general polynomial, see CALC.

Enter a (≠ 0):
Enter b :
Enter c (ac < 0):
Enter n (1 < n ≤ 100):
Enter m (0 ≤ m < 1000):

Last modified 21st July 2006
Return to main page php/cfrac_trinomial0.php0000644000175100017510000000543212747102674014604 0ustar keithkeith \n"; } else{ $a=$Avalue; $b=$Bvalue; $c=$Cvalue; $n=$Nvalue; $m=$Mvalue; if(bccomp($c,"0")>="0"){ print "c ≥ 0
\n"; }else if(bccomp($a,"0")<="0"){ print "a ≤ 0
\n"; }else if(bccomp($n,"1")<="0"){ print "n ≤ 1
\n"; }else if(bccomp($m,"0")<"0"){ print "$m < 0
\n"; }else if(bccomp($m,"999")>"0"){ print "m ≥ 1000
\n"; }else{ $t=$n; $r=bcsub($n,"1"); $f[0]=$c; $f[$r]=$b; $f[$n]=$a; for($i="1";lt($i,$r);$i=bcadd($i,"1")){ $f[$i]="0"; } print "input polynomial f(x)="; printpoly($f,$t); print "
\n"; print "
\n"; derivpi($f,$t); $deggcd=gcdpi($f,$derpi,$t,$degderpi,"0"); if(bccomp($deggcd,"0")>0){ print "f(x) has a multiple root
\n"; flush(); }else{ $g0=sturm($f,$t,"0","0"); $g1=sturm($f,$t,"1","0"); $temp=evalpi($f,$t,"1"); if(bccomp($temp,"0")==0){ print "f(1)=0
\n"; flush(); } else if(bccomp($g0,$g1)==0){ $h=cauchy($f,$t); $temp=evalpi($f,$t,$h); if(bccomp($temp,"0")==0){ /* unlikely case */ $h=bcadd($h,"1"); } $gc=sturm($f,$t,$h,"0"); $diff=bcsub($g1,$gc); if(bccomp($diff,"1")>0){ print "f(x) has $diff roots > 1
\n"; flush(); }else if(bccomp($diff,"0")==0){ print "f(x) has no root > 1
\n"; flush(); }else{ print "f(x) has exactly one root > 1
\n"; $temp=bcadd($Mvalue,"1"); if(gt($temp,"1")){ print "its first $temp partial quotients are
\n"; }else{ print "its first partial quotient is "; } lagrange($f,$t,$Mvalue); } }else{ print "f(x) has a root between 0 and 1
\n"; flush(); } } } } print "

\n"; print "Return to main page
\n"; ?> php/cfrac_trinomial.html0000644000175100017510000000541213241426011014657 0ustar keithkeith Calculating the first m + 1 partial quotients of the unique positive root of a trinomial ax^n + bx + c

Calculating the first m + 1 partial quotients of the unique positive root of a trinomial axn + bx + c

We are dealing with polyomial f(x) = axn + bx + c with integer coefficients, a > 0, c < 0. This will have a unique positive root α which we will assume is greater than 1. The method of Lagrange (1797) is used to find the the first m + 1 partial quotients of α.

We remark that Disc(f(x)) is given by

Disc(f(x)) = an-2(γnncn-1a + β(n-1)n-1bn),

where γ = (-1)n(n-1)/2 and β = (-1)(n-1)(n-2)/2.

References

  1. Number Theory with Computer Applications, R. Kumanduri and C. Romero, Prentice Hall 1997, page 261
  2. Elements of Computer Algebra with Applications, A.G. Akritas, Wiley 1989, 333-399.
  3. Art of computer programming, volume 2, D.E. Knuth, problem 13, Ch. 4.5.3.
  4. Continued fractions for some algebraic numbers, S. Lang and H. Trotter, J. für Math. 255 (1972) 112-134; Addendum 267 (1974) ibid. 219-220.
  5. A new proof of Vincent's theorem, A. Alesina, M. Galuzzi, L'Enseignement Math 44 (1988), 219-256.
  6. An explanation of some exotic continued fractions found by Brillart, H.M. Stark, Computers in number theory, Academic Press 1971, 21-35.
For a program that develops the continued fraction of all real roots of a suitably general polynomial, see CALC.

Enter a (> 0):
Enter b :
Enter c (c < 0):
Enter n (1 < n ≤ 100):
Enter m (0 ≤ m < 1000):

Last modified 21st July 2006
Return to main page php/cfrac_trinomial.php0000644000175100017510000000517512744324006014520 0ustar keithkeith \n"; } else{ $a=$Avalue; $b=$Bvalue; $c=$Cvalue; $n=$Nvalue; $m=$Mvalue; if(bccomp($a,"0")<="0"){ print "a ≤ 0
\n"; }else if(bccomp($c,"0")>="0"){ print "c ≥ 0
\n"; }else if(bccomp($n,"1")<="0"){ print "n ≤ 1
\n"; }else if(bccomp($m,"0")<"0"){ print "$m < 0
\n"; }else if(bccomp($m,"999")>"0"){ print "m ≥ 1000
\n"; }else{ $t=$n; $f[0]=$c; $f[1]=$b; $f[$n]=$a; for($i="2";lt($i,$n);$i=bcadd($i,"1")){ $f[$i]="0"; } print "input polynomial f(x)="; printpoly($f,$t); print "
\n"; print "
\n"; derivpi($f,$t); $deggcd=gcdpi($f,$derpi,$t,$degderpi,"0"); if(bccomp($deggcd,"0")>0){ print "f(x) has a multiple root
\n"; flush(); }else{ $g0=sturm($f,$t,"0","0"); $g1=sturm($f,$t,"1","0"); $temp=evalpi($f,$t,"1"); if(bccomp($temp,"0")==0){ print "f(1)=0
\n"; flush(); } else if(bccomp($g0,$g1)==0){ $h=cauchy($f,$t); $temp=evalpi($f,$t,$h); if(bccomp($temp,"0")==0){ /* unlikely case */ $h=bcadd($h,"1"); } $gc=sturm($f,$t,$h,"0"); $diff=bcsub($g1,$gc); if(bccomp($diff,"1")>0){ print "f(x) has $diff roots > 1
\n"; flush(); }else if(bccomp($diff,"0")==0){ print "f(x) has no root > 1
\n"; flush(); }else{ print "f(x) has exactly one root > 1
\n"; $temp=bcadd($Mvalue,"1"); if(gt($temp,"1")){ print "its first $temp partial quotients are
\n"; }else{ print "its first partial quotient is "; } lagrange($f,$t,$Mvalue); } }else{ print "f(x) has a root between 0 and 1
\n"; flush(); } } } } print "

\n"; print "Return to main page
\n"; ?> php/changes.html0000644000175100017510000012172514056411543013152 0ustar keithkeith Changes and additions to Keith Matthews' BCMATH programs

Changes and additions to Keith Matthews' BCMATH programs


Return to BCMATH page
php/check_input.php0000644000175100017510000000064307625020343013652 0ustar keithkeith\n"; $value="0"; return($value); } } ?> php/chinese2.html0000644000175100017510000000216711626067024013241 0ustar keithkeith The Chinese remainder theorem

The Chinese remainder theorem

We solve the congruences x a (mod m), x b (mod n). (See description of algorithm.)

Enter a:
Enter b:
Enter m (> 1):
Enter n (> 1):

Last modified 23rd May 2003
Return to main page
php/chinese2.php0000644000175100017510000000252712747024654013073 0ustar keithkeith The Chinese remainder theorem \n"; } else if(bccomp($M3value,"1")<0){ print "m < 1
\n"; } else if(bccomp($M4value,"1")<0){ print "n < 1
\n"; } else{ $result=chinese2($M1value,$M2value,$M3value,$M4value); print "the system of congruences

\n"; print "x ≡ $M1value (mod $M3value), \n"; print "x ≡ $M2value (mod $M4value)

"; if($result){ print "has the complete solution x ≡ $chinese_solution (mod $chinese_modulus)
\n"; }else{ print "has no solution
\n"; } } print "

\n"; print "Return to main page
\n"; ?> php/chinesea.html0000644000175100017510000000240011626067061013307 0ustar keithkeith The Chinese reminder theorem for n congruences

The Chinese reminder theorem for n congruences

x ≡ a1 (mod m1),..., x ≡ an (mod mn)

Here a1,...,an, m1,...,mn, are integers, with m1,...,mn positive.

The congruences are solved recursively, starting with the first two.

Enter a1,...,an (separated by spaces):
Enter m1,...,mn (separated by spaces):

Last modified 29th April 2004
Return to main page php/chinesea.php0000644000175100017510000000314712747025020013135 0ustar keithkeith \n"; break; } if($tm<="1"){ print "m array has < 2 elements
\n"; break; } if($ta!=$tm){ print "a and m arrays have different numbers of elements
\n"; break; }else{ $number=$ta; } for($i="0";$i<$ta;$i=bcadd($i,"1")){ $check=check_decimal($a[$i]); if ($check=="0"){ print "

\n"; $flaga="1"; break; } } if(bccomp($flaga,"1")==0){ break; } for($i="0";$i<$tm;$i=bcadd($i,"1")){ $check=check_decimal($m[$i]); if ($check=="0"){ print "

\n"; $flagm="1"; break; } $u=bccomp($m[$i],"0"); if($u<="0"){ print "m[$i] <= 0
\n"; $flagm="1"; break; } } if($flagm=="1"){ break; } $result=chinesea($a,$m,$number); print "the system of congruences

\n"; $t=bcsub($number,"1"); for($i="0";$i<$number;$i=bcadd($i,"1")){ print "x ≡ $a[$i] (mod $m[$i])"; if(bccomp($i,$t)<0){ print ", "; } } print "

\n"; if($result){ print "has the complete solution x ≡ $chinese_solution (mod $chinese_modulus)
\n"; }else{ print "has no solution
\n"; } break; } print "

\n"; print "Return to main page
\n"; ?> php/classnoneg.html0000644000175100017510000000310511625276114013667 0ustar keithkeith Finding the class number h(d) of binary quadratic forms of negative discriminant d

Finding the class number h(d) of binary quadratic forms of negative discriminant d

Here d ≡ 0 (mod 4) or 1 (mod 4).
If flag value 1 is entered below, we print only the primitive forms.
If flag value 0 is entered, we print primitive and imprimitive forms.
h(d) is returned in each case.
H. Davenport's Higher Arithmetic has a table of forms, which lists the imprimitive ones with an asterisk.
If d is the discriminant of an imaginary quadratic field K, then the primitive forms class-number h(d) is also the class number of K.

(See Henri Cohen's Algorithm 5.3.5, p. 228, A course in computational number theory, First Edition.)

Enter d (d < 0 and d ≡ 0 or 1 (mod 4), |d| < 106 ):
Enter flag (0 or 1):

Last modified 12th May 2003
Return to main page php/classnoneg_.php0000644000175100017510000002122311613024632013643 0ustar keithkeith\n"; flush(); }else{ print "determining reduced primitive and imprimitive forms of discriminant $d
\n"; flush(); } } $temp=bcmod($d,"4"); if(bccomp($temp,"0")==0){ $b="0"; }else{ $b="1"; } $temp=bcsub("0",$d); $temp=bcdiv($temp,"3"); $bb=bcsqrt($temp); while(bccomp($b,$bb)<=0){ $temp=bcmul($b,$b); $temp=bcsub($temp,$d); $q=bcdiv($temp,"4"); $a=$b; if(bccomp($a,"1")<=0){ $a="1"; } while(bccomp(bcmul($a,$a),$q)<=0){ if(bccomp(bcmod($q,$a),"0")==0){ $t=bcdiv($q,$a); if(bccomp($flag,"0")!=0){ $gg=gcd($a,$b); $gg=gcd($gg,$t); if(bccomp($gg,"1")>0){ $g="0"; } } if(bccomp($g,"1")==0){ if(bccomp($a,$b)==0 || bccomp(bcmul($a,$a),$q)==0 || bccomp($b,"0")==0){ if(bccomp($table_flag,"0")!=0){ print "($a,$b,$t),\n"; flush(); } $h=bcadd($h,"1"); }else{ if(bccomp($table_flag,"0")!=0){ print "($a,$b,$t), \n"; flush(); $temp=bcsub("0",$b); print "($a,$temp,$t), \n"; flush(); } $h=bcadd($h,"2"); } }else{ $g="1"; } } $a=bcadd($a,"1"); } $b=bcadd($b,"2"); } return($h); } /* The following gives a table of h(-d) for all squarefree d i * in the range m<=d<=n<10^6. * Returns the number of squarefree d in the range. */ function table_qfields($m,$n){ $count="0"; print "\n"; print "\n"; flush(); print "\n"; flush(); for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $minusd=bcsub("0",$d); $h=squarefree_test($d); if(bccomp($h,"0")==0){ continue; }else{ $r=mod($minusd,"4"); if(bccomp($r,"1")!=0){ $dd= bcmul("4",$minusd); }else{ $dd= $minusd; } $t=class_number($dd,"1","0"); $count=bcadd($count,"1"); print ""; flush(); if(ezero($rem)){ print "\n"; flush(); print ""; flush(); } } } print "\n
Class numbers h(-d) for imaginary quadratic fields ℚ(√-d), $m ≤ d ≤ $n
"; flush(); $rem=bcmod($count,"10"); print "h($minusd)$t"; flush(); print "
\n"; flush(); return($count); } /* The following gives a table of h(d) for all discriminants d * in the range m<=d<=n<10^6. */ function table_qforms($m,$n){ $count="0"; print "\n"; print "\n"; flush(); print "\n"; flush(); for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $r=mod($d,"4"); if(ezero($r) || eq($r,"3")){ $count=bcadd($count,"1"); print ""; flush(); $rem=bcmod($count,"6"); if(ezero($rem)){ print "\n"; flush(); print ""; flush(); } } } print "\n
Class numbers for negative discriminants d, $m ≤ d ≤ $n
"; flush(); $minusd=bcminus($d); $h=class_number($minusd,"1","0"); print "h($minusd)$h"; flush(); print "
\n"; flush(); return($count); } function fund_disc_test($d){ $s=mod($d,"4"); if(eq($s,"2") || eq($s,"3")){ return("0"); } $minusd=bcminus($d); $r=parity($d); if(eq($r,"1")){ $m=mu($minusd); if(ezero($m)){ return("0"); }else{ return("1"); } }else{ $r=bcmod($d,"4"); if(neqzero($r)){ return("0"); }else{ $D=int($minusd,4); $r=mod($D,"4"); if(eq($r,"3") || eq($r,"0")){ return("0"); } $m=mu($D); if(ezero($m)){ return("0"); }else{ return("1"); } } } } /* The following gives a table of h(d) for all fundamental discriminants d * in the range m<=d<=n<10^6. */ function table_qforms_fund($m,$n){ $count="0"; print "\n"; flush(); print "\n"; flush(); print "\n"; flush(); for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $minusd=bcminus($d); $t=fund_disc_test($minusd); if(ezero($t)){ continue; } $count=bcadd($count,"1"); print ""; flush(); $rem=bcmod($count,"6"); if(ezero($rem)){ print "\n"; flush(); print ""; flush(); } } print "\n
Class numbers for negative fundamental discriminants d, $m ≤ d ≤ $n
"; flush(); $h=class_number($minusd,"1","0"); print "h($minusd)$h"; flush(); print "
\n"; flush(); return($count); } /* The following gives a table of h(d) for all odd fundamental discriminants d * in the range m<=d<=n<10^6. */ function table_qforms_fund_odd($m,$n){ $count="0"; print "\n"; flush(); print "\n"; flush(); print "\n"; flush(); for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $r=parity($d); if(ezero($r)){ continue; } $minusd=bcminus($d); $t=fund_disc_test($minusd); if(ezero($t)){ continue; } $count=bcadd($count,"1"); print ""; flush(); $rem=bcmod($count,"6"); if(ezero($rem)){ print "\n"; flush(); print ""; flush(); } } print "\n
Class numbers for odd negative fundamental discriminants d, $m ≤ d ≤ $n
"; flush(); $h=class_number($minusd,"1","0"); print "h($minusd)$h"; flush(); print "
\n"; flush(); return($count); } /* The following gives a table of h(d) for all even fundamental discriminants d * in the range m<=d<=n<10^6. */ function table_qforms_fund_even($m,$n){ $count="0"; print "\n"; flush(); print "\n"; flush(); print "\n"; flush(); for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $r=parity($d); if(eq($r,"1")){ continue; } $minusd=bcminus($d); $t=fund_disc_test($minusd); if(ezero($t)){ continue; } $count=bcadd($count,"1"); print ""; flush(); $rem=bcmod($count,"6"); if(ezero($rem)){ print "\n"; flush(); print ""; flush(); } } print "\n
Class numbers for even negative fundamental discriminants d, $m ≤ d ≤ $n
"; flush(); $h=class_number($minusd,"1","0"); print "h($minusd)$h"; flush(); print "
\n"; flush(); return($count); } ?> php/classnoneg.php0000644000175100017510000000222112747012210013477 0ustar keithkeith \n"; } else{ $d=$M1value; $flag=$M2value; while("1"){ if(gezero($d)){ print "discriminant is not negative
\n"; break; } $temp=bcsub("0",$d); if(ge($temp,"10000000000")){ print "|d| >= 10000000000
\n"; break; } $temp=bcmod($temp,"4"); if($temp && neq($temp,"3")){ print "discriminant is not 0 or 1 (mod 4)
\n"; break; } if($flag){ $flag="1"; } $class_number=class_number($d,$flag,"1"); print "
h($d)=$class_number
\n"; flush(); break; } } print "

\n"; print "Return to main page
\n"; ?> php/classnoneg_.php.orig0000644000175100017510000002116511613021426014605 0ustar keithkeith\n"; flush(); }else{ print "determining reduced primitive and imprimitive forms of discriminant $d
\n"; flush(); } } $temp=bcmod($d,"4"); if(bccomp($temp,"0")==0){ $b="0"; }else{ $b="1"; } $temp=bcsub("0",$d); $temp=bcdiv($temp,"3"); $bb=bcsqrt($temp); while(bccomp($b,$bb)<=0){ $temp=bcmul($b,$b); $temp=bcsub($temp,$d); $q=bcdiv($temp,"4"); $a=$b; if(bccomp($a,"1")<=0){ $a="1"; } while(bccomp(bcmul($a,$a),$q)<=0){ if(bccomp(bcmod($q,$a),"0")==0){ $t=bcdiv($q,$a); if(bccomp($flag,"0")!=0){ $gg=gcd($a,$b); $gg=gcd($gg,$t); if(bccomp($gg,"1")>0){ $g="0"; } } if(bccomp($g,"1")==0){ if(bccomp($a,$b)==0 || bccomp(bcmul($a,$a),$q)==0 || bccomp($b,"0")==0){ if(bccomp($table_flag,"0")!=0){ print "($a,$b,$t),\n"; flush(); } $h=bcadd($h,"1"); }else{ if(bccomp($table_flag,"0")!=0){ print "($a,$b,$t), \n"; flush(); $temp=bcsub("0",$b); print "($a,$temp,$t), \n"; flush(); } $h=bcadd($h,"2"); } }else{ $g="1"; } } $a=bcadd($a,"1"); } $b=bcadd($b,"2"); } return($h); } /* The following gives a table of h(-d) for all squarefree d i * in the range m<=d<=n<10^6. * Returns the number of squarefree d in the range. */ function table_qfields($m,$n){ $count="0"; for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $minusd=bcsub("0",$d); $h=squarefree_test($d); if(bccomp($h,"0")==0){ continue; }else{ $r=mod($minusd,"4"); if(bccomp($r,"1")!=0){ $dd= bcmul("4",$minusd); }else{ $dd= $minusd; } $t=class_number($dd,"1","0"); $count=bcadd($count,"1"); $rem=bcmod($count,"10"); print "h($minusd) = $t, "; flush(); if(ezero($rem)){ print "
\n"; } } } return($count); } /* The following gives a table of h(-d) for all discriminants d * in the range 3<=m<=d<=n<10^6. */ /*function table_qforms($m,$n){ $count="0"; for($d=$m;le($d,$n);$d=bcadd($d,"1")){ $r=mod($d,"4"); if(ezero($r) || eq($r,"3")){ $count=bcadd($count,"1"); $minusd=bcminus($d); $s=class_number($minusd,"1","0"); $rem=bcmod($count,"10"); print "h($minusd)=$s, "; flush(); if(ezero($rem)){ print "
\n"; } } } return($count); }*/ /* The following gives a table of h(d) for all discriminants d * in the range m<=d<=n<10^6. */ function table_qforms($m,$n){ $count="0"; print "\n"; print "\n"; flush(); print "\n"; flush(); for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $r=mod($d,"4"); $t=bcsqrt($d); $temp=bcmul($t,$t); if(eq($temp,$d)){ continue; } if(ezero($r) || eq($r,"3")){ $count=bcadd($count,"1"); print ""; flush(); $rem=bcmod($count,"6"); if(ezero($rem)){ print "\n"; flush(); print ""; flush(); } } } print "\n
Class numbers for negative discriminants d, $m ≤ d ≤ $n
"; flush(); $minusd=bcminus($d); $h=class_number($minusd,"1","0"); print "h($d)$h"; flush(); print "
\n"; flush(); return($count); } function fund_disc_test($d){ $s=mod($d,"4"); if(eq($s,"2") || eq($s,"3")){ return("0"); } $minusd=bcminus($d); $r=parity($d); if(eq($r,"1")){ $m=mu($minusd); if(ezero($m)){ return("0"); }else{ return("1"); } }else{ $r=bcmod($d,"4"); if(neqzero($r)){ return("0"); }else{ $D=int($minusd,4); $r=mod($D,"4"); if(eq($r,"3") || eq($r,"0")){ return("0"); } $m=mu($D); if(ezero($m)){ return("0"); }else{ return("1"); } } } } /* The following gives a table of h(d) for all fundamental discriminants d * in the range m<=d<=n<10^6. */ function table_qforms_fund($m,$n){ $count="0"; print "\n"; flush(); print "\n"; flush(); print "\n"; flush(); for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $minusd=bcminus($d); $t=fund_disc_test($minusd); if(ezero($t)){ continue; } $count=bcadd($count,"1"); print ""; flush(); $rem=bcmod($count,"6"); if(ezero($rem)){ print "\n"; flush(); print ""; flush(); } } print "\n
Class numbers for negative fundamental discriminants d, $m ≤ d ≤ $n
"; flush(); $h=class_number($minusd,"1","0"); print "h($minusd)$h"; flush(); print "
\n"; flush(); return($count); } /* The following gives a table of h(d) for all odd fundamental discriminants d * in the range m<=d<=n<10^6. */ function table_qforms_fund_odd($m,$n){ $count="0"; print "\n"; flush(); print "\n"; flush(); print "\n"; flush(); for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $r=parity($d); if(ezero($r)){ continue; } $minusd=bcminus($d); $t=fund_disc_test($minusd); if(ezero($t)){ continue; } $count=bcadd($count,"1"); print ""; flush(); $rem=bcmod($count,"6"); if(ezero($rem)){ print "\n"; flush(); print ""; flush(); } } print "\n
Class numbers for odd negative fundamental discriminants d, $m ≤ d ≤ $n
"; flush(); $h=class_number($minusd,"1","0"); print "h($minusd)$h"; flush(); print "
\n"; flush(); return($count); } /* The following gives a table of h(d) for all even fundamental discriminants d * in the range m<=d<=n<10^6. */ function table_qforms_fund_even($m,$n){ $count="0"; print "\n"; flush(); print "\n"; flush(); print "\n"; flush(); for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $r=parity($d); if(eq($r,"1")){ continue; } $minusd=bcminus($d); $t=fund_disc_test($minusd); if(ezero($t)){ continue; } $count=bcadd($count,"1"); print ""; flush(); $rem=bcmod($count,"6"); if(ezero($rem)){ print "\n"; flush(); print ""; flush(); } } print "\n
Class numbers for even negative fundamental discriminants d, $m ≤ d ≤ $n
"; flush(); $h=class_number($minusd,"1","0"); print "h($minusd)$h"; flush(); print "
\n"; flush(); return($count); } ?> php/classnonegtable_qfields.html0000644000175100017510000000254712331267546016423 0ustar keithkeith Calculating the class number h(-d) for imaginary quadratic fields

Calculating the class number h(-d) for imaginary quadratic fields Q(√d)

h(-d) is listed for all squarefree d in the range m ≤ d ≤ n, where n < 106.
We count equivalently h(-D) for positive definite binary quadratic forms of negative discriminant -D, where

(See Henri Cohen's Algorithm 5.3.5, p. 228, A course in computational number theory, First Edition.)

Enter m (1 ≤ m < 106 ):
Enter n (1 ≤ m ≤ n < 106 ):

Last modified 18th January 2011
Return to main page php/classnonegtable_qfields.php0000644000175100017510000000223212747012333016226 0ustar keithkeith \n"; } else{ $m=$M1value; $n=$M2value; while("1"){ $limit=bcpow("10","6"); if(bccomp($m,$n)>0){ print "m > n
\n"; flush(); break; } if(bccomp($n,$limit)>=0){ print "n >= $limit
\n"; flush(); break; } if(bccomp($m,"0")<=0 || bccomp($n,"0")<=0){ print "m or n < 1
\n"; flush(); break; } $count=table_qfields($m,$n); if(eq($count,"1")){ print "
\n There is one discriminant -d with d in the range [$m,$n]
\n"; }else{ print "
\n There are $count discriminants -d with d in the range [$m,$n]
\n"; } flush(); break; } } print "

\n"; print "Return to main page
\n"; ?> php/classnonegtable_qforms.html0000644000175100017510000000321412331270274016263 0ustar keithkeith Calculating the class number h(-d) for positive definite binary forms of negative discriminant -d

Calculating the class number h(-d) for positive definite binary forms of negative discriminant -d

h(-d) is listed for all discriminants -d in the range m ≤ d ≤ n, where n < 106.

(See Henri Cohen's Algorithm 5.3.5, p. 228, A course in computational number theory, First Edition.)

Also see tables generated via this page.

Enter m (1 ≤ m < 106 ):
Enter n (1 ≤ m ≤ n < 106 ):

All discriminants
All fundamental discriminants
All odd fundamental discriminants
All even fundamental discriminants

Last modified 22nd July 2011
Return to main page php/classnonegtable_qforms.php0000644000175100017510000000312412747012455016114 0ustar keithkeith \n"; } else{ $m=$M1value; $n=$M2value; while("1"){ $limit=bcpow("10","6"); if(bccomp($m,$n)>0){ print "m > n
\n"; flush(); break; } if(bccomp($n,$limit)>=0){ print "n >= $limit
\n"; flush(); break; } if(bccomp($m,"0")<=0 || bccomp($n,"0")<=0){ print "m or n < 1
\n"; flush(); break; } $mapping=$_POST['mapping']; /*printf("value of mapping %s\n",$mapping);*/ if($mapping=="0"){ $count=table_qforms($m,$n); } if($mapping=="1"){ $count=table_qforms_fund($m,$n); } if($mapping=="2"){ $count=table_qforms_fund_odd($m,$n); } if($mapping=="3"){ $count=table_qforms_fund_even($m,$n); } if(eq($count,"1")){ print "
\n There is one discriminant -d with d in the range [$m,$n]
\n"; }else{ print "
\n There are $count discriminants -d with d in the range [$m,$n]
\n"; } flush(); break; } } print "

\n"; print "Return to main page
\n"; ?> php/classnopos0.html0000644000175100017510000000355711625276334014016 0ustar keithkeith Finding the class number h(d) of a primitive binary quadratic forms of positive discriminant d

Finding the class number h(d) of primitive binary quadratic forms of positive discriminant d

Here d > 1, d ≡ 0 or 1 (mod 4), is not a perfect square.
We locate all reduced irrationals of the form (b+√d)/(2|c|), where c is negative and 4c divides d-b2. We use the PQa continued fraction algorithm of Lagrange to break the set into disjoint cycles, retaining one number from each cycle.
Each reduced number then gives rise to a reduced form (a,b,c) of discriminant d, where a=(b2-d)/4c.
We are able to also determine if the Pell equation x2-dy2=-4 has a solution, by using the fact that the equation is soluble iff at least one of the above cycles is odd. If there is no solution, the reduced forms (-a,b,-c) have to be counted as well.

(See G.B. Mathews, Theory of Numbers, 80-81, note and Henri Cohen's A course in computational number theory, page 260, First Edition.)

Enter d (d > 1 and not a perfect square, d ≡ 0 or 1 (mod 4), d < 106 ):

Last modified 31st October 2006
Return to main page php/classnopos0_.php0000644000175100017510000003011212743327560013763 0ustar keithkeith1 and not a perfect square. */ /* * This is a function for finding the period of the continued fraction * expansion of reduced quadratic irrational a=(u+sqrt(d))/v. * Here d is non-square, 1<(u+sqrt(d))/v, -1<(u-sqrt(d))/v<0. * The algorithm also assumes that v divides d-u*u and is based on K. Rosen, * Elementary Number theory and its applications, p.379-381 and Knuth's The art * of computer programming, Vol. 2, p. 359. */ function period($d,$u,$v){ global $global_count; global $globalarray_a; global $globalarray_b; $f=bcsqrt($d); $s=$v; $r=$u; $k=$global_count; /* set initially to 0 below in reduce(d) */ for($j=$k;"1";$j=bcadd($j,"1")){ $temp=bcadd($f,$u); $a=bcdiv($temp,$v); $temp=bcmul($a,$v); $u=bcsub($temp,$u); $temp=bcmul($u,$u); $v=bcdiv(bcsub($d,$temp),$v); $globalarray_a[$j]=$u; $globalarray_b[$j]=$v; if(bccomp($u,$r)==0 && bccomp($v,$s)==0){ break; } } $temp1=bcsub($j,$k); $temp2=bcadd($global_count,$temp1); $global_count=bcadd("1",$temp2); return($global_count); } /* test(u,v) checks to see if (u,v) has already occurred in the * list globalarray_a[] && globalarray_b[]. */ function test($u,$v){ global $global_count; global $globalarray_a; global $globalarray_b; for($i="0";bccomp($i,$global_count)<0;$i=bcadd($i,"1")){ if(bccomp($u,$globalarray_a[$i])==0 && bccomp($v,$globalarray_b[$i])==0){ return("0"); } } return("1"); } /* reduce(d) performs Lagrange's method on all reduced quadratic * irrationals (b+\sqrt(d))/2|c|, where 4*c divides d-b^2. * returns the number of classes of binary quadratic forms (a,b,c) * of discriminant d. * Also decides the solublity of x^2-d*y^2=-4. If the latter is not soluble. * We also have to count the reduced forms of the form (-a,b,-c). * See G.B. Mathews 'Theory of Numbers", pp 80-81. */ function reduce($d){ global $global_count; $class_number="0"; $initial_d=$d; $global_count="0"; $parity_flag="0"; $temp=bcsub($d,"1"); if(bcmod($temp,"4") != 0){ $e="2"; }else{ $e="1"; } print "representative reduced forms of discriminant $d
\n"; $f=bcsqrt($d); $g=bcdiv($f,"2"); for($a="1";bccomp($a,$f)<=0;$a=bcadd($a,"1")){ for($b=$e;bccomp($b,$f)<=0;$b=bcadd($b,"2")){ $temp=bcmul($b,$b); $h=bcsub($temp,$d); $i=bcmul("2",$a); $j=bcmul("4",$a); if(bcmod($h,$j)==0){ $temp=bcsub($f,$i); if((bccomp($a,$g)<=0 && bccomp($temp,$b)<0) || (bccomp($a,$g)>0 && bccomp($temp,$b)>=0)){ $r=bcdiv($h,$j); $k=gcd($a,$b); $temp=bcdiv($h,$j); $temp=abs($temp); $l=gcd($k,$temp); if(bccomp($l,"1")==0){ $temp=bcmul($b,$b); $temp=bcsub($d,$temp); $c=bcdiv($temp,$j); /* c > 0 here */ /*echo "(a,b,c)=($a,$b,$c)
\n";*/ $temp=bcmul("2",$c); $x=test($b,$temp); if(bccomp($x,"0")!=0){ $class_number=bcadd($class_number,"1"); $temp=bcmul("2",$c); $z=period($d,$b,$temp); $temp=bcmod($z,"2"); if(bccomp($temp,"0")!=0){ $parity_flag="1"; } print "[$class_number]: ($a,$b,$r)
\n"; } } } } } } if(bccomp($e,"2")==0){ $temp="4"; $d=$initial_d; }else{ $temp="1"; } if(bccomp($parity_flag,"0")!=0){ print "x2-$d*y2=-$temp has a solution
\n"; }else{ print "x2-$d*y2=-$temp has no solution
\n"; $class_number=bcmul("2",$class_number); print "There are reduced forms (-a,b,-c) as well
\n"; } print "h($initial_d) = $class_number"; return($class_number); } function reduce0($d){ global $global_count; global $global_sign; $initial_d=$d; $global_count="0"; $parity_flag="0"; $temp=bcsub($d,"1"); if(bcmod($temp,"4") != 0){ $e="2"; }else{ $e="1"; } $f=bcsqrt($d); $g=bcdiv($f,"2"); for($a="1";bccomp($a,$f)<=0;$a=bcadd($a,"1")){ for($b=$e;bccomp($b,$f)<=0;$b=bcadd($b,"2")){ $temp=bcmul($b,$b); $h=bcsub($temp,$d); $i=bcmul("2",$a); $j=bcmul("4",$a); if(bcmod($h,$j)==0){ $temp=bcsub($f,$i); if((bccomp($a,$g)<=0 && bccomp($temp,$b)<0) || (bccomp($a,$g)>0 && bccomp($temp,$b)>=0)){ $r=bcdiv($h,$j); $k=gcd($a,$b); $temp=bcdiv($h,$j); $temp=abs($temp); $l=gcd($k,$temp); if(bccomp($l,"1")==0){ $temp=bcmul($b,$b); $temp=bcsub($d,$temp); $c=bcdiv($temp,$j); /* c > 0 here */ /*echo "(a,b,c)=($a,$b,$c)
\n";*/ $temp=bcmul("2",$c); $x=test($b,$temp); if(bccomp($x,"0")!=0){ $class_number=bcadd($class_number,"1"); $temp=bcmul("2",$c); $z=period($d,$b,$temp); $temp=bcmod($z,"2"); if(bccomp($temp,"0")!=0){ $parity_flag="1"; } } } } } } } if(bccomp($e,"2")==0){ $temp="4"; $d=$initial_d; }else{ $temp="1"; } if(bccomp($parity_flag,"0")!=0){ /*print "x2-$d*y2=-$temp has a solution
\n";*/ $global_sign="1"; }else{ /*print "x2-$d*y2=-$temp has no solution
\n";*/ $class_number=bcmul("2",$class_number); $global_sign="-1"; } /*print "$initial_d $class_number";*/ /*if(eq($global_sign,"-1")){ print "+, "; }else{ print "-, "; }*/ return($class_number); } /* The following gives a table of h(d) for all discriminants d * in the range m<=d<=n<10^6. */ function table_qforms($m,$n){ global $global_sign; $count="0"; print "\n"; print "\n"; flush(); print "\n"; flush(); for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $r=mod($d,"4"); $t=bcsqrt($d); $temp=bcmul($t,$t); if(eq($temp,$d)){ continue; } if(ezero($r) || eq($r,"1")){ $count=bcadd($count,"1"); print ""; flush(); $rem=bcmod($count,"8"); if(ezero($rem)){ print "\n"; flush(); print ""; flush(); } } } print "\n
h(d) for indefinite quadratic forms of positive discriminant d, $m ≤ d ≤ $n
"; flush(); $h=reduce0($d); print "h($d)$h"; flush(); if(eq($global_sign,"1")){ print "- "; flush(); }else{ print "+ " ; flush(); } print "
\n"; flush(); return($count); } function fund_disc_test($d){ $s=mod($d,"4"); if(eq($s,"2") || eq($s,"3")){ return("0"); } $r=parity($d); if(eq($r,"1")){ $m=mu($d); if(ezero($m)){ return("0"); }else{ return("1"); } }else{ $r=bcmod($d,"4"); if(neqzero($r)){ return("0"); }else{ $D=bcdiv($d,4); $r=mod($D,"4"); if(eq($r,"1") || eq($r,"0")){ return("0"); } $m=mu($D); if(ezero($m)){ return("0"); }else{ return("1"); } } } } /* The following gives a table of h(d) for all fundamental discriminants d * in the range m<=d<=n<10^6. */ function table_qforms_fund($m,$n){ global $global_sign; $count="0"; print "\n"; flush(); print "\n"; flush(); print "\n"; flush(); for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $f=bcsqrt($d); $temp=bcmul($f,$f); if(eq($temp,$d)){ continue; } $t=fund_disc_test($d); if(ezero($t)){ continue; } $r=mod($d,"4"); if(ezero($r) || eq($r,"1")){ $count=bcadd($count,"1"); print ""; flush(); $rem=bcmod($count,"8"); if(ezero($rem)){ print "\n"; flush(); print ""; flush(); } } } print "\n
h(d) for indefinite quadratic forms of positive fundamental discriminant d, $m ≤ d ≤ $n
"; flush(); $h=reduce0($d); print "h($d)$h"; flush(); if(eq($global_sign,"1")){ print "- "; flush(); }else{ print "+ " ; flush(); } print "
\n"; flush(); return($count); } /* The following gives a table of h(d) for all odd fundamental discriminants d * in the range m<=d<=n<10^6. */ function table_qforms_fund_odd($m,$n){ global $global_sign; $count="0"; print "\n"; flush(); print "\n"; flush(); print "\n"; flush(); for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $r=parity($d); if(ezero($r)){ continue; } $f=bcsqrt($d); $temp=bcmul($f,$f); if(eq($temp,$d)){ continue; } $t=fund_disc_test($d); if(ezero($t)){ continue; } $r=mod($d,"4"); if(ezero($r) || eq($r,"1")){ $count=bcadd($count,"1"); print ""; flush(); $rem=bcmod($count,"8"); if(ezero($rem)){ print "\n"; flush(); print ""; flush(); } } } print "
h(d) for indefinite quadratic forms of positive odd fundamental discriminant d, $m ≤ d ≤ $n
"; flush(); $h=reduce0($d); print "h($d)$h"; flush(); if(eq($global_sign,"1")){ print "- "; flush(); }else{ print "+ " ; flush(); } print "
\n"; flush(); return($count); } /* The following gives a table of h(d) for all even fundamental discriminants d * in the range m<=d<=n<10^6. */ function table_qforms_fund_even($m,$n){ global $global_sign; $count="0"; print "\n"; flush(); print "\n"; flush(); print "\n"; flush(); for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $r=parity($d); if(eq($r,"1")){ continue; } $f=bcsqrt($d); $temp=bcmul($f,$f); if(eq($temp,$d)){ continue; } $t=fund_disc_test($d); if(ezero($t)){ continue; } $r=mod($d,"4"); if(ezero($r) || eq($r,"1")){ $count=bcadd($count,"1"); print ""; flush(); $rem=bcmod($count,"8"); if(ezero($rem)){ print "\n"; flush(); print ""; flush(); } } } print "\n
h(d) for indefinite quadratic forms of positive even fundamental discriminant d, $m ≤ d ≤ $n
"; flush(); $h=reduce0($d); print "h($d)$h"; flush(); if(eq($global_sign,"1")){ print "- "; flush(); }else{ print "+ " ; flush(); } print "
\n"; flush(); return($count); } ?> php/classnopos0.php0000644000175100017510000000151312747012605013622 0ustar keithkeith \n"; } else{ $d=$M1value; while("1"){ if(le($d,"1")){ print "d ≤ 1
\n"; break; } if(ge($d,"10000000000")){ print "d ≥ 10000000000
\n"; break; } $x=bcsqrt($d); $a=bcmul($x,$x); if(eq($a,$d)){ print "d is a perfect square
\n"; break; } $u=bcmod($d,"4"); if($u && neq($u,"1")){ print "d is not 0 or 1 (mod 4)
\n"; break; } $h=reduce($d); break; } } print "

\n"; print "Return to main page
\n"; ?> php/classnopos1_.php0000644000175100017510000000723412616301177013770 0ustar keithkeith1 and not a perfect square. */ /* * This is a function for finding the period of the continued fraction * expansion of reduced quadratic irrational a=(u+sqrt(d))/v. * Here d is non-square, 1<(u+sqrt(d))/v, -1<(u-sqrt(d))/v<0. * The algorithm also assumes that v divides d-u*u and is based on K. Rosen, * Elementary Number theory and its applications, p.379-381 and Knuth's The art * of computer programming, Vol. 2, p. 359. */ function period($d,$u,$v){ global $global_count; global $globalarray_a; global $globalarray_b; $f=bcsqrt($d); $s=$v; $r=$u; $k=$global_count; /* set initially to 0 below in reduce(d) */ for($j=$k;"1";$j=bcadd($j,"1")){ $temp=bcadd($f,$u); $a=bcdiv($temp,$v); $temp=bcmul($a,$v); $u=bcsub($temp,$u); $temp=bcmul($u,$u); $v=bcdiv(bcsub($d,$temp),$v); $globalarray_a[$j]=$u; $globalarray_b[$j]=$v; if(bccomp($u,$r)==0 && bccomp($v,$s)==0){ break; } } $temp1=bcsub($j,$k); $temp2=bcadd($global_count,$temp1); $global_count=bcadd("1",$temp2); return($global_count); } /* test(u,v) checks to see if (u,v) has already occurred in the * list globalarray_a[] && globalarray_b[]. */ function test($u,$v){ global $global_count; global $globalarray_a; global $globalarray_b; for($i="0";bccomp($i,$global_count)<0;$i=bcadd($i,"1")){ if(bccomp($u,$globalarray_a[$i])==0 && bccomp($v,$globalarray_b[$i])==0){ return("0"); } } return("1"); } /* reduce0(d) performs Lagrange's method on all reduced quadratic * irrationals (b+\sqrt(d))/2|c|, where 4*c divides d-b^2. * returns the number of classes of binary quadratic forms (a,b,c) * of discriminant d. * Also decides the solublity of x^2-d*y^2=-4. If the latter is not soluble. * We also have to count the reduced forms of the form (-a,b,-c). * See G.B. Mathews 'Theory of Numbers", pp 80-81. */ function reduce0($d){ global $global_count; $class_number="0"; $initial_d=$d; $global_count="0"; $parity_flag="0"; $temp=bcsub($d,"1"); if(bcmod($temp,"4") != 0){ $e="2"; }else{ $e="1"; } $f=bcsqrt($d); $g=bcdiv($f,"2"); for($a="1";bccomp($a,$f)<=0;$a=bcadd($a,"1")){ for($b=$e;bccomp($b,$f)<=0;$b=bcadd($b,"2")){ $temp=bcmul($b,$b); $h=bcsub($temp,$d); $i=bcmul("2",$a); $j=bcmul("4",$a); if(bcmod($h,$j)==0){ $temp=bcsub($f,$i); if((bccomp($a,$g)<=0 && bccomp($temp,$b)<0) || (bccomp($a,$g)>0 && bccomp($temp,$b)>=0)){ $r=bcdiv($h,$j); $k=gcd($a,$b); $temp=bcdiv($h,$j); $temp=abs($temp); $l=gcd($k,$temp); if(bccomp($l,"1")==0){ $temp=bcmul($b,$b); $temp=bcsub($d,$temp); $c=bcdiv($temp,$j); /* c > 0 here */ /*echo "(a,b,c)=($a,$b,$c)
\n";*/ $temp=bcmul("2",$c); $x=test($b,$temp); if(bccomp($x,"0")!=0){ $class_number=bcadd($class_number,"1"); $temp=bcmul("2",$c); $z=period($d,$b,$temp); $temp=bcmod($z,"2"); if(bccomp($temp,"0")!=0){ $parity_flag="1"; } } } } } } } if(bccomp($e,"2")==0){ $temp="4"; $d=$initial_d; }else{ $temp="1"; } if(bccomp($parity_flag,"0")!=0){ /*print "x2-$d*y2=-$temp has a solution
\n";*/ $sign="1"; }else{ /*print "x2-$d*y2=-$temp has no solution
\n";*/ $class_number=bcmul("2",$class_number); $sign="-1"; } print "h($initial_d) = $class_number"; if(eq($sign,"-1")){ print "+, "; }else{ print "-, "; } print "
\n"; return($class_number); } ?> php/classnopos.html0000644000175100017510000000316712240016600013711 0ustar keithkeith Finding the class number h(d) of a real quadratic field

Finding the class number h(d) of a real quadratic field

Here d > 1 is squarefree.
Here D is the field discriminant.
We locate all reduced irrationals of the form (b+√D)/(2|c|), where c is negative and 4c divides D-b2. We use the PQa continued fraction algorithm of Lagrange to break the set into disjoint cycles, retaining one number from each cycle. Each reduced number then gives rise to a reduced form (a,b,c) of discriminant D, where a=(b2-D)/(4c).
We are able to also determine if the Pell equation x2-Dy2=-4 has a solution, by using the fact that the equation is soluble iff at least one of the above cycles is odd.

(See note and Henri Cohen's A course in computational number theory, page 260, First Edition.)

Enter d (d > 1 and squarefree, d < 1010 ):

Last modified 13th May 2003
Return to main page php/classnopos_.php0000644000175100017510000001464512746527047013725 0ustar keithkeith0 and squarefree. */ include ("squarefree_test.php"); /* * This is a function for finding the period of the continued fraction * expansion of reduced quadratic irrational a=(u+sqrt(d))/v. * Here d is non-square, 1<(u+sqrt(d))/v, -1<(u-sqrt(d))/v<0. * The algorithm also assumes that v divides d-u*u and is based on K. Rosen, * Elementary Number theory and its applications, p.379-381 and Knuth's The art * of computer programming, Vol. 2, p. 359. */ function period($d,$u,$v){ global $global_count; global $globalarray_a; global $globalarray_b; $f=bcsqrt($d); $s=$v; $r=$u; $k=$global_count; /* set initially to 0 below in reduce(d) */ for($j=$k;"1";$j=bcadd($j,"1")){ $temp=bcadd($f,$u); $a=bcdiv($temp,$v); $temp=bcmul($a,$v); $u=bcsub($temp,$u); $temp=bcmul($u,$u); $v=bcdiv(bcsub($d,$temp),$v); $globalarray_a[$j]=$u; $globalarray_b[$j]=$v; if(bccomp($u,$r)==0 && bccomp($v,$s)==0){ break; } } $temp1=bcsub($j,$k); $cycle_length=bcadd("1",$temp1); $temp2=bcadd($global_count,$temp1); $global_count=bcadd($global_count,$cycle_length); return($cycle_length); } /* test(u,v) checks to see if (u,v) has already occurred in *the list globalarray_a[] && globalarray_b[]. */ function test($u,$v){ global $global_count; global $globalarray_a; global $globalarray_b; for($i="0";bccomp($i,$global_count)<0;$i=bcadd($i,"1")){ if(bccomp($u,$globalarray_a[$i])==0 && bccomp($v,$globalarray_b[$i])==0){ return("0"); } } return("1"); } /* reduce(d) performs Lagrange's method on all reduced quadratic * irrationals (b+\sqrt(D))/2|c|, where 4*c divides D-b^2. * Here d is squarefree and D is the discriminant of Q(sqrt(d)). * The class-number h(d) of the quadratic field is calculated. */ function reduce($d){ global $global_count; $class_number="0"; $initial_d=$d; $global_count="0"; $parity_flag="0"; /* creates a fundamental discriminant $D */ $temp=bcsub($d,"1"); if(bcmod($temp,"4") != 0){ $d=bcmul("4",$d); $e="2"; }else{ $e="1"; } print "reduced forms of discriminant $d corresponding to ideal classes
\n"; flush(); $f=bcsqrt($d); $g=bcdiv($f,"2"); for($a="1";bccomp($a,$f)<=0;$a=bcadd($a,"1")){ for($b=$e;bccomp($b,$f)<=0;$b=bcadd($b,"2")){ $temp=bcmul($b,$b); $h=bcsub($temp,$d); $i=bcmul("2",$a); $j=bcmul("4",$a); if(bcmod($h,$j)==0){ $temp=bcsub($f,$i); if((bccomp($a,$g)<=0 && bccomp($temp,$b)<0) || (bccomp($a,$g)>0 && bccomp($temp,$b)>=0)){ $r=bcdiv($h,$j); $k=gcd($a,$b); $temp=bcdiv($h,$j); $temp=abs($temp); $l=gcd($k,$temp); if(bccomp($l,"1")==0){ $temp=bcmul($b,$b); $temp=bcsub($d,$temp); $c=bcdiv($temp,$j); /* c > 0 here */ $temp=bcmul("2",$c); $x=test($b,$temp); if(bccomp($x,"0")!=0){ $class_number=bcadd($class_number,"1"); $temp=bcmul("2",$c); $z=period($d,$b,$temp); $temp=bcmod($z,"2"); if(bccomp($temp,"0")!=0){ $parity_flag="1"; } print "[$class_number]: ($a,$b,$r)
\n"; flush(); } } } } } } if(bccomp($e,"2")==0){ $temp="1"; $d=$initial_d; }else{ $temp="4"; } if(bccomp($parity_flag,"0")!=0){ print "x2-$d*y2=-$temp has a solution
\n"; flush(); }else{ print "x2-$d*y2=-$temp has no solution
\n"; flush(); } print "h($initial_d) = $class_number"; flush(); return($class_number); } /* reduce1(d) performs Lagrange's method on all reduced quadratic * irrationals (b+\sqrt(D))/2|c|, where 4*c divides D-b^2. * Here d is squarefree and D is the discriminant of Q(sqrt(d)). * The class-number h(d) of the quadratic field is calculated. * Forms are not printed. For use in table_qfields below. */ function reduce1($d){ global $global_count; global $global_norm; $initial_d=$d; $global_count="0"; $parity_flag="0"; /* creates a fundamental discriminant $D */ $temp=bcsub($d,"1"); if(bcmod($temp,"4") != 0){ $d=bcmul("4",$d); $e="2"; }else{ $e="1"; } $f=bcsqrt($d); $g=bcdiv($f,"2"); for($a="1";bccomp($a,$f)<=0;$a=bcadd($a,"1")){ for($b=$e;bccomp($b,$f)<=0;$b=bcadd($b,"2")){ $temp=bcmul($b,$b); $h=bcsub($temp,$d); $i=bcmul("2",$a); $j=bcmul("4",$a); if(bcmod($h,$j)==0){ $temp=bcsub($f,$i); if((bccomp($a,$g)<=0 && bccomp($temp,$b)<0) || (bccomp($a,$g)>0 && bccomp($temp,$b)>=0)){ $r=bcdiv($h,$j); $k=gcd($a,$b); $temp=bcdiv($h,$j); $temp=abs($temp); $l=gcd($k,$temp); if(bccomp($l,"1")==0){ $temp=bcmul($b,$b); $temp=bcsub($d,$temp); $c=bcdiv($temp,$j); /* c > 0 here */ $temp=bcmul("2",$c); $x=test($b,$temp); if(bccomp($x,"0")!=0){ $class_number=bcadd($class_number,"1"); $temp=bcmul("2",$c); $z=period($d,$b,$temp); $temp=bcmod($z,"2"); if(bccomp($temp,"0")!=0){ $parity_flag="1"; } } } } } } } if(bccomp($parity_flag,"0")!=0){ $global_norm= "-1"; }else{ $global_norm= "1"; } return($class_number); } /* The following gives a table of h(d) for all squarefree d * in the range m<=d<=n<10^6. */ function table_qfields($m,$n){ global $global_norm; $count="0"; print "\n"; print "\n"; flush(); print ""; for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $t=squarefree_test($d); if(bccomp($t,"0")==0){ continue; }else{ $count=bcadd($count,"1"); print ""; } $r=bcmod($count,"10"); if(ezero($r)){ print ""; print ""; } } print "
Class numbers h(d) for real quadratic fields ℚ(√d), $m ≤ d ≤ $n
"; $h=reduce1($d); print "h($d)$h"; flush(); if(eq($global_norm,"1")){ print "+, "; }else{ print "-, " ; } print "
\n"; return($count); } ?> php/classnopos.php0000644000175100017510000000134012746526647013557 0ustar keithkeith \n"; } else{ $d=$M1value; while("1"){ if(le($d,"1")){ print "d <= 1
\n"; break; } if(ge($d,"10000000000")){ print "d >= 10000000000
\n"; break; } $w=squarefree_test($d); if(ezero($w)){ print "d is not squarefree
\n"; break; } $h=reduce($d); break; } } print "

\n"; print "Return to main page
\n"; ?> php/classnopos_.php.orig0000644000175100017510000001336311613025716014644 0ustar keithkeith0 and squarefree. */ include ("squarefree_test.php"); /* * This is a function for finding the period of the continued fraction * expansion of reduced quadratic irrational a=(u+sqrt(d))/v. * Here d is non-square, 1<(u+sqrt(d))/v, -1<(u-sqrt(d))/v<0. * The algorithm also assumes that v divides d-u*u and is based on K. Rosen, * Elementary Number theory and its applications, p.379-381 and Knuth's The art * of computer programming, Vol. 2, p. 359. */ function period($d,$u,$v){ global $global_count; global $globalarray_a; global $globalarray_b; $f=bcsqrt($d); $s=$v; $r=$u; $k=$global_count; /* set initially to 0 below in reduce(d) */ for($j=$k;"1";$j=bcadd($j,"1")){ $temp=bcadd($f,$u); $a=bcdiv($temp,$v); $temp=bcmul($a,$v); $u=bcsub($temp,$u); $temp=bcmul($u,$u); $v=bcdiv(bcsub($d,$temp),$v); $globalarray_a[$j]=$u; $globalarray_b[$j]=$v; if(bccomp($u,$r)==0 && bccomp($v,$s)==0){ break; } } $temp1=bcsub($j,$k); $cycle_length=bcadd("1",$temp1); $temp2=bcadd($global_count,$temp1); $global_count=bcadd($global_count,$cycle_length); return($cycle_length); } /* test(u,v) checks to see if (u,v) has already occurred in *the list globalarray_a[] && globalarray_b[]. */ function test($u,$v){ global $global_count; global $globalarray_a; global $globalarray_b; for($i="0";bccomp($i,$global_count)<0;$i=bcadd($i,"1")){ if(bccomp($u,$globalarray_a[$i])==0 && bccomp($v,$globalarray_b[$i])==0){ return("0"); } } return("1"); } /* reduce(d) performs Lagrange's method on all reduced quadratic * irrationals (b+\sqrt(D))/2|c|, where 4*c divides D-b^2. * Here d is squarefree and D is the discriminant of Q(sqrt(d)). * The class-number h(d) of the quadratic field is calculated. */ function reduce($d){ global $global_count; $initial_d=$d; $global_count="0"; $parity_flag="0"; /* creates a fundamental discriminant $D */ $temp=bcsub($d,"1"); if(bcmod($temp,"4") != 0){ $d=bcmul("4",$d); $e="2"; }else{ $e="1"; } print "reduced forms of discriminant $d corresponding to ideal classes
\n"; flush(); $f=bcsqrt($d); $g=bcdiv($f,"2"); for($a="1";bccomp($a,$f)<=0;$a=bcadd($a,"1")){ for($b=$e;bccomp($b,$f)<=0;$b=bcadd($b,"2")){ $temp=bcmul($b,$b); $h=bcsub($temp,$d); $i=bcmul("2",$a); $j=bcmul("4",$a); if(bcmod($h,$j)==0){ $temp=bcsub($f,$i); if((bccomp($a,$g)<=0 && bccomp($temp,$b)<0) || (bccomp($a,$g)>0 && bccomp($temp,$b)>=0)){ $r=bcdiv($h,$j); $k=gcd($a,$b); $temp=bcdiv($h,$j); $temp=abs($temp); $l=gcd($k,$temp); if(bccomp($l,"1")==0){ $temp=bcmul($b,$b); $temp=bcsub($d,$temp); $c=bcdiv($temp,$j); /* c > 0 here */ $temp=bcmul("2",$c); $x=test($b,$temp); if(bccomp($x,"0")!=0){ $class_number=bcadd($class_number,"1"); $temp=bcmul("2",$c); $z=period($d,$b,$temp); $temp=bcmod($z,"2"); if(bccomp($temp,"0")!=0){ $parity_flag="1"; } print "[$class_number]: ($a,$b,$r)
\n"; flush(); } } } } } } if(bccomp($e,"2")==0){ $temp="1"; $d=$initial_d; }else{ $temp="4"; } if(bccomp($parity_flag,"0")!=0){ print "x2-$d*y2=-$temp has a solution
\n"; flush(); }else{ print "x2-$d*y2=-$temp has no solution
\n"; flush(); } print "h($initial_d) = $class_number"; flush(); return($class_number); } /* reduce1(d) performs Lagrange's method on all reduced quadratic * irrationals (b+\sqrt(D))/2|c|, where 4*c divides D-b^2. * Here d is squarefree and D is the discriminant of Q(sqrt(d)). * The class-number h(d) of the quadratic field is calculated. * Forms are not printed. For use in table(m,n) below. */ function reduce1($d){ global $global_count; $initial_d=$d; $global_count="0"; $parity_flag="0"; /* creates a fundamental discriminant $D */ $temp=bcsub($d,"1"); if(bcmod($temp,"4") != 0){ $d=bcmul("4",$d); $e="2"; }else{ $e="1"; } $f=bcsqrt($d); $g=bcdiv($f,"2"); for($a="1";bccomp($a,$f)<=0;$a=bcadd($a,"1")){ for($b=$e;bccomp($b,$f)<=0;$b=bcadd($b,"2")){ $temp=bcmul($b,$b); $h=bcsub($temp,$d); $i=bcmul("2",$a); $j=bcmul("4",$a); if(bcmod($h,$j)==0){ $temp=bcsub($f,$i); if((bccomp($a,$g)<=0 && bccomp($temp,$b)<0) || (bccomp($a,$g)>0 && bccomp($temp,$b)>=0)){ $r=bcdiv($h,$j); $k=gcd($a,$b); $temp=bcdiv($h,$j); $temp=abs($temp); $l=gcd($k,$temp); if(bccomp($l,"1")==0){ $temp=bcmul($b,$b); $temp=bcsub($d,$temp); $c=bcdiv($temp,$j); /* c > 0 here */ $temp=bcmul("2",$c); $x=test($b,$temp); if(bccomp($x,"0")!=0){ $class_number=bcadd($class_number,"1"); $temp=bcmul("2",$c); $z=period($d,$b,$temp); $temp=bcmod($z,"2"); if(bccomp($temp,"0")!=0){ $parity_flag="1"; } } } } } } } if(bccomp($parity_flag,"0")!=0){ $norm= "-1"; }else{ $norm= "1"; } print "h($initial_d)=$class_number"; if(eq($norm,"-1")){ print "-, "; }else{ print "+, "; } flush(); return; } /* The following gives a table of h(d) for all squarefree d i * in the range m<=d<=n<10^6. */ function table_qfields($m,$n){ $count="0"; for($d=$m;bccomp($d,$n)<=0;$d=bcadd($d,"1")){ $h=squarefree_test($d); if(bccomp($h,"0")==0){ continue; }else{ $count=bcadd($count,"1"); $t=reduce1($d); } $r=bcmod($count,"10"); if(ezero($r)){ print "
\n"; } } return($count); } ?> php/classnopostable.html0000644000175100017510000000331211625276360014732 0ustar keithkeith Calculating the class number h(d) for real quadratic fields

Calculating the class number h(d) for real quadratic fields Q(√d)

h(d) is listed for all squarefree d in the range m ≤ d ≤ n, where m < 106.
Here D is the field discriminant.
We locate all reduced irrationals of the form (b+√D)/(2|c|), where c is negative and 4c divides D-b2. We use the PQa continued fraction algorithm of Lagrange to break the set into disjoint cycles, retaining one number from each cycle. Each reduced number then gives rise to a reduced form (a,b,c) of discriminant D, where a=(b2-D)/(4c).
We are able to also determine if the Pell equation x2-Dy2=-4 has a solution, by using the fact that the equation is soluble iff at least one of the above cycles is odd.

(See note and Henri Cohen p. 260, A course in computational number theory, First Edition.)

Enter m (1 ≤ m < 106 ):
Enter n (1 ≤ m < n < 106 ):

Last modified 30th January 2005
Return to main page php/classnopostable.php0000644000175100017510000000166212747012720014555 0ustar keithkeith \n"; } else{ $m=$M1value; $n=$M2value; while("1"){ $limit=bcpow("10","6"); if(bccomp($m,$n)>0){ print "m > n
\n"; flush(); break; } if(bccomp($n,$limit)>=0){ print "n >= $limit
\n"; flush(); break; } if(bccomp($m,"1")<=0 || bccomp($n,"1")<=0){ print "m or n <= 1
\n"; flush(); break; } table_qfields($m,$n); flush(); break; } } print "

\n"; print "Return to main page
\n"; ?> php/classnopostable_qfields.html0000644000175100017510000000360512331267350016440 0ustar keithkeith Calculating the class number h(d) for real quadratic fields

Calculating the class number h(d) for real quadratic fields Q(√d)

h(d) is listed for all squarefree d in the range m ≤ d ≤ n, where n < 106.
Here D is the field discriminant.
We locate all reduced irrationals of the form (b+√D)/(2|c|), where c is negative and 4c divides D-b2. We use the PQa continued fraction algorithm of Lagrange to break the set into disjoint cycles, retaining one number from each cycle. Each reduced number then gives rise to a reduced form (a,b,c) of discriminant D, where a=(b2-D)/(4c).
We are able to also determine if the Pell equation x2-Dy2=-4 has a solution, by using the fact that the equation is soluble iff at least one of the above cycles is odd.

We write the output as h(d)- or h(d)+, according as the negative Pell equation is, or is not, soluble.

(See note and Henri Cohen p. 260, A course in computational number theory, First Edition.)

Enter m (1 ≤ m < 106 ):
Enter n (1 ≤ m ≤ n < 106 ):

Last modified 18th July 2011
Return to main page php/classnopostable_qfields.php0000644000175100017510000000230312747013035016255 0ustar keithkeith \n"; } else{ $m=$M1value; $n=$M2value; while("1"){ $limit=bcpow("10","6"); if(bccomp($m,$n)>0){ print "m > n
\n"; flush(); break; } if(bccomp($n,$limit)>=0){ print "n >= $limit
\n"; flush(); break; } if(bccomp($m,"1")<=0 || bccomp($n,"1")<=0){ print "m or n <= 1
\n"; flush(); break; } $count=table_qfields($m,$n); if(eq($count,"1")){ print "
\n There is one squarefree d in the range [$m,$n]
\n"; }else{ print "
\n There are $count squarefree d in the range [$m,$n]
\n"; } flush(); break; } } print "

\n"; print "Return to main page
\n"; ?> php/classnopostable_qforms.html0000644000175100017510000000443512357354071016327 0ustar keithkeith Calculating the class number h(d) for binary quadratic forms of positive discriminant d

Calculating the class number h(d) for binary quadratic forms of positive discriminant d

h(d) is listed for all discriminants d in the range m ≤ d ≤ n, where m < 106.
We locate all reduced irrationals of the form (b+√d)/(2|c|), where c is negative and 4c divides d-b2. We use the PQa continued fraction algorithm of Lagrange to break the set into disjoint cycles, retaining one number from each cycle. Each reduced number then gives rise to a reduced form (a,b,c) of discriminant d, where a=(b2-d)/(4c).
We are able to also determine if the Pell equation x2-dy2=-4 has a solution, by using the fact that the equation is soluble iff at least one of the above cycles is odd.

We write the output as h(d)- or h(d)+, according as the negative Pell equation is, or is not, soluble.

(See note and Henri Cohen p. 260, A course in computational number theory, First Edition.)

Also see tables generated via this page.

Enter m (1 ≤ m < 1010 ):
Enter n (1 ≤ m ≤ n < 1010 ):

All discriminants
fundamental discriminants
odd fundamental discriminants
even fundamental discriminants

Last modified 10 July 2014
Return to main page php/classnopostable_qforms.php0000644000175100017510000000317712747013145016151 0ustar keithkeith \n"; } else{ $m=$M1value; $n=$M2value; while("1"){ $limit=bcpow("10","10"); if(bccomp($m,$n)>0){ print "m > n
\n"; flush(); break; } if(bccomp($n,$limit)>=0){ print "n >= $limit
\n"; flush(); break; } if(bccomp($m,"1")<=0 || bccomp($n,"1")<=0){ print "m or n <= 1
\n"; flush(); break; } $mapping=$_POST['mapping']; /*printf("value of mapping %s\n",$mapping);*/ if($mapping=="0"){ $count=table_qforms($m,$n); } if($mapping=="1"){ $count=table_qforms_fund($m,$n); } if($mapping=="2"){ $count=table_qforms_fund_odd($m,$n); } if($mapping=="3"){ $count=table_qforms_fund_even($m,$n); } if(eq($count,"1")){ print "
\n There is one discriminant in the range [$m,$n]
\n"; }else{ print "
\n There are $count discriminants in the range [$m,$n]
\n"; } flush(); break; } } print "

\n"; print "Return to main page
\n"; ?> php/cloitre1.php0000644000175100017510000000052011612426667013104 0ustar keithkeith \n"; } else { cloitre1($Mvalue); } print "

\n"; print "Return to main page
\n"; ?> php/cloitre.html0000644000175100017510000001476213763563062013215 0ustar keithkeith Some examples of generalized 3x+1 mappings of Benoit Cloitre

Some examples of generalized 3x+1 mappings of Benoit Cloitre

Mapping T1

The iterates y, T1(y), T1(T1(y)),... of the function

are printed and the number of steps taken to reach one of the integers 0, -1, -4, -19 is recorded.

Benoit Cloitre in an email to Jeff Lagarias dated July 19, 2011, has conjectured that every trajectory starting from a positive integer will eventually reach 0.
It is also clear experimentally that any trajectory starting from a negative integer will eventually reach one of three cycles beginning with -1, -4 or -19.

Cycles: (i) 0,0; (ii) -1,-2,-1; (iii) -4,-17,-6,-4; (iv) -19,-92,-31,-152,-51,-34,-167,-56,-19.

Heuristics: Visit Generalized 3x+1 functions and Markov matrices, where we find, with d = 3 and m0=2, m1 = 1, m2 = 15 and x0=0, x1 = 0, x2 = 3,

    Q(3) = 1/3  1/3 1/3
           1/3  1/3 1/3
            0    1   0
has stationary vector (1/4, 1/2, 1/4). Also

(2/3)1/4(1/3)1/2(15/3)1/4 < 1.

Consequently we expect all trajectories to eventually cycle.


Mapping T2

.

Benoit Cloitre in an email to Jeff Lagarias dated July 20, 2011, has conjectured that every trajectory starting from a positive integer will eventually reach 0 or 2.
It is also clear experimentally that any trajectory starting from a negative integer will eventually reach -1.

Cycles: (i) 0,0; (ii) 2,7,2: (iii) -1,-1.

Heuristics: This function can be regarded as a six-branched mapping. Accordingly, visit Generalized 3x+1 functions and Markov matrices, where we find,
with d = 6 and m0 = 21, m1 = 2, m2 = 21, m3 = 2, m4 = 21, m5 = 2 and x0 = 0 = x1 = x2 = x3 = x4 = x5, that

Q(6) =
   1/2 	 0    0   1/2 	0    0
   1/3 	 0   1/3   0   1/3   0
    0 	1/2   0    0   1/2   0
    0 	1/3   0   1/3 	0   1/3
    0 	 0   1/2   0 	0   1/2
    0 	1/3   0   1/3 	0   1/3 
This Markov matrix has stationary vector (2/15,3/15,2/15,3/15,2/15,3/15) and the weighted product (21/6)2/15(2/6)3/15 ··· is less than 1, and this allows us to predict that all trajectories will eventually cycle.

Mapping T3

.

For this mapping, Benoit Cloitre has conjectured that every trajectory starting from a positive integer will eventually reach 0, 4, 6 or 24.
It is also clear experimentally that any trajectory starting from a negative integer will eventually reach -1.

Cycles: (i) 0,0; (ii) 4,13,4: (iii) 6,19,6 (iv) 24, 78,...,73,24 (length 87) (v) -1,-1.

Heuristics: This function can be regarded as a twelve-branched mapping and an analysis of the 12x12 Markov matrix Q(12) suggests that all trajectories will eventually cycle.


Mapping Fm

First fm(x) is defined by

.

Then

.

For m = 3, 5 and m ≥ 7, Benoit Cloitre conjectures that the trajectories of Fm will eventually enter one of finitely many cycles.
This mapping can be regarded as a 2m-branched generalized 3x+1 mapping if m is even, and an m-branched mapping if m is odd. See the BC program cloitrem in which function(m) prints Fm(x) in two ways. For example,

Here all trajectories appear to enter one of six cycles (i) 0,0 (ii) -1,-1 (iii) 1,2,1 (iv) -2,-3,-4,-2 (v) -5,-10,-7 (vi) 19,38,25,50,33,22,44,29,19.

We can use the Markov matrix approach of generalized 3x+1 functions to predict the behaviour of trajectories. See manuscript.

We find for example, with m = 3, m0=2, m1 = 6, m2 = 2 and x0 = 0= x1 = x2,

    Q(3) = 1/3  1/3 1/3
            0    0   1
           1/3  1/3 1/3
which has stationary vector (1/4, 1/4, 1/2). Also

(2/3)1/4(6/3)1/4(2/3)1/2 < 1.

Consequently we expect all trajectories to eventually cycle.

A list of cycles found for 2 ≤ m ≤ 2000 is also attached.
The examples of F29 and F153 are striking, as there are apparently 165 and 416 cycles, respectively.


Enter y:

Mapping T1
Mapping T2
Mapping T3
Mapping F3
Mapping F29

Last modified 8th December 2020
Return to main page php/cloitre_.php0000644000175100017510000002535111620342377013165 0ustar keithkeith="0";$i=bcadd($i,"1")){ print "i=$i: $x\n
"; if(bccomp($x,"0")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 0 is $i\n
"; flush(); return; } if(bccomp($x,"-1")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -1 is $i\n
"; flush(); return; } if(bccomp($x,"-4")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -4 is $i\n
"; flush(); return; } if(bccomp($x,"-19")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -19 is $i\n
"; flush(); return; } $x=t1($x); flush(); } } /*if cloitre2(y) is typed in, the iterates * y, t2(y), t2(t2(y)),... of the Benoit Cloitre function t2(x) are printed * and the number of steps taken to reach one of 0, -1, -4, -19 * is recorded. Benoit Cloitre conjectured in an email to Jeff Lagarias * dated July 20, 2011, that every trajectory starting from * a positive integer will eventually reach 0. * Experimentally it is certain that any trajectory starting from a * negative integer will evevntually reach one of -1, -4 or -19. */ function t2($x){ $r=mod($x,"2"); if(ezero($r)){ $temp=bcmul("7",$x); $temp=bcdiv($temp,"2"); return($temp); }else{ $temp=int($x,"3"); return($temp); } } function cloitre2($y){ flush(); $x=$y; for($i="0";$i>="0";$i=bcadd($i,"1")){ print "i=$i: $x\n
"; if(bccomp($x,"0")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 0 is $i\n
"; flush(); return; } if(bccomp($x,"-1")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -1 is $i\n
"; flush(); return; } if(bccomp($x,"2")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 2 is $i\n
"; flush(); return; } $x=t2($x); flush(); } } /*if cloitre3(y) is typed in, the iterates * y, t3(y), t3(t3(y)),... of the Benoit Cloitre function t3(x) are printed * and the number of steps taken to reach one of 0, -1, -4, -19 * is recorded. Benoit Cloitre conjectured in an email to Jeff Lagarias * dated July 20, 2011, that every trajectory starting from * a positive integer will eventually reach 0, 4, 6, or 24. * Experimentally it is certain that any trajectory starting from a * negative integer will eventually reach -1. */ function t3($x){ $r=mod($x,"2"); if(ezero($r)){ $temp=bcmul("13",$x); $temp=int($temp,"4"); return($temp); }else{ $temp=int($x,"3"); return($temp); } } function cloitre3($y){ flush(); $x=$y; for($i="0";$i>="0";$i=bcadd($i,"1")){ print "i=$i: $x\n
"; if(bccomp($x,"0")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 0 is $i\n
"; flush(); return; } if(bccomp($x,"-1")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -1 is $i\n
"; flush(); return; } if(bccomp($x,"6")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 6 is $i\n
"; flush(); return; } if(bccomp($x,"4")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 4 is $i\n
"; flush(); return; } if(bccomp($x,"24")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 24 is $i\n
"; flush(); return; } $x=t3($x); flush(); } } /*if f_3(y) is typed in, the iterates * y, f_3(y), f_3(f_3(y)),... of the Benoit Cloitre function f_3(x) are printed * and the number of steps taken to reach one of 0, 1, 19, -1, -2, -5 * is recorded. */ function f_3($x){ $r=mod($x,"6"); if(ezero($r) || eq($r,"3")){ $temp=bcmul("4",$x); $temp=bcdiv($temp,"6"); return($temp); } if(eq($r,"1") || eq($r,"4")){ $temp=bcmul("2",$x); return($temp); } if(eq($r,"2") || eq($r,"5")){ $temp=bcmul("4",$x); $temp=bcsub($temp,"2"); $temp=bcdiv($temp,"6"); return($temp); } } function cloitre_f_3($y){ flush(); $x=$y; for($i="0";$i>="0";$i=bcadd($i,"1")){ $r=mod($x,"6"); if(eq($r,"1") || eq($r,"4")){ print "i=$i: $x\n
"; }else{ print "i=$i: $x\n
"; } if(bccomp($x,"0")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 0 is $i\n
"; flush(); return; } if(bccomp($x,"-1")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -1 is $i\n
"; flush(); return; } if(bccomp($x,"1")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 1 is $i\n
"; flush(); return; } if(bccomp($x,"19")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach 19 is $i\n
"; flush(); return; } if(bccomp($x,"-2")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -2 is $i\n
"; flush(); return; } if(bccomp($x,"-5")==0){ print "starting number = $y\n
"; flush(); print "the number of iterations taken to reach -5 is $i\n
"; flush(); return; } $x=f_3($x); flush(); } } /* Testing F_29 and its 165 cycles. * if cloitre29(y) is typed in, the iterates * y, f29(y), f29(f29(y)),... of Benoit Cloite's function f29(x) are printed * and the number of steps taken to reach one of 163 cycles * is recorded. (It is conjectured that every trajectory starting * from an integer will end in one of these numbers.) */ /* the function f29 */ function f29($x){ $t=bcmul("30",$x); $f=int($t,"29"); $g=mod($f,"2"); if(neqzero($g)){ $f=bcmul("3",$f); $f=bcadd($f,"1"); } $t=bcdiv($f,"2"); return($t); } function cloitre29($x){ $y=$x; for($i="0";gezero($i);$i=bcadd($i,"1")){ print "$i: $y
\n"; if(eq($y,"0")||eq($y,"-1")||eq($y,"1")||eq($y,"-7")||eq($y,"63")||eq($y,"-667")||eq($y,"-84")||eq($y,"94")||eq($y,"-397")||eq($y,"150")||eq($y,"-1729")||eq($y,"210")|| eq($y,"-1990")||eq($y,"-745")||eq($y,"-252")||eq($y,"-260")||eq($y,"-2581")||eq($y,"-312")|| eq($y,"-2842")||eq($y,"-2965")||eq($y,"-347")||eq($y,"-3163")||eq($y,"-1063")||eq($y,"-1070")|| eq($y,"378")||eq($y,"-1186")||eq($y,"-1249")||eq($y,"-1408")||eq($y,"-4288")||eq($y,"-1504")|| eq($y,"-515")||eq($y,"1628")||eq($y,"-1672")||eq($y,"-575")||eq($y,"-596")||eq($y,"-5611")|| eq($y,"-5643")||eq($y,"-1903")||eq($y,"-1933")||eq($y,"-5956")||eq($y,"-666")||eq($y,"-2008")|| eq($y,"-18445")||eq($y,"-6337")||eq($y,"-2125")||eq($y,"-2143")||eq($y,"-2195")||eq($y,"-743")|| eq($y,"-747")||eq($y,"-2269")||eq($y,"-2311")||eq($y,"-2322")||eq($y,"-809")||eq($y,"-7594")|| eq($y,"-2606")||eq($y,"-876")||eq($y,"-894")||eq($y,"-2797")||eq($y,"-946")||eq($y,"-971")|| eq($y,"-2994")||eq($y,"-9019")||eq($y,"-1041")||eq($y,"-1062")||eq($y,"-1068")||eq($y,"-1079")|| eq($y,"-9769")||eq($y,"-9871")||eq($y,"-1101")||eq($y,"-3319")||eq($y,"-1118")||eq($y,"-1124")|| eq($y,"-3447")||eq($y,"-1157")||eq($y,"-1188")||eq($y,"-1230")||eq($y,"-3731")||eq($y,"-3772")|| eq($y,"-11389")||eq($y,"-1296")||eq($y,"-3922")||eq($y,"-4015")||eq($y,"-1377")||eq($y,"-4172")|| eq($y,"-1394")||eq($y,"-4212")||eq($y,"-4246")||eq($y,"-1433")||eq($y,"-1443")||eq($y,"-1454")|| eq($y,"-13144")||eq($y,"-1464")||eq($y,"-1472")||eq($y,"-1478")||eq($y,"-4456")||eq($y,"-1499")|| eq($y,"-1503")||eq($y,"-1524")||eq($y,"-4624")||eq($y,"-4717")||eq($y,"-1601")||eq($y,"-4834")|| eq($y,"-4867")||eq($y,"-1646")||eq($y,"-1661")||eq($y,"-1671")||eq($y,"-5065")||eq($y,"-1692")|| eq($y,"-1700")||eq($y,"-5113")||eq($y,"-5140")||eq($y,"-1731")||eq($y,"-1756")||eq($y,"-5337")|| eq($y,"-1787")||eq($y,"-5390")||eq($y,"-1808")||eq($y,"-1818")||eq($y,"-5506")||eq($y,"-1860")|| eq($y,"-5674")||eq($y,"-5686")||eq($y,"-5778")||eq($y,"-1934")||eq($y,"-1955")||eq($y,"-1965")|| eq($y,"-1976")||eq($y,"-5947")||eq($y,"-2015")||eq($y,"-2036")||eq($y,"-6130")||eq($y,"-2063")|| eq($y,"-2094")||eq($y,"-2102")||eq($y,"-6445")||eq($y,"-2154")||eq($y,"-2183")||eq($y,"-2235")|| eq($y,"-2253")||eq($y,"-2313")||eq($y,"-2375")||eq($y,"-2417")||eq($y,"-2477")||eq($y,"-7576")|| eq($y,"-2564")||eq($y,"-2589")||eq($y,"-2711")||eq($y,"-8530")||eq($y,"-8605")||eq($y,"-2873")|| eq($y,"-2879")||eq($y,"-2883")||eq($y,"-2904")||eq($y,"-2912")||eq($y,"-2918")||eq($y,"-2943")|| eq($y,"-2960")||eq($y,"-9154")||eq($y,"-9322")||eq($y,"-3216")||eq($y,"-3241")||eq($y,"-3366")|| eq($y,"-3776")||eq($y,"-3888")||eq($y,"-5311")){ print "starting number $x
\n"; print "the number of iterations taken to reach $y is $i
\n"; return; } $y=f29($y); } } ?> php/cloitre.php0000644000175100017510000000154012747114441013020 0ustar keithkeith \n"; } else { if(isset($_POST['mapping'])){ $mapping=$_POST['mapping']; }else{ return; } /*printf("value of mapping %s\n",$mapping);*/ if($mapping=="1"){ cloitre1($Mvalue); } if($mapping=="2"){ cloitre2($Mvalue); } if($mapping=="3"){ cloitre3($Mvalue); } if($mapping=="4"){ cloitre_f_3($Mvalue); } if($mapping=="5"){ cloitre29($Mvalue); } } print "

\n"; print "Return to main page
\n"; ?> php/closest_lattice_points.html0000644000175100017510000000332211654101603016301 0ustar keithkeith Finding the closest lattice points to a given point

Finding the closest lattice points to a given point

A is an m × n matrix of integers, whose first row is nonzero and with at least two rows.
ℒ is the lattice in ℤn spanned by the first m-1 rows of A.

The LLL parameter alpha = m1/n1 has to satisfy 1/4 < α ≤ 1, but here we use a default value 1/1.
The matrix A can be entered either (i) as a string of mn integers separated by spaces, or
(ii) cut and pasted from a text file, with entries separated by spaces and each row ended by a newline.

    Enter m1(1 ≤ m1 ≤ 1000):
    Enter n1(1 ≤ m1 ≤ n1 ≤ 1000):
    Enter m(≤ 25):
    Enter n(≤ 25):

    Enter the m × n matrix entries :

Last modified 2nd November 2011
Return to main page php/closest_lattice_points_.php0000644000175100017510000002212411654101646016273 0ustar keithkeith\n"; $nplus1=bcadd($n,"1"); //for($j="1";le($j,$n);$j=bcadd($j,"1")){ // $Am[$j]=$A[$m][$j]; //} print "P = A[$m] = ";printarray($A[$m],$n);print "
\n"; // $lengthj=dotproduct($Am,$Am,$m); $mplus1=$m; $mminus1=bcsub($m,"1"); if(gt($mminus1,"1")){ print "ℒ is the lattice spanned by the first $mminus1 rows of A
\n"; }else{ print "ℒ is the lattice spanned by the first row of A
\n"; } for($i="1";le($i,$mminus1);$i=bcadd($i,"1")){ // AA consists of the first m-1 rows of A for($j="1";le($j,$n);$j=bcadd($j,"1")){ $AA[$i][$j]=$A[$i][$j]; } } $G=gram($A,$m,$n); $lengthj=$G[$m][$m]; cholesky($G,$m); $Qnum=$choleskynum; $Qden=$choleskyden; $QQnum=transpose($snum,$m,$m); $QQden=transpose($sden,$m,$m); $m=bcsub($m,"1"); for($i="1";le($i,$m);$i=bcadd($i,"1")){// the N vector $Nnum[$i]=$Qnum[$i][$mplus1]; $Nden[$i]=$Qden[$i][$mplus1]; } $Cnum="0"; $Cden="1"; for($i="1";le($i,$m);$i=bcadd($i,"1")){ multr($Nnum[$i],$Nden[$i],$Nnum[$i],$Nden[$i]); multr($multnum,$multden,$Qnum[$i][$i],$Qden[$i][$i]); addr($Cnum,$Cden,$multnum,$multden); $Cnum=$addnum; $Cden=$addden; } $i=$m; $Tnum[$m]=$Cnum; $Tden[$m]=$Cden; $Unum[$m]="0"; $Uden[$m]="1"; while(1){ ratior($Tnum[$i],$Tden[$i],$Qnum[$i][$i],$Qden[$i][$i]); $Znum=$rationum; $Zden=$ratioden; subr($Nnum[$i],$Nden[$i],$Unum[$i],$Uden[$i]); $UB[$i]=introot($Znum,$Zden,$subnum,$subden); subr($Unum[$i],$Uden[$i],$Nnum[$i],$Nden[$i]); $temp2=introot($Znum,$Zden,$subnum,$subden); $temp3=bcminus($temp2); $x[$i]=bcsub($temp3,"1"); while("1"){ $x[$i]=bcadd($x[$i],"1"); if(le($x[$i],$UB[$i])){ if(eq($i,"1")){ //$s=printlc($A,$x,$m); lcasvector($AA,$x,$m,$n); $count=bcadd($count,"1"); // print "X[$count]=";printarray($x,$m); $lcva[$count]=$lcv; // print "lcv[$count]=";printarray($lcv,$n); // print "
\n"; $coord[$count]=$x; for($k="1";le($k,$n);$k=bcadd($k,"1")){ $temp=$A[$mplus1][$k]; $multiplier_vector[$count][$k]=bcsub($temp,$lcv[$k]); } $l=lengthsquared($multiplier_vector[$count],$n); $multiplier_vector[$count][$nplus1]=$l; // print "P-X[$count]=";printarray($multiplier_vector[$count],$n);print": $l
\n"; $lengtharray[$count]=$l; continue; }else{ $i=bcsub($i,"1"); // now update $U[$i]; $sumnum="0"; $sumden="1"; $iplus1=bcadd($i,"1"); for($j=$iplus1;le($j,$m);$j=bcadd($j,"1")){ multr($Qnum[$i][$j],$Qden[$i][$j],$x[$j],"1"); addr($sumnum,$sumden,$multnum,$multden); $sumnum=$addnum; $sumden=$addden; } $Unum[$i]=$sumnum; $Uden[$i]=$sumden; // now update $T[$i]; addr($x[$iplus1],"1",$Unum[$iplus1],$Uden[$iplus1]); subr($addnum,$addden,$Nnum[$iplus1],$Nden[$iplus1]); multr($subnum,$subden,$subnum,$subden); multr($Qnum[$iplus1][$iplus1],$Qden[$iplus1][$iplus1],$multnum,$multden); subr($Tnum[$iplus1],$Tden[$iplus1],$multnum,$multden); $Tnum[$i]=$subnum; $Tden[$i]=$subden; break; } }else{ $i=bcadd($i,"1"); if(gt($i,$m)){ echo "Here are the X[k] ∈ ℒ, P - X[k], ||P-X[k]||2 such that ||P-X[k]||2 ≤ $lengthj
\n"; print "\n"; for($k="1";le($k,$count);$k=bcadd($k,"1")){ print ""; // print ""; print ""; print ""; print ""; print "\n"; } print "
"; // minusa($coord[$k],$m); // $s=printlc($AA,$coord[$k],$m); // if(ezero($s)){ // print "b[$mplus1]"; // }else{ // print "+b[$mplus1]"; // } // print "="; // print ""; printarray($lcva[$k],$n); print ""; printarray($multiplier_vector[$k],$n); print ""; print " $lengtharray[$k]"; print "
\n"; print "Also
\n"; $min_length=mina($lengtharray,$count); print "\n"; for($k="1";le($k,$count);$k=bcadd($k,"1")){ if(eq($multiplier_vector[$k][$nplus1],$min_length)){ print ""; print ""; print "\n"; $min_count=bcadd($min_count,"1"); } } print "
"; printarray($lcva[$k],$n); print "
\n"; if(eq($min_count,"1")){ print " is the closest vector of ℒ to P, with shortest distance squared $min_length
\n"; }else{ print " are the closest vectors of ℒ to P, with shortest distance squared $min_length
\n"; } return; } continue; } } } } function lengthsquared($a,$n){ $sum="0"; for($i="1";le($i,$n);$i=bcadd($i,"1")){ $temp=bcmul($a[$i],$a[$i]); $sum=bcadd($sum,$temp); } return($sum); } // returns 0 if all of $a[$i] are zero, otherwise 1. function zeroarray($a,$n){ $flag="0"; for($i="1";le($i,$n);$i=bcadd($i,"1")){ if(neqzero($a[$i])){ $flag="1"; break; } } return($flag); } ?> php/closest_lattice_points.php0000644000175100017510000001125112747001337016133 0ustar keithkeith \n"; exit; } if(lt($m1,"1")){ print "m1 is < 1
\n"; print "Return to main page
\n"; exit; } if(lt($n1,"1")){ print "n1 is < 1
\n"; print "Return to main page
\n"; exit; } if(gt($m1,"1000")){ print "m1 is > 1000
\n"; print "Return to main page
\n"; exit; } if(gt($n1,"1000")){ print "n1 is > 1000
\n"; print "Return to main page
\n"; exit; } if(gt($m1,$n1)){ print "m1 is > n1
\n"; print "Return to main page
\n"; exit; } $temp=bcmul("4",$m1); if(le($temp,$n1)){ print "m1/n1 ≤1/4
\n"; print "Return to main page
\n"; exit; } if(gt($rows,"25")){ print "row dimension is > 25
\n"; print "Return to main page
\n"; exit; } if(gt($cols,"25")){ print "column dimension is > 25
\n"; print "Return to main page
\n"; exit; } if(lt($rows,"2")){ print "row dimension is < 2
\n"; print "Return to main page
\n"; exit; } if(lt($cols,"1")){ print "column dimension is < 1
\n"; print "Return to main page
\n"; exit; } if(isset($_POST['matrix'])){ $matrix=$_POST['matrix']; }else{ return; } $matrix=trim($matrix); $a=preg_split('[ ]',$matrix); $t=count($a); if(le($t,"1")){ print "number of entries is less than or equal to 1
\n"; print "Return to main page
\n"; flush(); exit; } $size=bcmul($rows,$cols); if(lt($t,$size)){ print "number $t of entries is less than m × n = $size
\n"; print "Return to main page
\n"; flush(); exit; } if(gt($t,$size)){ print "number $t of entries is greater than m × n = $size
\n"; print "Return to main page
\n"; flush(); exit; } $flag="0"; for($i="0";lt($i,$t);$i=bcadd($i,"1")){ $check=check_decimal($a[$i]); if (ezero($check)){ print "

\n"; flush(); $flag="1"; break; } } if(ezero($flag)){ $ii="0"; for($i="1";le($i,$rows);$i=bcadd($i,"1")){ for($j="1";le($j,$cols);$j=bcadd($j,"1")){ $k=bcadd($ii,$j); $k=bcsub($k,"1"); $mat[$i][$j]=$a[$k]; } $ii=bcadd($cols,$ii); } // echo "matrix A:"; // printmat1($mat,$rows,$cols); // echo "
\n"; $flag="0"; for($j="1";le($j,$cols);$j=bcadd($j,"1")){ if(neqzero($mat[1][$j])){ $flag="1"; break; } } if(ezero($flag)){ echo "has zero first row
\n"; print "Return to main page
\n"; exit; } $n=$cols; $r=bcsub($rows,"1"); if(neq($r,"1")){ for($i="1";le($i,$r);$i=bcadd($i,"1")){ // A consists of the first $rows-1 rows of $mat for($j="1";le($j,$cols);$j=bcadd($j,"1")){ $A[$i][$j]=$mat[$i][$j]; } } mlll($A,$r,$cols,$m1,$n1); $AA=$mlll_reduced_matrix; $r=$rowsofB; $m=bcadd($r,"1"); for($j="1";le($j,$n);$j=bcadd($j,"1")){ $AA[$m][$j]=$mat[$rows][$j]; } }else{ $AA=$mat; $m=$rows; } shortest_distance($AA,$m,$n); } print "

\n"; flush(); print "Return to main page
\n"; flush(); ?> php/collatz.html0000644000175100017510000000605614056351552013214 0ustar keithkeith COLLATZ TYPE BCMATH PROGRAMS

BCMATH programs for some generalized 3x+1 mapping sequences and other recursively defined integer sequences

  1. The 3x+1 (Collatz) conjecture
  2. Two mappings of Keith Matthews
  3. Two mappings of Brian Gurbaxani
  4. Two mappings of David Barina
  5. Some mappings of Pruthviraj Hajari
  6. Some of G. Venturini's mappings
  7. Two mappings of Mridul Sen
  8. John Horton Conway's cycling sequence
  9. Examples of H. Möller's mapping
  10. Mappings of Benoit Cloitre
  11. Mapping of Kevin Lamoreau
  12. Mappings of Tomás Oliveira e Silva
  13. Frequency program
  14. Finding the canonical form of the Markov matrix QT(m) arising from generalized 3x+1 mappings , where either gcd(mi, d )=1 for 0 ≤ i < d, or gcd(mi, d2) = gcd(mi, d) for 0 ≤ i < d and d divides m.
  15. Finding the canonical form of Markov matrix QT(m) arising from George Leigh's Markov chain {Yn(x)}
Last modified 4th June 2021
Return to main page
php/composeneg.html0000644000175100017510000000411013241424647013671 0ustar keithkeith Composition of two positive definite binary quadratic forms of the same discriminant

Composition of two positive definite binary quadratic forms of the same discriminant

We start with two positive definite binary quadratic forms a1x2+b1xy+c1y2 and a2x2+b2xy+c2y2, where b12- 4a1c1=b22- 4a2c2.
We use an algorithm due to F. Arndt (Auflösung einer Aufgabe in der Composition der quadratischen Formen, J. Reine Angew. Math. 56, 64-71, 1859) to find the composite of the two forms.
This is a BCMATH version of Algorithm 5.4.7 from p. 241-242 of A Course in Computational Number Theory, 1993, by Henri Cohen.
The output form is reduced.
The program is a translation to BCMATH of the BC function compose1 in the BC file reduceneg.

Enter a1:
Enter b1:
Enter c1:
Enter a2:
Enter b2:
Enter c2:

Last modified 25th July 2011
Return to main page php/composeneg.php0000644000175100017510000000522212747016623013522 0ustar keithkeith \n"; } else { $temp1=bcmul($B1value,$B1value); $temp2=bcmul($A1value,$C1value); $temp2=bcmul("4",$temp2); $d1=bcsub($temp1,$temp2); if(gezero($d1)){ print "first discriminant is not negative
\n"; print "Return to main page
\n"; return; } if(lezero($A1value)){ print "coefficient a1 is not positive
\n"; print "Return to main page
\n"; return; } $temp1=bcmul($B2value,$B2value); $temp2=bcmul($A2value,$C2value); $temp2=bcmul("4",$temp2); $d2=bcsub($temp1,$temp2); if(gezero($d2)){ print "second discriminant is not negative
\n"; print "Return to main page
\n"; return; } if(lezero($A2value)){ print "coefficient a2 is not positive
\n"; print "Return to main page
\n"; return; } if(neq($d1,$d2)){ print "discriminants are unequal
\n"; print "Return to main page
\n"; return; } global $global_compose_a; global $global_compose_b; global $global_compose_c; compose1($A1value,$B1value,$C1value,$A2value,$B2value,$C2value); print "The composite of ($A1value,$B1value,$C1value) and ($A2value,$B2value,$C2value) is equivalent to the reduced form "; print "($global_compose_a, $global_compose_b, $global_compose_c)
\n"; } print "

\n"; print "Return to main page
\n"; ?> php/composepos.html0000644000175100017510000000365013241430417013721 0ustar keithkeith Composition of two indefinite binary quadratic forms of the same discriminant

Composition of two indefinite binary quadratic forms of the same discriminant

We start with two indefinite binary quadratic forms a1x2+b1xy+c1y2 and a2x2+b2xy+c2y2, where b12- 4a1c1=b22- 4a2c2.
We use an algorithm due to F. Arndt (Auflösung einer Aufgabe in der Composition der quadratischen Formen, J. Reine Angew. Math. 56, 64-71, 1859) to find the composite of the two forms.
This is a BCMATH version of Algorithm 5.4.7 from p. 241-242 of A Course in Computational Number Theory, 1993, by Henri Cohen.
The output form is reduced.

Enter a1:
Enter b1:
Enter c1:
Enter a2:
Enter b2:
Enter c2:

Last modified 19th July 2011
Return to main page php/composepos.php0000644000175100017510000000517412747015516013560 0ustar keithkeith \n"; } else { $temp1=bcmul($B1value,$B1value); $temp2=bcmul($A1value,$C1value); $temp2=bcmul("4",$temp2); $d1=bcsub($temp1,$temp2); if(lezero($d1)){ print "first discriminant is not positive
\n"; print "Return to main page
\n"; return; } $temp1=bcsqrt($d1); $temp2=bcmul($temp1,$temp1); if(eq($temp2,$d1)){ print "discriminant of first form is a perfect square
\n"; return; } $temp1=bcmul($B2value,$B2value); $temp2=bcmul($A2value,$C2value); $temp2=bcmul("4",$temp2); $d2=bcsub($temp1,$temp2); if(lezero($d2)){ print "second discriminant is not positive
\n"; print "Return to main page
\n"; return; } $temp1=bcsqrt($d2); $temp2=bcmul($temp1,$temp1); if(eq($temp2,$d2)){ print "discriminant of second form is a perfect square
\n"; return; } if(neq($d1,$d2)){ print "discriminants are unequal
\n"; print "Return to main page
\n"; return; } global $global_compose_a; global $global_compose_b; global $global_compose_c; compose1($A1value,$B1value,$C1value,$A2value,$B2value,$C2value); print "The composite of ($A1value,$B1value,$C1value) and ($A2value,$B2value,$C2value) is equivalent to the reduced form "; print "($global_compose_a, $global_compose_b, $global_compose_c)
\n"; } print "

\n"; print "Return to main page
\n"; ?> php/cong.html0000644000175100017510000000201611626066737012472 0ustar keithkeith Solving a linear congruence

Solving a linear congruence

We solve the congruence ax b (mod m), where m > 0.

(See MP313 notes.)

Enter a:
Enter b:
Enter m (> 0):

Last modified 31st August 2002
Return to main page php/cong.php0000644000175100017510000000173612747024364012320 0ustar keithkeith \n"; } else if(bccomp($M3value,"1")<0){ print "m < 1
\n"; } else { $number=cong($M1value,$M2value,$M3value); print "The congruence $M1value x ≡ $M2value (mod $M3value) has "; if($number){ print " the solution "; print "x ≡ $solution (mod $modulus)
\n"; }else{ print "no solution
\n"; } } print "

\n"; print "Return to main page
\n"; ?> php/congruences.html0000644000175100017510000000316614025103726014050 0ustar keithkeith BCMATH CONGRUENCE PROGRAMS

BCMATH Congruence programs

  1. Solving the congruence ax ≡ b (mod m);

  2. The Aubry-Thue theorem

  3. Solving the congruences x ≡ a (mod m), x ≡ b (mod n);

  4. Solving the congruences x ≡ a1 (mod m1),..., x ≡ an (mod mn);

  5. Solving the congruence ax2 + bx +c ≡ 0 (mod n);

  6. Solving x2 ≡ a (mod n);

  7. Finding a 2-adic square root of a positive integer of the form 8k+1;

  8. Finding a p-adic square root of a quadratic residue (mod p), p an odd prime.

  9. Calculating p-adic loga(b) (Victor Scharaschkin)

Last modified 19th March 2021
Return to main page php/convergents.html0000644000175100017510000000203011625550055014063 0ustar keithkeith Calculating the simple continued fraction a<sub>0</sub>+1/a<sub>1</sub>+...+1/a<sub>n</sub>

Calculating the simple continued fraction a0+1/a1+ ··· +1/an

Here a0,...,an are integers, with a1,...,an positive.

Enter the partial quotients (separated by spaces):

Last modified 25th August 2002
Return to main page php/convergents_.php0000644000175100017510000000243612746617361014070 0ustar keithkeith= 1. * qn(a[],n-1) returns q[n-1], where * q[0]=1,q[1]=a[1],q[i+1]=a[i+1]*q[i]+q[i-1] if i >= 1. * Hence pn/qn is the value of the simple continued fraction * [a[0],a[1],...,a[n-1]]. */ /* Here $n is the number of partial quotients a[0],...,a[n-1]. */ function pn($a,$n){ global $A; $A=array(); $A["-1"]="1"; $A["-2"]="0"; if(gezero($n)){ $A[0]=$a[0]; if($n=="0"){ return($a[0]); } } if(ge($n,"1")){ $x=bcmul($a[0],$a[1]); $y=bcadd($x,"1"); $A[1]=$y; if(eq($n,"1")){ return($y); } } $x=$a[0]; $z=bcmul($a[0],$a[1]); $y=bcadd($z,"1"); for($i="2";le($i,$n);$i=bcadd($i,"1")){ $t=bcmul($a[$i],$y); $z=bcadd($t,$x); $A[$i]=$z; $x=$y; $y=$z; } return($z); } /* Here $n is the number of partial quotients a[0],...,a[n-1]. */ function qn($a,$n){ global $B; $B=array(); if(gezero($n)){ $B[0]="1"; if(ezero($n)){ return("1"); } } if(ge($n,"1")){ $B[1]=$a[1]; if(eq($n,"1")){ return($a[1]); } } $x="1";$y=$a[1]; for($i="2";le($i,$n);$i=bcadd($i,"1")){ $t=bcmul($a[$i],$y); $z=bcadd($t,$x); $B[$i]=$z; $x=$y; $y=$z; } return($z); } ?> php/convergents.php0000644000175100017510000000253212746621651013723 0ustar keithkeith \n"; flush(); $flag="1"; break; } if(gtzero($i)){ $u=bccomp($a[$i],"0"); if(lezero($u)){ print "a[$i] <= 0
\n"; flush(); $flag="1"; break; } } } if(ezero($flag)){ $t=bcsub($t,"1"); $numerator=pn($a,$t); $denominator=qn($a,$t); print "["; flush(); for($i="0";lt($i,$t);$i=bcadd($i,"1")){ print "$a[$i],"; flush(); } print "$a[$t]] = "; flush(); print "$numerator/$denominator
\n"; flush(); echo "convergents:
\n"; for($i="0";lt($i,$t);$i=bcadd($i,"1")){ $a=$A[$i]; $b=$B[$i]; /*echo "A[$i]/B[$i]=$a/$b,
\n";*/ echo "A$i/B$i=$a/$b,
\n"; flush(); } $a=$A[$t]; $b=$B[$t]; echo "A$t/B$t=$a/$b
\n"; flush(); } print "

\n"; flush(); print "Return to main page
\n"; flush(); ?> php/conway.html0000644000175100017510000001000113241441222013012 0ustar keithkeith A sequence of John Horton Conway

A sequence of John Horton Conway

In the book Genius at play by Siobhan Roberts, pp.xx-xxi and in an online talk, the following sequence of John Conway is defined:

First if a and b are positive integers, then f(a,b) = a+b if a+b is a prime, whereas if a+b is composite and p is its least prime factor, then f(a,b) = (a+b)/p.
Now given positive integers a and b, define the sequence x0 = a, x1 = b, ... recursively by xn+2 = f(xn+1, xn) for n ≥ 0.

Conway asserted that the sequence eventually becomes periodic.

Apart from cycles of length 1 such as arising from initial values (2,2), in the range a, b ≤ 500, we have found six cycles:

  1. 507 382 127 509 318 827 229 528 757 257 (length 10)
  2. 188 419 607 513 560 37 199 118 317 145 231 (length 11)
  3. 48 13 61 37 49 43 46 89 45 67 56 41 97 69 83 76 53 43 (length 18)
  4. 63 55 59 57 58 23 27 25 26 17 43 30 73 103 88 191 93 142 47 (length 19)
  5. 5693 1739 3716 1091 437 764 1201 655 928 1583 837 1210 89 433 261 347 304 217 521 369 445 407 426 119 109 114 223 337 280 617 299 458 757 405 581 493 537 515 526 347 291 319 305 312 617 929 773 851 812 1663 825 1244 2069 3313 2691 3002 (length 56)
  6. 41 63 52 23 25 24 7 31 19 25 22 47 23 35 29 32 61 31 46 11 19 15 17 16 11 9 10 19 29 24 53 11 32 43 25 34 59 31 45 38 83 11 47 29 38 67 35 51 43 47 45 46 13 59 36 19 11 15 13 14 9 23 16 13 29 21 25 23 24 47 71 59 65 62 127 63 95 79 87 83 85 84 13 97 55 76 131 69 100 13 113 63 88 151 239 195 217 206 141 347 244 197 147 172 29 67 48 23 71 47 59 53 56 109 55 82 137 73 105 89 97 93 95 94 63 157 110 89 199 144 49 193 121 157 139 148 (length 136)

To determine a period, we apply Floyd's theorem to the sequence Xn defined recursively by Xn+1 = F(Xn), where F(a,b) = (b,f(a,b)) and Xn = (xn, xn+1).
We get cycling of the sequence Xn (and hence the sequence xn), if and only if there exists an n ≥ 1, such that Xn = X2n, i.e., xn = x2n and xn+1 = x2n+1.
We test the latter condition here.

Program 1 is a BCMath version of the BC program conwaycycles in BC file phi and tests Conway's conjecture that all sequences eventually enter a cycle.
Program 2 is a BCMath version of the BC program conwaysequence1 and tests the conjecture that all sequences eventually enter a cycle, which if its length is greater than 1, will be one of the six cycles mentioned above.

The program will occasionally exit prematurely if the underlying factorization algorithm (which uses only Brent-Pollard and Pollard p-1) fails to find a factor.

Enter a (≥ 1):
Enter b (≥ 1):
Program 1
Program 2
Last modified 26th May 2016
Return to main page
php/conway_.php0000644000175100017510000000615412722247025013022 0ustar keithkeith$i = x$twoi = $a, x$iplus1 = x$twoiplus1 = $b
\n"; print "cycle: $a "; break; } } $j=$i; while("1"){ $i=bcadd($i,"1"); $temp=$b; if(neq($a,$s) || neq($b,$t)){ print "$a "; } $b=conway($a,$b); $a=$temp; if(eq($a,$s) && eq($b,$t)){ $diff=bcsub($i,$j); print "
\n"; return($diff); } } } # Apart from cycles of length 1, I have not found any cycles other than the six with # initial values below. function conwaysequence1($a,$b,$n){ $i="0"; while("1"){ if(eq($a,"507") && eq($b,"382")){ print "Entered cycle 1: 507 382 127 509 318 827 229 528 757 257 at i=$i
\n"; return("1"); } if(eq($a,"188") && eq($b,"419")){ print "Entered cycle 2: 188 419 607 513 560 37 199 118 317 145 231 at i=$i
\n"; return("1"); } if(eq($a,"43") && eq($b,"48")){ print "Entered cycle 3: 43 48 13 61 37 49 43 46 89 45 67 56 41 97 69 83 76 53 at i=$i
\n"; return("1"); } if(eq($a,"63") && eq($b,"55")){ print "Entered cycle 4: 63 55 59 57 58 23 27 25 26 17 43 30 73 103 88 191 93 142 47 at i=$i
\n"; return("1"); } if(eq($a,"5693") && eq($b,"1739")){ print "Entered cycle 5: 5693 1739 3716 1091 437 764 1201 655 928 1583 837 1210 89 433 261 347 304 217 521 369 445 407 426 119 109 114 223 337 280 617 299 458 757 405 581 493 537 515 526 347 291 319 305 312 617 929 773 851 812 1663 825 1244 2069 3313 2691 3002 at i=$i
\n"; return("1"); } if(eq($a,"41") && eq($b,"63")){ print "Entered cycle 6: 41 63 52 23 25 24 7 31 19 25 22 47 23 35 29 32 61 31 46 11 19 15 17 16 11 9 10 19 29 24 53 11 32 43 25 34 59 31 45 38 83 11 47 29 38 67 35 51 43 47 45 46 13 59 36 19 11 15 13 14 9 23 16 13 29 21 25 23 24 47 71 59 65 62 127 63 95 79 87 83 85 84 13 97 55 76 131 69 100 13 113 63 88 151 239 195 217 206 141 347 244 197 147 172 29 67 48 23 71 47 59 53 56 109 55 82 137 73 105 89 97 93 95 94 63 157 110 89 199 144 49 193 121 157 139 148 at i=$i
\n"; return("1"); } $olda=$a; $oldb=$b; $b=conway($olda,$oldb); $a=$oldb; if(eq($olda,$oldb) && eq($oldb,$b)){ print "cycle $b, $b,... of length 1 at i=$i
\n"; return("1"); } if(eq($i,$n)){ print "no cycle found in the sequence xi,... xi+1 for i=0.1,...,$n
\n"; return("0"); } $i=bcadd($i,"1"); } } ?> php/conway.php0000644000175100017510000000206412747113511012656 0ustar keithkeith A sequence of John Horton Conway \n"; } else if(lezero($avalue) || lezero($bvalue)){ print "a ≤ 0 or b ≤ 0
\n"; } else{ print "
\n"; $mapping=$_POST['mapping']; /*printf("value of mapping %s\n",$mapping);*/ if(eq($mapping,"1")){ $t=conwaycycles($avalue,$bvalue); print "cycle length $t
\n"; } if(eq($mapping,"2")){ $t=conwaysequence1($avalue,$bvalue,$n); } print "Initial values (a,b) = ($avalue, $bvalue)
\n"; } print "

\n"; print "Return to main page
\n"; ?> php/copy_lemma3_.php0000644000175100017510000002046011613167626013734 0ustar keithkeith=0, n>1 * Returns the penultimate and alternative penultimate convergents and the gcd(m,n). * For use in matrix_factorization(a,b,c,d) below. */ global $anminus1; global $bnminus1; global $altanminus1; global $altbnminus1; if(ltzero($m)){ print "m < 0
\n"; return; } if(le($n,"0")){ print "n ≤ 0
\n"; return; } $s0="1";$s1="0"; $t0="0";$t1="1"; $a=$m; $b=$n; $r=bcmod($m,$n); $temp=bcsub($a,$r); $q=bcdiv($temp,$b); $i="1"; while(gtzero($r)){ $i=bcadd($i,"1"); $s2=bcadd(bcmul($q,$s1),$s0); $t2=bcadd(bcmul($q,$t1),$t0); $a=$b; $b=$r; $r=bcmod($a,$b); $q=bcdiv(bcsub($a,$r),$b); $s0=$s1;$s1=$s2; $t0=$t1;$t1=$t2; } $s2=bcadd(bcmul($q,$s1),$s0); $t2=bcadd(bcmul($q,$t1),$t0); $i=bcadd($i,"1"); $anminus1=$t1; $bnminus1=$s1; $altanminus1=bcsub($t2,$t1); $altbnminus1=bcsub($s2,$s1); /*print "Penultimate convergent $anminus1/$bnminus1
\n"; print "Alternative penultimate convergent $altanminus1/$altbnminus1
\n";*/ return($b); } /* Here a,b,c,d are non-negative and ad-bc=\pm 1. We output the factorization A=BC of Lemma 3, Mtthews and Walters * Poc. Camb. Phil. Soc. (1970) 67 67-74. B=(b1,b2,b3,b4) is unimodular and b1>=b2 and b3>=b4. * p=gcd(a,c), b1=a/p, b3=c/p, ps=|delta|, C=(p,r,0,s), where -s<=r<=p. */ function matrix_factorization($a,$b,$c,$d){ global $anminus1; global $bnminus1; global $altanminus1; global $altbnminus1; global $globalb1; global $globalb2; global $globalb3; global $globalb4; global $globalp; global $globalr; global $globals; $delta=bcsub(bcmul($a,$d),bcmul($b,$c)); $t=sign($delta); $absdelta=bcabs($delta); $p=euclid2($a,$c); $s=bcdiv($absdelta,$p); $b1=bcdiv($a,$p); $b3=bcdiv($c,$p); $temp=bcdiv($delta,$absdelta); if(gt($b3,"1")){ $temp1=bcsub(bcmul($b1,$bnminus1),bcmul($b3,$anminus1)); if(eq($temp1,$temp)){ $b2=$anminus1; $b4=$bnminus1; }else{ $b2=$altanminus1; $b4=$altbnminus1; } }else{ if(eq($b1,"1")){ if(gtzero($t)){ $b4="1"; $b2="0"; }else{ $b2="1"; $b4="0"; } }else{ /* At this stage b1>b2 */ if(gtzero($t)){ $b2=bcsub($b1,"1"); $b4="1"; }else{ $b2="1"; $b4="0"; } } } $globalb1=$b1; $globalb2=$b2; $globalb3=$b3; $globalb4=$b4; $temp=bcsub($b,bcmul($b2,$s)); $r=bcdiv($temp,$b1); $globalp=$p; $globals=$s; $globalr=$r; return; } function Apolynomial($d,$q){ $sum="1"; $product="1"; for($k="1";le($k,$d);$k=bcadd($k,"1")){ $temp=binomial0($d,$k); $temp0=bcadd($d,bcsub($k,"1")); $temp1=falling_factorial($d,$temp0); $temp=bcmul($temp,$temp1); $product=bcmul($product,$q); $temp=bcmul($temp,$product); $sum=bcadd($sum,$temp); } return($sum); } function Bpolynomial($d,$q){ $product=$q; $sum=bcmul($d,$q); $lim=bcsub($d,"1"); for($k="1";lt($k,$d);$k=bcadd($k,"1")){ $temp=binomial0($lim,$k); $temp0=bcadd($d,$k); $temp1=falling_factorial($d,$temp0); $temp=bcmul($temp,$temp1); $product=bcmul($product,$q); $temp=bcmul($temp,$product); $sum=bcadd($sum,$temp); } return($sum); } function initial_matrix($m,$n,$q){ global $global11; global $global12; global $global21; global $global22; $d=bcmul($m,$n); $global11=Apolynomial($d,$q); $temp=Bpolynomial($d,$q); $temp=bcmul($temp,$m); $global12=bcdiv($temp,$n); $minusq=bcminus($q); $r=mod($d,"2"); if(ezero($r)){ $s="1"; }else{ $s="-1"; } $temp=Bpolynomial($d,$minusq); $temp=bcmul($temp,$s); $temp=bcmul($temp,$n); $global21=bcdiv($temp,$m); $temp=Apolynomial($d,$minusq); $global22=bcmul($temp,$s); /*$t=Apolynomial($d,$q); $t=Bpolynomial($d,$q); $q=bcminus($q); $t=Bpolynomial($d,$q); $t=Apolynomial($d,$q);*/ } function movernexp1overq($m,$n,$q){ global $globalb1; global $globalb2; global $globalb3; global $globalb4; global $globalp; global $globalr; global $globals; global $global11; global $global12; global $global21; global $global22; global $unimodular_partial_quotient; $twoq=bcmul("2",$q); initial_matrix($m,$n,$q); /*print "initial matrix:";*/ /*print_matrix($global11,$global12,$global21,$global22);*/ /* factorize unimodular B */ $product_count=unimodular($global11,$global12,$global21,$global22); for($i="0";lt($i,$product_count);$i=bcadd($i,"1")){ print "U$unimodular_partial_quotient[$i] "; flush(); } matrix_factorization($m,$m,$n,"0"); print ":"; /*print_matrix($globalb1,$globalb2,$globalb3,$globalb4);*/ /* factorize unimodular B */ $product_count=unimodular($globalb1,$globalb2,$globalb3,$globalb4); for($i="0";lt($i,$product_count);$i=bcadd($i,"1")){ print "U$unimodular_partial_quotient[$i] "; flush(); } print "
\n"; print "Πx≥1{"; $p=$globalp; $r=$globalr; $s=$globals; $d=bcmul($m,$n); for($t="1";le($t,$d);$t=bcadd($t,"1")){ /*print "t=$t
\n";*/ $a=bcmul("2",$s); $temp=bcsub(bcmul("2",$d),"1"); $temp1=bcsub(bcmul("4",$t),"2"); $temp1=bcmul($temp1,$q); $temp=bcadd($temp,$temp1); $c=bcadd(bcmul($p,$temp),bcmul("2",$r)); $temp=bcsub(bcmul("2",$t),"1"); $temp=bcmul($temp,$q); $temp=bcadd($d,$temp); $dd=bcadd(bcmul($p,$temp),$r); /* print "matrix C"; print_matrix($p,$r,"0",$s); print "matrix to be factored"; print_matrix($a,$s,$c,$dd);*/ matrix_factorization($a,$s,$c,$dd); /* factorize unimodular B */ $product_count=unimodular($globalb1,$globalb2,$globalb3,$globalb4); $p=$globalp; $r=$globalr; $s=$globals; $temp=bcmul($p,$p); $entry0=$unimodular_partial_quotient["0"]; print "
\n"; if(neqzero($entry0)){ if(eq($temp,"1")){ print "U$twoq x-1 "; }else{ $temp1=bcmul($temp,$twoq); print "U$temp1 x-$temp "; } for($i="0";lt($i,$product_count);$i=bcadd($i,"1")){ print "U$unimodular_partial_quotient[$i] "; flush(); } }else{ $entry1=$unimodular_partial_quotient["1"]; if(eq($temp,"1")){ $newentry=bcsub($entry1,"1"); if(ezero($newentry)){ print "U$twoq x "; }else{ print "U$twoq x+$newentry "; } }else{ $temp1=bcmul($temp,$twoq); $newentry=bcsub($entry1,$temp); if(ltzero($newentry)){ print "U$temp1 x$newentry "; }else if(ezero($newentry)){ print "U$temp1 x "; }else{ print "**U$temp1 x+$newentry "; } } for($i="2";lt($i,$product_count);$i=bcadd($i,"1")){ print "U$unimodular_partial_quotient[$i] "; flush(); } } /*print_matrix($globalb1,$globalb2,$globalb3,$globalb4);*/ /* factorize unimodular B */ } print "}"; return; } /* This algorithm expresses a unimodular matrix A !=I_2 or U=[0 1] * [1 0] * with non-negative coefficients, as a product of one of the * following forms: * P, UP, PU, or UPU, where P is a product of matrices of the form * [a 1], a>0. * [1 0] * The representation is unique. See Kjell Kolden, 'Continued fractions * and linear substitutions', Arch. Math. Naturvid. 50 (1949), 141-196. * The number n of matrices in the product [d[0]1]***[d[n-1]1] * is returned. [ 1 0] [ 1 0] * */ function unimodular($p,$q,$r,$s){ global $unimodular_partial_quotient; $i="0"; while("1"){ if(bccomp($s,"0")==0){ /*print "U$p"; flush();*/ $unimodular_partial_quotient[$i]=$p; $i=bcadd($i,"1"); break; } if(bccomp($r,"0")==0){ /*print "U$q "; flush();*/ $unimodular_partial_quotient[$i]=$q; $i=bcadd($i,"1"); /*print "U0"; flush();*/ $unimodular_partial_quotient[$i]="0"; $i=bcadd($i,"1"); break; } $d1=bcdiv($q,$s); $d2=bcdiv($p,$r); $d=minimum($d1,$d2); $tempp=$p; $p=$r; $temp=bcmul($d,$r); $r=bcsub($tempp,$temp); $tempq=$q; $q=$s; $temp=bcmul($d,$s); $s=bcsub($tempq,$temp); /*print "U$d"; flush();*/ $unimodular_partial_quotient[$i]=$d; $i=bcadd($i,"1"); } return($i); } ?> php/cornacchia.html0000644000175100017510000000263212567722501013633 0ustar keithkeith Solving the diophantine equation ax^2+by^2=m, gcd(x,y) = 1, by Cornacchia's method

Solving the diophantine equation ax2+by2=m, gcd(x,y) = 1, by Cornacchia's method

Here a > 0, b > 0,m ≥ a+b, gcd(a,m)=1=gcd(a,b).
The algorithm is from A. Nitaj, L'algorithme de Cornacchia, Expositiones Mathematicae 13 (1995), 358-365.
We find the positive solutions (x,y) with gcd(x,y)=1.
If a=b=1, we find the solutions with x ≥ y.
This works for m with up to say 20 digits, due to the limitations of the program used to factor m.

Enter a: (> 0)
Enter b: (> 0, gcd(a,b)=1)
Enter m: (≥ a+b),gcd(a,m)=1

Last modified 28th August 2015
Return to main page
php/cornacchia.php0000644000175100017510000000227612747037342013464 0ustar keithkeith Solving ax^2+by^2=m using Cornacchia's method \n"; } else{ $a=$Avalue; $b=$Bvalue; $m=$Mvalue; $temp=bcadd($a,$b); $temp1=gcd($a,$m); $temp2=gcd($a,$b); if(bccomp($a,"0")<=0){ print "a < 1
\n"; }else if(bccomp($b,"0")<=0){ print "b < 1
\n"; }else if(bccomp($temp,$m)>0){ print "a+b > m
\n"; }else if(bccomp($temp1,"1")>0){ print "gcd(a,m) > 1
\n"; }else if(bccomp($temp2,"1")>0){ print "gcd(a,b) > 1
\n"; }else{ $result=cornacchia($a,$b,$m); } } print "

\n"; print "Return to main page
\n"; ?> php/davison.html0000644000175100017510000000661313145746076013215 0ustar keithkeith Finding the continued fraction of e^(p/q)

Finding the continued fraction of ep/q

The continued fraction expansions for e1/k and e2/k (k odd) are well known, namely:



However there is no known formula for the partial quotients of the continued fraction expansion of e3, or more generally ep/q, with p distinct from 1,2 and gcd(p,q)=1.
Here are the first 250,000 partial quotients of e3 and here is the table size-sorted. The largest partial quotient is a196440 = 546341.

We perform the algorithm of J.L. Davison, An algorithm for the continued fraction of ep/m, Proceedings of the Eighth Manitoba Conference on Numerical Mathematics and Computing (Univ. Manitoba, Winnipeg, 1978), 169-179, Congress. Numer., XXII, Utilitas Math.

The starting point is a result of R.F.C. Walters in Alternate derivation of some regular continued fractions, J. Austr. Math. Soc 8 (1968), 205-212): If

then pn/rn and qn/snel/m.

We first find the least n=n* such that pn, qn, rn, sn are non-negative and repeatedly apply Raney's factorisation for n*≤ k ≤ n*+N, as in Davison's example in §3.
The number (count) of partial quotients of ep/q found is returned.
We cannot predict the value of count, but it becomes positive for sufficiently large N.
We restrict taking p/q no greater than 14, because of the time taken to compute a0 for larger values of p/q.

This is a BCMATH translation of a BC program.
A faster C version is available.

Inside the program, p and q are replaced by p/gcd(p,q) and q/gcd(p,q).

Enter p (> 0):
Enter q (> 0):
Enter N (10000 ≥ N ≥ 0):

Last modified 19th August 2017
Return to main page
php/davison.pdf0000644000175100017510000005372310032767210013007 0ustar keithkeith%PDF-1.3 3 0 obj << /Length 1099 /Filter /FlateDecode >> stream xYK8 ϯ19X)Qf1[{Z!Hf3@-{bʣ3!DI)d83ưw~}#"DXkD_?/V_q&qBK$ JPh,EB@D-Ο@ D5-zA!a , >-Ñ֞{k ؊f5Qzj;rnVUt../Y T 1k'^lV 2$}t}k%88O& V &jį0H<*/v,a><>g%acy|6VV@QS|TfO ]F.d7G2V7̰lW̷=N3?@~=*M 7N^EHT,_͘W+AbƎPe~8DW i9slU S ]ʦ/!@C7s崦Fe: ({@aA~2u3H :pZe WQ@O+h4Χשm__ *7:#9˄Xo.Ȅzpp%"lCE#Ed37s^nU؏V UH9__=|S23wB`7yr@:_R"PoPwϥrZso@9yS p5DaX,J$LyC*do-y=ﲅ#M؃#FآVFv0}~|7U,+jgBib^pFtP|t*] g"m77 0nv_34=nxdKt9 F:2軫Lu'iPWnxݙ:~qnsW~)uV r~1͊S N G}}cendstream endobj 2 0 obj << /Type /Page /Contents 3 0 R /Resources 1 0 R /MediaBox [0 0 595.276 841.89] /Parent 19 0 R >> endobj 1 0 obj << /Font << /F20 6 0 R /F18 9 0 R /F15 12 0 R /F26 15 0 R /F23 18 0 R >> /ProcSet [ /PDF /Text ] >> endobj 17 0 obj << /Length1 796 /Length2 652 /Length3 532 /Length 1224 /Filter /FlateDecode >> stream xRkPWUZ:S*5^ *$M )X[CxLZ!`J,MXbbx-hqZ)PF'ȫ>PUDj?}{ H6Ʋ /$X$PR0` Vs)y  ,) % ԬQLR")9(h8 t,AA&*v"h\$%"x Hi= mbz @,`dHG 0 N S#c-4)=F=aFgI1#as,ƑiP116WeLx"q }Ȑ#yH$Ć>W/S f}سZH (&/mİ`I1" bbHh*8J!;г2t()bzbI2B"0*e@. İpT*'&3TjE7e'&,'h{_ZO Ch`yko_wSzpAK57Ki)v%M7vmheM~W2;XPgk T-T4J.D\4g/پcmFa3WE^`gǸW,2g3zoX|ֹK 5"slAHqw{=H>-4Otj׊/kSAy3:P{WԞwxJuڼtt3dZ&NѾ$9}Ux֎[??,*Kޫߞr<*6nΎ-[6dn!ޜ{5i5>pʤH}<)\ԟVO).ewgү;fc2*+/|hrS1_,98+X/ooO_lXªKv3/lW| >ZPXxy@moa?f :$>'fem#1גjj6ߟ-Yvё6릛g*ӦkWZow꾝g]qoTtb*{t!òvP$)Lu)uxB1gB;>|tE̩ۧ+YS(~ 8dzFBxendstream endobj 18 0 obj << /Type /Font /Subtype /Type1 /Encoding 20 0 R /FirstChar 0 /LastChar 1 /Widths 21 0 R /BaseFont /UTEUEF+CMSY10 /FontDescriptor 16 0 R >> endobj 16 0 obj << /Ascent 750 /CapHeight 683 /Descent -194 /FontName /UTEUEF+CMSY10 /ItalicAngle -14 /StemV 85 /XHeight 431 /FontBBox [-29 -960 1116 775] /Flags 4 /CharSet (/minus/periodcentered) /FontFile 17 0 R >> endobj 21 0 obj [778 278 ] endobj 20 0 obj << /Type /Encoding /Differences [ 0 /minus/periodcentered 2/.notdef] >> endobj 14 0 obj << /Length1 860 /Length2 1529 /Length3 532 /Length 2131 /Filter /FlateDecode >> stream xR{<m1Jt (aR;̅f(F(.R5h 2.х ՞O9y|y?c^K,rذ% ~($B".\ C6  xD2 F9;ƀ 'Lal, ѨlDATFe{94V'"/0@  ^D`38C )t٥ H簙2d2PjKqH&Le-˯NeALG \ġ\T_9H"Y_ʄhXvZP+ *3\l&ɭX&O¹mB>A_ZHi()Qz>2<ơC mrTBz 6 _ڊ́#4cE,oTZ(3A->`E~n_a>"}3m,ۥml }s7  8Db0+]Z$ ᕇ)]I|}ʡɪJ(+8U+;T|/,h 7{[^uDaDȢvĩڣ{\'DGxG~& ^.ޫN'2>ȝjL1U7X%of3OTx‹l%G2%cBjMsj#׽WtW5-Muw y/,7TPlAf-m0=wY[R;OXY2؜Aߕ[p>S;E#DCkoN6|cv+w;+]kv)oXו`LTUY9{}R5V3}#+7e[Z{TQdcC-ZooK < W)Lo13T[\Smc@otπH RTmF]$+y=wt<3)ogwOLv=!lB֬m8hzA˜Q'uODī.ӳe:ĿZ=ISKqzr^sDi }9F֞jB˖K; ybǹ_T#6hUutVZaxCPCR̝ ˺<͇)BrΨ jޖnn[$NokGχ9WbD}{d8s Xj'uqUIg؜){it?v8gtT|v":W%u,l`VE:[QַKq3t ;33pǴn!ѳgC!?\2LR*i,I .LGý9‷3Qn9(Jdz-eQ;  U8E|Ű;nJ4坸4p6H)e/;1f_97G(l7;3ֱPs~Z84#fcO۸'O4TckAdDx/yVhz51*@.௱ݲ&EcV W/ ~v|5ʱ7y{cP6șibY̳b`vi'Z"qnBUACGNc##]λC9:rf&-vj{;LƴY`}! ra E ynendstream endobj 15 0 obj << /Type /Font /Subtype /Type1 /Encoding 22 0 R /FirstChar 20 /LastChar 27 /Widths 23 0 R /BaseFont /LQZMDG+CMEX10 /FontDescriptor 13 0 R >> endobj 13 0 obj << /Ascent 40 /CapHeight 0 /Descent -600 /FontName /LQZMDG+CMEX10 /ItalicAngle 0 /StemV 47 /XHeight 431 /FontBBox [-24 -2960 1454 772] /Flags 4 /CharSet (/bracketleftbigg/bracketrightbigg/braceleftbigg/bracerightbigg) /FontFile 14 0 R >> endobj 23 0 obj [528 528 0 0 0 0 750 750 ] endobj 22 0 obj << /Type /Encoding /Differences [ 0 /.notdef 20/bracketleftbigg/bracketrightbigg 22/.notdef 26/braceleftbigg/bracerightbigg 28/.notdef] >> endobj 11 0 obj << /Length1 1283 /Length2 5599 /Length3 532 /Length 6417 /Filter /FlateDecode >> stream xVgXS۶KSBH#PBoRKA) ҫRAi ۋܫ~}oc5Xcεh( qQ8,^$ 4t@85??ǣqXE8% Ȁ NV qHJ,-+pvnh+k<Lg`r@#Xo%@1]»0#H4xBc~ RZпiݿC(G(5HA"Ÿ(Kj1Ma/AWv`4?4鿅hۿpvNx@D9`j[ vgT Ǡ X+ 7vTFh<` 8QX?E|K]MC5-WL3/ 8]& B"K !X@@p5a2X$r%%'^KvJ(,e}h)Mh p ! .Bi %7&h?2$b?~aQ A?B1,O!{A މ0"/%SNaW2_Ew1oD ?Z$la$$@ BeP$X`}6C,  PFZ{gmRS$t]\*#pr L/[ 7 rE!Gqj  o[|'qn%k-7 Xk})5iK־}M2QsUKJP9aH/ va}F:=(Vh;a6ef̩/nH=|XU$ó#RKR5DR-߳yvϪ4oQ'=w]$D+?9NiO4 oOc5 }՞+ٙmHes}ʲa?:h62ӌSF&]MωUL']H-MMb}7w,llJ"|JxHb@ù<3&!Xһf+sugT^FgIq c ?gq/lyL#Y [;84az -Jh}=t'?cS{ݶK FR${ 86X:b4rtfwt:߉!tZ9@|4{`S~Z2s b>/A]N$wm/J#'ʝ(@ljg3D}PTr☐} Dw\뱢iv;?>9S@5_]at^k-ѱJ_-[#Hfvև\e)utmL-f1qaC}ivJJw"Ek+Aw=}̊65ng3)5m{9aNb/)O 6~Tk3dDqٷ/{gLJfr39Jǜ_e/SI98- 2 \*/<='XSDR}'R+nւkZelCQ [)gAjlYhg $o~Z5cQ.Zq`|vz+.N;g{WnD|%Rצ:Q5: b05̷*mvon /RI2}t yb<(M;z^.. h RR)V3BDVNM0K'a+|ke*AduJ !iq,bpg=#d\ M&gT#tDL,O̻B%!+qC(NC<7"tG X4V߱x#3h"dQE$wb:k9i|m 䫬f(\j8V4#-^dV]CxMlfy/M(i*B!SbB)dXEN, Y,6}$Qnt쀛h`ryfo?+Pi+d>"׆^FSpcץ`Hj^ >kjK68eX!vSatgo}Ti|.Y]ԏ;\ëmTUf 0稞Zoqɶ;Y[F_+Կm5 Ov?(!ŝZgjLgNH7#~X%(8a7xlɵcbjC'3C;ěn%4P{,Uzu@J^&!)e)w'Lnzl >ҧ kviك'>s8{;5m?ROFQ0E˵f)[&}1-ϟqilFGɈ[ͧH}V%` H5 tM9OGypqay9Q'i.RE(7a|KjJ苼u sclf([`^nb{u D钯|l6J}"mZZ1*ɤ7\F+`ɢ/o(4C|kn1b^Ş.0<Ԁ6`#cOQZ3]YRdZqAa5 &* r7jGqMkQy:iXI3/, &Ϝ񮯢(R Ljq'MG1׷JN>V]MSڷ`Nm]y ͖Juv-Y:õ.[Dd ޣ_Fҟ@xv[${{tjGiGdcTҝNzmy|=b{«2%Zz;x'ǶZ`[7y"ߗu$:*%iǏk^lJg#FQ5:抙oT!gzxS`!ӽ$\er@i4R)Îݲ+Cy g_KW~@!sGn UOIr&޼rM[>m\Q\GTʠq3aLmkY eo6 m;g\߃?JZV|z8̀ΑKr3g} |T58l`'*]wB"f8_wH۴۷[IF=}z)$iz ![mML#@AUH6KW׾)g軜)t#ډqITJҋQn!̲vbWo'0,jtp{o`2-xS;=}T:bFS4ϵ)^ o d._}/\.E~=o<13w z?||w^f6TAbCs1),GZM| r7:om%2%xtim1!Y;xZsUQ/9&w+6;AG\NO I۫KSo%3O"=} "VǀD{UӨBe!֎m4f]⓱xh=}ͥE0538 DlY 7G>%B=0^ցNEwvm.U i^1Nv_S5rӛWܙJc:[G UD@iŕ$Se_DQnySI=i]EE"KʮAsZPL XJ#>X/_]0-/'uÃuSM[ w}" 0z͖a:ыVK|1$3B5Yl&mWmZ4ݺO=Y{4 ' 9PŦE /GC{$$]1нB&Zˆ{q]Qj˖bWkWK]ll(B@ 8) u`fsR里oӪ[lJQtZZhbΑ 3(ށ• _?F]̋v}a|5Bk7R S"O{5Ѡr]x7ܛzK.w+w4iڜBv$+\'2]]~zMJ-AԧW wk'o\ )zNV$?T |޸T5w]39aj7 AP+R`U>̱ҳ[,y3R~3xPeR!\3`fc}Oʶ!JZH# ڥl'KcJdYR;xK{bַlS|l;5Nu2dzڋH?9:ؕ RCKOPrf\wJzbSkk=:VvP߀7Xc'.VO\^%ŜU?_yX$ `۠;Npz LT3;+I~]eD뼯flBnC. 5HXLeG7hvV}"[;PCF6Yde00|6e؝$w |U1~fBm~wP.#"CBΥ_Q~B͎>@36{1=7Y]z"~YxjȺz.m^W5 "\+LGIsFeb$LhX ˼H伸z&EA/goxt}i8g}5=ubCH@NɷpF5}VB"L~-mV.4.d vWʒ ٤]iDy4eȑZg/(6d^05whwRͳr*X!m0 \5>|wzK3E⑌i~Tů]IXYVa»g[lMƭg&'Ʉ^DvZF bo Nj,kJ O40 )&fGwz,{PIZ3Yѽؿd}*Gj~~0w_}֋u@)3֨]j<ӽ/ii\^fGa윚։Ň in^کB p=w޶fy΄n,WycRd'Rjy&ã{[бSk5 kۗĽe' xUJΈi}e8bZm]3,CQ*g=}Fj5JwebtCadNևo?t~fж1gh$mw[,=5gk7Bh3=nJ aN7=(l] I<nEEDlB::S 7n3PV ebO7U8g˗oQ<*0gŲ2k/q)ܛR99=!>~e/aERe[|UrnPc?YLwLֆz# ^tD9<|K6=FDz̰tl4׬Xsq "0~Jj*+L_oĐ37I&0p@eω%)U mCnr!֧֖:kA.xAOTe$T{IeūT䒽gHMDEqC8(MRKۓ@kdmm|c19=ooS FOK]gҢρ7C\fH4`9%g]ϓ jKPY5^L2Xў3J)AidƪbJ$lՇl-Ie[%,ov\FncAӔzlCI>) fu*P_kƒ-8u.%́$>kُixE>.}35Dh4;YP;P{RQendstream endobj 12 0 obj << /Type /Font /Subtype /Type1 /Encoding 24 0 R /FirstChar 40 /LastChar 116 /Widths 25 0 R /BaseFont /HLNXIO+CMR12 /FontDescriptor 10 0 R >> endobj 10 0 obj << /Ascent 694 /CapHeight 683 /Descent -194 /FontName /HLNXIO+CMR12 /ItalicAngle 0 /StemV 65 /XHeight 431 /FontBBox [-34 -251 988 750] /Flags 4 /CharSet (/parenleft/parenright/period/zero/one/two/three/four/five/six/seven/eight/nine/colon/equal/C/H/bracketleft/bracketright/a/c/d/e/f/g/i/l/n/o/r/s/t) /FontFile 11 0 R >> endobj 25 0 obj [381 381 0 0 0 0 272 0 490 490 490 490 490 490 490 490 490 490 272 0 0 762 0 0 0 0 0 707 0 0 0 0 734 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 272 0 272 0 0 0 490 0 435 544 435 299 490 0 272 0 0 272 0 544 490 0 0 381 386 381 ] endobj 24 0 obj << /Type /Encoding /Differences [ 0 /.notdef 40/parenleft/parenright 42/.notdef 46/period 47/.notdef 48/zero/one/two/three/four/five/six/seven/eight/nine/colon 59/.notdef 61/equal 62/.notdef 67/C 68/.notdef 72/H 73/.notdef 91/bracketleft 92/.notdef 93/bracketright 94/.notdef 97/a 98/.notdef 99/c/d/e/f/g 104/.notdef 105/i 106/.notdef 108/l 109/.notdef 110/n/o 112/.notdef 114/r/s/t 117/.notdef] >> endobj 8 0 obj << /Length1 894 /Length2 2432 /Length3 532 /Length 3061 /Filter /FlateDecode >> stream xRi<H<);}_Ed<0f`R& SHʾDYSd'!);ْ3o|<\}-.jqVFMpx PMT &H AR@54}0@(ɫ)0D6Ob)2($0ERA/ PX4q8j DàƢ(+⡲;y n@!YIdF(@&qtʚw$PpfH{FY'x}( 0%AW#)xZ5 qX& KRArܐ82_C0=i~/Y x?/w!a##B/WQ4XE%I"!` E" 0<80ZHНa* TY +YϺ"IrgX߿)Y2Š  c;̿7SK@(#1!p@YB<4adÕUC"xe Oe %u*#<2?X7$8u5a̸Vcc)MM}"Ӫ-.{%uL _L1 }z\޷Yټg-ƹZHX="T[V;\I^/gQ*!/jŝ5}#2^!5@dO;;JN^8w)k+nݑ/Kߡ#t+& ,K E{,L +8LؼE:|"_vBycZ& NW& t?4BFiLCm>Q&,?t!#۫q+h=۴B u`_}y6cv;AADq4\@8|MPgFD0MCu6Ϩ{wҰBx]vT8W0[,GOqoռsڞVwbb\Z2oU%^@(74; kNK|9Y-i/36y_^#d"Tr⸦*R1;ɽ?PkeNnΒ"ni-}B^ ㋢W8vbˮmSL 378ӭf=_ `wC$2tJ`;\;B"yQJvߴMs_ӥQ?MJңpEO%ma+<aXyqPC \Z^;cMHJt;zAǫkȡZ& CU#N0q :GDpdC*6e2UhjΚgĂ JP:¶G<M&`u(À?l_\:R|;/-8Y|Tmpu9~Y<=XMNhI .b˔6? ᰔBo?d| }5$`(١ u@eժx7|VSnOw$pMIPݱgv]&^;_rT̘cz0oShMm^z^BMh9nU㜻:^{_x^E(Й7| sje2 NMd園+P ϦO׏UVQ6~_trVGX]9e*b^y04Ƅ8c}:b=j.rlOd$jET޶zp haяر:Y"/Z*"FLb(kg12ˣ&c3s+VcM:|FLKţ⦑BCWd"TΠzSsŊ5?JsOY?2~ҁC>hPn;3գrb{>3V9"EfV&m]Q!|\1$V;-J8yEe;O _$Tm#"gQMh#f9cEO癄Yuw3b->ILz%J[swM7T|g;>H}—ٽl7JOZ \\GKG.rm3Qj۹1E_ ߸}pUHQ_֨7_wzuОool,6(Ħkys)]cX.}uymC*w-c xVYmyl(5ea[0'1umASkvSBVuڬ9ned(p9Ҳ8VKF%jPuI)T92C0[Q=G0gKxڑsۃ34Ŵ{%.o֠~M! #YOg9;Y%]t$lFÖ=dN> y†μgӛZCJ3 `b4Hx!u#"j1"Pg*bƏ_}~xE%2JۺqA.eQyr2 fsj@(y\3+{q9_ڳ Xs_vR-5i@W32Ga| RB ibk]'lb7 /EV!55G_^}7*.dڨB,6$XmObφ8~CUzŅ8uB57+>N(@+4o6T%ٸ%؈A f&#]gjiK \=Y9M/-+U=#Gy7k=V9HsV$Eq^?MYUG㚰 Sm> endobj 7 0 obj << /Ascent 694 /CapHeight 683 /Descent -194 /FontName /EIVVEX+CMR8 /ItalicAngle 0 /StemV 76 /XHeight 431 /FontBBox [-36 -250 1070 750] /Flags 4 /CharSet (/zero/one/two/three/four/five/six/seven/eight) /FontFile 8 0 R >> endobj 27 0 obj [531 531 531 531 531 531 531 531 531 ] endobj 26 0 obj << /Type /Encoding /Differences [ 0 /.notdef 48/zero/one/two/three/four/five/six/seven/eight 57/.notdef] >> endobj 5 0 obj << /Length1 864 /Length2 2630 /Length3 532 /Length 3256 /Filter /FlateDecode >> stream xRi<}ή!TTܖ2=a} -B3ٌH!{!,DdW&Y-~O?8qVÒ\AcPDh%q!PDSq$! j U(puM5M0 )8w* m S@ &hH`x`x@E@~vVH0Tt!Ln$@KR|齘2#$DX  1nY7bjn[ ?&_u4SA"} 0'aA WG8s%Z58 "1XK>&ao/씥ܟ+ZqD@2Qa?1$ .p+ur2#"%UM!p @C8" Fb"DeɄn$ ^U'0$7*;7RW`V#Ʀa!a h p@AIʸB"45Tj{,ƗBԽ10 1 s"3Pd|3Gv5FUdP9q-,(`AOC_Nðn*cOӬaQ>?/}Ӛc3N{3/i$Jnڨ_#[YZPWctt Aۙ\ދN7 6>{ǜe`dE6pzk%*Ɏ&CtDkJ$-t cԐ9z[6O[hB[@p[X aGY(fh:`0">B^]R] OQVb |PIz9[0 S%;5۰Hgo'y9S{Yᙕ߲索تMR -dTDh*iRِ*NlʔŧJ֘[+4Z8 @YgYbVDQ/k蒽P&-i; ]k\Xdg{p[ w&Dڔi\́*۰6<8{Uw+E,AlՌ/;gO?k &UiՙC";o  WxBL#1לL=Q~} r>rdێC,HIgE+MpqT`n̼SKF=P*#I6K1.PZx:smD3e4u Nۘ7y,fe^|ڀL#}L9hصvՁS " Q\;DM35tqLzΣFkoh#zhxoWZ/ɫg}<"T*OiƆ>=yY'()>Y/ r╂K\o?~- sg[ň+Z?6Qmܯ8bʍY (>]Lśef]拫\*ț]sJa1VNYщoqBdWDVvg{KZh'^ $]|D@ 1A>Vul7S̒.ԿrAguڰgxlw[뤶\=ކOtk˚ϬI{\L#:WSU,Үe_M|w峚@c\1̶l|Kh^*"p!fY.I!VU5߰cr8Rjo3/<'.=tl,,=f{bIXA:ťM+Kh]\اǞZBV5aU[!&3lWl^SIv̴,hZDS;NmKkݘ*`mll'>CP"%5l<)TymglH֜]ts.I-b?Rq[V5r˃qlv>|%0&NʹLv82do(H%7^ 9+Q_<Gk*!ittk7/O.,(ByI eD7 Bb)CX͈\ P|Z6l}{D.jq:ܚLR_tR79E/U}rd۽poq,q#:ߩçkDΓds<=Rh7h'^ ll?z5% '[ @)TMrendstream endobj 6 0 obj << /Type /Font /Subtype /Type1 /Encoding 28 0 R /FirstChar 58 /LastChar 101 /Widths 29 0 R /BaseFont /KPFVCE+CMMI12 /FontDescriptor 4 0 R >> endobj 4 0 obj << /Ascent 694 /CapHeight 683 /Descent -194 /FontName /KPFVCE+CMMI12 /ItalicAngle -14 /StemV 65 /XHeight 431 /FontBBox [-30 -250 1026 750] /Flags 4 /CharSet (/period/comma/K/L/R/a/e) /FontFile 5 0 R >> endobj 29 0 obj [272 272 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 833 666 0 0 0 0 0 745 0 0 0 0 0 0 0 0 0 0 0 0 0 0 514 0 0 0 454 ] endobj 28 0 obj << /Type /Encoding /Differences [ 0 /.notdef 58/period/comma 60/.notdef 75/K/L 77/.notdef 82/R 83/.notdef 97/a 98/.notdef 101/e 102/.notdef] >> endobj 19 0 obj << /Type /Pages /Count 1 /Kids [2 0 R] >> endobj 30 0 obj << /Type /Catalog /Pages 19 0 R >> endobj 31 0 obj << /Producer (pdfTeX-0.14h) /Creator (TeX) /CreationDate (D:20040401224100) >> endobj xref 0 32 0000000000 65535 f 0000001298 00000 n 0000001186 00000 n 0000000009 00000 n 0000021060 00000 n 0000017530 00000 n 0000020904 00000 n 0000017116 00000 n 0000013784 00000 n 0000016963 00000 n 0000012795 00000 n 0000006101 00000 n 0000012638 00000 n 0000005649 00000 n 0000003242 00000 n 0000005492 00000 n 0000002910 00000 n 0000001413 00000 n 0000002755 00000 n 0000021558 00000 n 0000003154 00000 n 0000003127 00000 n 0000005946 00000 n 0000005903 00000 n 0000013369 00000 n 0000013132 00000 n 0000017406 00000 n 0000017351 00000 n 0000021398 00000 n 0000021277 00000 n 0000021616 00000 n 0000021667 00000 n trailer << /Size 32 /Root 30 0 R /Info 31 0 R >> startxref 21762 %%EOF php/davison_.php0000644000175100017510000001140711613172741013162 0ustar keithkeith=0 && bccomp($b,"0")>=0 && bccomp($c,"0")>=0 && bccomp($d,"0")>=0){ return("1"); }else{ return("0"); } } /* nprod($l,$m) finds the least n such that A_n and D=A_0...A_n are * non-negative. * The matrix of global variables D=[$globala,$globalb,$globalc,$globald] is * returned along with n. See Proposition 4.1, J.L. Davison, 'An algorithm for * the continued fraction of e^{l/m}', Proceedings of the Eighth Manitoba * Conference on Numerical Mathematics and Computing (Univ. Manitoba, Winnipeg, * 1978), 169--179, Congress. Numer., XXII, Utilitas Math. */ function nprod($l,$m){ global $globala; global $globalb; global $globalc; global $globald; $globala=bcadd($m,$l); $globalb=$m; $globalc=$m; $globald=bcsub($m,$l); for($k="1";bccomp($k,"1")>=0;$k=bcadd($k,"1")){ $s=positivity($globala,$globalb,$globalc,$globald); if(bccomp($s,"0")>0){ break; } $temp=bcmul("2",$k); $temp=bcadd($temp,"1"); $t=bcmul($temp,$m); $t1=bcadd($globala,$globalb); $t2=bcadd($globalc,$globald); $temp1=bcmul($t,$t1); $temp2=bcmul($t,$t2); $temp=bcmul($globala,$l); $a1=bcadd($temp1,$temp); $temp=bcmul($globalb,$l); $b1=bcsub($temp1,$temp); $temp=bcmul($globalc,$l); $c1=bcadd($temp2,$temp); $temp=bcmul($globald,$l); $d1=bcsub($temp2,$temp); $globala=$a1; $globalb=$b1; $globalc=$c1; $globald=$d1; } $temp=bcsub($k,"1"); return($temp); } function reduce($a,$b,$c,$d){ $g=gcd($a,$b); $g=gcd($g,$c); $g=gcd($g,$d); return($g); } /* Raney factorization - G.N. Raney, Math, Annalen 206 (1973) 265-283. * Input: a non-singular matrix A=[p,q;r,s], p,q,r,s>=0, A!=I_2, A!=[0,1;1,0]. * With L=[1,0;1,1] and R=[1,1;0,1], we express A uniquely as * a product of non-negative powers of L and R, followed by a row-balanced B. * B=[a,b;c,d] is row-balanced if (ad) or (cb) * and a,b,c>=0. */ function raney($p,$q,$r,$s){ global $count; global $flagl; global $flagr; global $globall; global $globalr; global $globala; global $globalb; global $globalc; global $globald; $k="0"; while("1"){ $i="0"; while(bccomp($p,$r)>=0 && bccomp($q,$s)>=0){ $p=bcsub($p,$r); $q=bcsub($q,$s); $i=bcadd($i,"1"); } if(bccomp($i,"0")>0){ $globalr=bcadd($globalr,$i); $flagr="1"; $temp=bcmul($flagl,$flagr); if(bccomp($temp,"1")==0){ $flagl="0"; print "$globall, "; flush(); $globall="0"; $count=bcadd($count,"1"); } $k=bcadd($k,"1"); } $j="0"; while(bccomp($r,$p)>=0 && bccomp($s,$q)>=0){ $r=bcsub($r,$p); $s=bcsub($s,$q); $j=bcadd($j,"1"); } if(bccomp($j,"0")>0){ $globall=bcadd($globall,$j); $flagl="1"; $temp=bcmul($flagl,$flagr); if(bccomp($temp,"1")==0){ $flagr="0"; print "$globalr, "; flush(); $globalr="0"; $count=bcadd($count,"1"); } $k=bcadd($k,"1"); } if((bccomp($p,$r)<0 && bccomp($q,$s)>0) || (bccomp($p,$r)>0 && bccomp($s,$q)>0)){ break; } } $globala=$p; $globalb=$q; $globalc=$r; $globald=$s; return($k); } /* We perform the algorithm of J.L. Davison's paper. * With n>=0, we first find the n* of Davison's Proposition 4.1 * and apply raney's factorisation to A_0...A_k, for n*<=k<=n*+n. * The number (count) of partial quotients of e^{l/m} found is returned. * count becomes positive for all large n. */ function davison($l,$m,$n){ global $count; global $flagl; global $flagr; global $globall; global $globalr; global $globala; global $globalb; global $globalc; global $globald; $count="0"; $flagr="0"; $flagl="0"; $globalr="0"; $globall="0"; $k=nprod($l,$m); $g=reduce($globala,$globalb,$globalc,$globald); if(bccomp($g,"1")>0){ $globala=bcdiv($globala,$g); $globalb=bcdiv($globalb,$g); $globalc=bcdiv($globalc,$g); $globald=bcdiv($globald,$g); } $i=$k; $j=bcadd($k,$n); while(bccomp($i,$j)<=0){ if(bccomp($i,$k)>0){ $temp=bcmul("2",$i); $temp=bcadd($temp,"1"); $t=bcmul($temp,$m); $t1=bcadd($globala,$globalb); $t2=bcadd($globalc,$globald); $temp1=bcmul($t,$t1); $temp2=bcmul($t,$t2); $temp=bcmul($globala,$l); $a1=bcadd($temp1,$temp); $temp=bcmul($globalb,$l); $b1=bcsub($temp1,$temp); $temp=bcmul($globalc,$l); $c1=bcadd($temp2,$temp); $temp=bcmul($globald,$l); $d1=bcsub($temp2,$temp); $globala=$a1; $globalb=$b1; $globalc=$c1; $globald=$d1; } $i=bcadd($i,"1"); $t=raney($globala,$globalb,$globalc,$globald); /* the input matrix will not be I_2 or [0,1;1,0] here. */ $g=reduce($globala,$globalb,$globalc,$globald); if(bccomp($g,"1")>0){ $globala=bcdiv($globala,$g); $globalb=bcdiv($globalb,$g); $globalc=bcdiv($globalc,$g); $globald=bcdiv($globald,$g); } } return($count); } ?> php/davison.php0000644000175100017510000000334713141532117013022 0ustar keithkeith Finding the continued fraction of e<sup>l/m</sup> \n"; }else{ $l=$Lvalue; $m=$Mvalue; $n=$Nvalue; while("1"){ if(bccomp($l,"0")<=0){ print "$l 0
\n"; break; } if(bccomp($m,"0")<=0){ print "m 0
\n"; break; } if(bccomp($n,"0")<0){ print "n < 0
\n"; break; } if(bccomp($n,"10000")>0){ print "n > 10000
\n"; break; } if(bccomp($l,"10000")>0){ print "n > 10000
\n"; break; } $g=gcd($l,$m); $l=bcdiv($l,$g); $m=bcdiv($m,$g); $t=bcmul("14",$m); if(bccomp($l,$t)>0){ print "l > 14m
\n"; break; } $count=davison($l,$m,$n); echo "
\n"; flush(); echo "The number of partial quotients found for "; if(bccomp($m,"1")=="1"){ echo "e$l / $m"; }else{ echo "e$l"; } echo " is $count
\n"; flush(); break; } } print "

\n"; print "Return to main page
\n"; ?> php/ddzero-extra_improved.php0000644000175100017510000000456113574623633015711 0ustar keithkeith 1 is a divisor of m, as well as u. # The idea is due to Chi Chon Lei November 19th, 2019. Alan Offer coded the important apr function. function improvement($u,$v,$sol,$m,$a,$b,$d,$e){ global $globaloutput_array; global $globaloutput_array_number; global $divisor; $bu=bcmul($b,$u); $minusbu=bcminus($bu); $twoa=bcmul("2",$a); $minusbuover2a=bcdiv($minusbu,$twoa); $g=divisors($m,"0"); # now we have divisors divisor[0]=1, ...,divisor[g-1], which I think are in order of magnitude $tcount="0"; #for($i=1;lt($i,$g);$i=bcadd($i,"1")){ # $temp=bcsub($g,$i); # print "divisor[$temp]=$divisor[$i],"; #} #print "
\n"; for($i="1";lt($i,$g);$i=bcadd($i,"1")){# we start with the greatest divisor > 1 of m $temp=bcsub($g,$i); $nn=$divisor[$temp]; $temp=bcmod($u,$nn); if(ezero($temp)){ $dd=bcdiv(bcabs($u),$nn); #print "(u,v,m,dd,nn)=($u,$v,$m,$dd,$nn)
\n"; $h=apr($sol,$m,$dd,$nn); if(eq($h,"1")){ continue; } $k=bcdiv($m,$nn); for($j="0";lt($j,$k);$j=bcadd($j,"1")){ $c[$j]=$globaloutput_array[$j]; $cjsquared=bcmul($c[$j],$c[$j]); $cjsquaredminusv=bcsub($cjsquared,$v); $r=bcdiv($cjsquaredminusv,$u); $s=bcmul("2",$c[$j]); $bs=bcmul($b,$s); $uminusbs=bcsub($u,$bs); $uminusbsovertwoa=bcdiv($uminusbs,$twoa); $dplusbr=aplusbc($d,$b,$r); $cjminusdplusbr=bcsub($c[$j],$dplusbr); $cjminusdplusbrovertwoa=bcdiv($cjminusdplusbr,$twoa); $xarray[2]=$minusbuover2a; $xarray[1]=$uminusbsovertwoa; $xarray[0]=$cjminusdplusbrovertwoa; $yarray[2]=$u; $yarray[1]=$s; $yarray[0]=$r; $tvar="(t/N)"; print "x="; printpolyx($xarray,"2",$tvar); print "
\n"; print "y="; printpolyx($yarray,"2",$tvar); print "
\n"; print "where N = $nn
\n"; print "c[$tcount]=$c[$j]
\n"; print "-----
\n"; $tcount=bcadd($tcount,"1"); } print "We have $globaloutput_array_number reduced solution families
\n"; return; } } } ?> php/ddzero-extra.php0000644000175100017510000000361413573637602014002 0ustar keithkeith 1 is a divisor of m, as well as u. # The idea is due to Chi Chon Lei November 19th, 2019. Alan Offer coded the important apr function. function improvement($u,$v,$sol,$m,$a,$b,$d,$e){ global $globaloutput_array; global $globaloutput_array_number; global $divisor; $bu=bcmul($b,$u); $bv=bcmul($b,$v); $minusbu=bcminus($bu); $twoa=bcmul("2",$a); $twob=bcmul("2",$b); $twobu=bcmul($twob,$u); $bdu4=bcmul3("4",$d,$bu); $bsquared4v=bcmul3("4",$b,$bv); $abu8=bcmul3("8",$a,$bu); $temp=bcsub($bsquared4v,$bdu4); $r=aplusbc($temp,$u,$u); $g=divisors($m,"0"); # now we have divisors divisor[0]=1, ...,divisor[g-1], which I think are in order of magnitude $tcount="0"; #for($i=1;lt($i,$g);$i=bcadd($i,"1")){ # $temp=bcsub($g,$i); # print "divisor[$temp]=$divisor[$i],"; #} #print "
\n"; for($i="1";lt($i,$g);$i=bcadd($i,"1")){# we start with the greatest divisor > 1 of m $temp=bcsub($g,$i); $nn=$divisor[$temp]; $temp=bcmod($u,$nn); if(ezero($temp)){ $dd=bcdiv(bcabs($u),$nn); #print "(u,v,m,dd,nn)=($u,$v,$m,$dd,$nn)
\n"; $h=apr($sol,$m,$dd,$nn); if(eq($h,"1")){ continue; } $k=bcdiv($m,$nn); for($j="0";lt($j,$k);$j=bcadd($j,"1")){ $c[$j]=$globaloutput_array[$j]; print "c[$tcount]=$c[$j]
\n"; $tcount=bcadd($tcount,"1"); $twobtimescj=bcmul($twob,$c[$j]); $temp1=bcsub($twobtimescj,$u); print "x=($minusbu/$twoa)(k/$nn + ($temp1/$twobu))2 + ($r/$abu8)
\n"; print "y=$u(k/$nn + ($c[$j]/$u))2 - ($v/$u)
\n"; } print "We have $globaloutput_array_number reduced solution families
\n"; return; } } } ?> php/decimal2rational.html0000644000175100017510000000404511625277407014757 0ustar keithkeith Calculating the rational whose base b digits are given

Calculating the rational z whose base b digits are given

Here the pre-period, ak-1,...,a0 (if present) and period br-1,...,b0 consist of integers in the range [0,b – 1].
Thus z = ak-1/b + ··· +a0/bk + br-1/bk+1 + ··· +b0/bk+r + ···

If there is no pre-period, simply enter 0 0 in the pre-period box below.

If x = ak-1bk-1 + ··· +a0 and y = br-1br – 1 + ··· +b0, then

z={x(br – 1) + y}/{bk(br – 1)}.

If there is no preperiod, then z=y/(br – 1).

Example. Take b = 10, a0 = 2, a1 = 0, b0 = 1, b1 = 3, so that z = ·023131···.
Then z = 229/9900.

Enter the pre-period digits 0 ≤ ai ≤ b – 1, (or 0 0 if no pre-period), separated by spaces:

Enter the period digits 0 ≤ bj ≤ b – 1, separated by spaces:

Enter b (>1):

Last modified 9th February 2007
Return to main page php/decimal2rational_.php0000644000175100017510000000254711610602351014726 0ustar keithkeith\n"; return; } ?> php/decimal2rational.php0000644000175100017510000000515312747227364014606 0ustar keithkeith Return to main page
\n"; return; } if(le($Bvalue,"1")){ print "b ≤ 1
\n"; print "Return to main page
\n"; return; } $base=$Bvalue; if(eq($p,"2") && ezero($a["0"]) && ezero($a["1"])){ $flag="1"; /* purely periodic */ }else{ $flag="0"; } if(ezero($flag)){ for($i="0";lt($i,$p);$i=bcadd($i,"1")){ $check=check_decimal($a[$i]); if(ezero($check)){ print "

\n"; flush(); print "Return to main page
\n"; return; } if(ltzero($a[$i]) || ge($a[$i],$base)){ print "a[$i] < 0 or a[$i] ≥ $base
\n"; flush(); print "Return to main page
\n"; return; } } } $bzeroflag="0"; for($i="0";lt($i,$q);$i=bcadd($i,"1")){ $check=check_decimal($b[$i]); if (ezero($check)){ print "

\n"; flush(); print "Return to main page
\n"; return; } if(ltzero($b[$i]) || ge($b[$i],$base)){ print "b[$i] < 0 or b[$i] ≥ $base
\n"; flush(); print "Return to main page
\n"; return; } if(gtzero($b[$i])){ $bzeroflag="1"; } } if(ezero($bzeroflag)){ echo "all period digits are zero
\n"; print "Return to main page
\n"; return; } if(eq($flag,"1")){ $p="0"; $pre[0]="0"; }else{ for($i="0";lt($i,$p);$i=bcadd($i,"1")){ $temp=bcsub($p,"1"); $temp=bcsub($temp,$i); $pre[$i]=$a[$temp]; } } for($j="0";lt($j,$q);$j=bcadd($j,"1")){ $temp=bcsub($q,"1"); $temp=bcsub($temp,$j); $per[$j]=$b[$temp]; } d2r($pre,$per,$p,$q,$base); print "Return to main page
\n"; flush(); ?> php/decimal.html0000644000175100017510000000136411625277412013140 0ustar keithkeith Finding the digits of a positive rational to base b

Finding the digits of m/n to base b

Here m,n,b (b>1) are positive integers, 1 ≤ m < n.

See description of the algorithm.

Enter m (≥ 1):
Enter n (m < n):
Enter b (>1):

Last modified 18th June 2010
Return to main page php/decimal_.php0000644000175100017510000000221011610602442013076 0ustar keithkeith\n"; flush(); if(gtzero($j)){ if(gt($j,"1")){ echo "$j preperiod digits: "; }else{ echo "1 preperiod digit: "; } for($k="1";le($k,$j);$k=bcadd($k,"1")){ echo "$a[$k],"; } }else{ echo "no preperiod digit "; } echo "
\n"; $s=bcsub($i,$j); if(gt($s,"1")){ echo "$s period digits: "; }else{ echo "1 period digit: "; } $t=bcadd($j,"1"); for($k=$t;le($k,$i);$k=bcadd($k,"1")){ echo "$a[$k]"; flush(); if(lt($k,$i)){ echo ","; } } echo "
\n"; return; } ?> php/decimal.php0000644000175100017510000000225312747227174012767 0ustar keithkeith \n"; }else if(lezero($Mvalue)){ print "m ≤ 0
\n"; }else if(le($Nvalue,$Mvalue)){ print "n ≤ m
\n"; }else if(le($Bvalue,"1")){ print "b ≤ 1
\n"; }else{ $g=gcdpos($Mvalue,$Nvalue); $Mvalue=bcdiv($Mvalue,$g); $Nvalue=bcdiv($Nvalue,$g); if(bccomp($Nvalue,"1")<=0){ print "n ≤ 1
\n"; }else if(bccomp($Mvalue,$Nvalue)>=0){ print "m ≥ n
\n"; }else if(bccomp($Bvalue,"1")<=0){ print "b ≤ 1
\n"; }else{ period($Mvalue,$Nvalue,$Bvalue); } } print "

\n"; print "Return to main page
\n"; ?> php/discrete_log.html0000644000175100017510000000241511625277415014206 0ustar keithkeith Shanks baby-steps/giant-steps algorithm for finding the discrete log

Shanks baby-steps/giant-steps algorithm for finding the discrete log

We attempt to solve the congruence gx ≡ b (mod m), where m > 1, gcd(g,m) = 1 = gcd(b,m).
The solution, if it exists, is unique (mod n), where n = ordmg.
m has to satisfy m < 232 – 216 = 4294901760 here.
(See MP313 notes for the case where m is a prime.)

Enter b:
Enter g:
Enter m (4294901760 > m > 1):

Last modified 20th July 2004
Return to main page php/discrete_log_.php0000644000175100017510000000465210443474215014167 0ustar keithkeith"1"){ $temp=bcadd($j,$k); $t=bcdiv($temp,"2"); $l=$a[$t]; if($i==$l){ return($t); } if($i<$l){ $k=$t; } if($i>$l){ $j=$t; } $s=bcsub($k,$j); } if($i==$a[$j]){ return($j); } if($i==$a[$k]){ return($k); } return("-1"); } /* From Algorithms, by R. Sedgewick, p. 118. * Here the arrays globala[],globalb[] are global, being * produced by program shanks() below. * Initially b[k]=k, while at the end of sorting, * b[i]<-s[i], where s is the sorting permutation * and a[i]<-a[s[i]]. */ function quicksort($l,$r){ global $globala; global $globalb; if($r>$l){ $v=$globala[$r]; $i=bcsub($l,"1"); $j=$r; while($j>$i){ while("1"){ $i=bcadd($i,"1"); if($globala[$i]>=$v){ break; } } while("1"){ $j=bcsub($j,"1"); if($globala[$j]<=$v){ break; } } $t=$globala[$i]; $z=$globalb[$i]; $globala[$i]=$globala[$j]; $globalb[$i]=$globalb[$j]; $globala[$j]=$t; $globalb[$j]=$z; } $globala[$j]=$globala[$i]; $globalb[$j]=$globalb[$i]; $globala[$i]=$globala[$r]; $globalb[$i]=$globalb[$r]; $globala[$r]=$t; $globalb[$r]=$z; $x=quicksort($l,bcsub($i,"1")); $y=quicksort(bcadd($i,"1"),$r); }else { return("0"); } } /* From O. Forster, "Algorithmische Zahlentheorie", Vieweg 1996, 65-66. * returns y, 0<=y php/discrete_log.php0000644000175100017510000000261312747226553014034 0ustar keithkeith \n"; } else{ while("1"){ if(bccomp($Mvalue,"2")<0){ print "m < 2
\n"; break; } $temp=gcd($Gvalue,$Mvalue); if($temp>"1"){ print "gcd(g,m)>1
\n"; break; } $temp=gcd($Bvalue,$Mvalue); if($temp>"1"){ print "gcd(b,m)>1
\n"; break; } if($Mvalue>="4294901760"){ print "m ≥ 232-216
\n"; } $number=shanks($Bvalue,$Gvalue,$Mvalue); print "The congruence $Gvalue x $Bvalue (mod $Mvalue) has "; if($number!="-1"){ print " the solution "; $temp=orderm($Gvalue,$Mvalue); print "x $number (mod $temp)
\n"; }else{ print "no solution
\n"; } break; } } print "

\n"; print "Return to main page
\n"; ?> php/divisors.html0000644000175100017510000000260512240615766013405 0ustar keithkeith Finding the divisors of a positive integer

Finding the divisors of a positive integer

The underlying BC program was devised by Alan Offer on 28th December 2011.
It steps through the exponent vectors arising from the canonical factorization of each divisor.
We use a primitive factoring program which uses the Brent-Pollard algorithm and Pollard's p-1 algorithm. It should work on integers with no more than 20 digits.
E = 0 prints the divisors, E = 1 also prints the canonical factorizations of each divisor

Enter n (> 1):
Enter E (0 or 1):

Last modified 9th January 2012
Return to number-theoretic functions page
php/divisors.php0000644000175100017510000000171512747017775013241 0ustar keithkeith \n"; }else{ $n=$Nvalue; if(lt($n,"1")){ print "n < 1
\n"; }else{ if(lt($n,"2")){ $t="1"; print "1 is the only divisor of 1
\n"; }else{ $e=$Evalue; if(eq($e,"0")){ $t=divisors($n,"1"); }else{ $t=exps($n); } print "
\n"; print "$n has $t divisors
\n"; } } } print "
\n"; print "Return to main page
\n"; ?> php/dujella_minus.html0000644000175100017510000000456413763561350014404 0ustar keithkeith Testing Dujella's unicity conjecture

Testing Dujella's unicity conjecture

The conjecture states that the diophantine equation x2 – (k2 + 1)y2 = k2 has at most one positive solution (x,y) with 1 ≤ y < k – 1. (For background, see slides.)

This program deals with an equivalent diophantine equation, namely X2 – (k2 + 1)Y2 = -k2. The positive integral solutions (x,y) with 1 ≤ y < k –1 are in 1-1 correspondence with the positive solutions (X,Y) with 1 < Y < k of the equation X2 – 1 = (k2 + 1)(Y2 – 1) under the mapping x = (k2 – 1)Y – kX, y = kY – X. (This was observed by John Robertson.)

So Dujella's unicity conjecture is equivalent to there being at most one positive integer solution (X,Y) satisfying 1 < Y < k. In fact we can show that such a solution must satisfy Y < k/2, which implies 1 < X < (k2 + 1)/2.
Accordingly, we look for solutions of the congruence X2 ≡ 1 mod(k2 + 1) satisfying 1 < X < (k2 + 1)/2 and for which (X2 – 1)/(k2 + 1) = Y2 – 1. Note that if k is odd, then k2 + 1 = 2(2m + 1).

We test the conjecture for k in the range m ≤ k ≤ n, where n < 105, exhibiting the k for which an exceptional solution exists.

Enter m (1 < m < 105 ):
Enter n (1 < m ≤ n < 105 ):

Last modified 23rd November 2014
Return to main page
php/dujella_minus_.php0000644000175100017510000000575112434346242014360 0ustar keithkeith\n";*/ } $t=exponential("2",$n); for($j="0";lt($j,$t);$j=bcadd($j,"1")){ $temp=bcmod($k,"2"); if(neqzero($temp)){ /* Note that if k is odd, k^2+1=2xodd */ $temp=bcmod($j,"2"); if(ezero($temp)){ $x=randomarray($j,$n,"0"); }else{ continue; } }else{ $x=randomarray($j,$n,"0"); } /*for($i="0";lt($i,$n);$i=bcadd($i,"1")){ print "global_digits[$i]=$global_digits[$i]
\n"; }*/ $number=chinesea($global_digits,$primepowerglobal,$n); $x=$chinese_solution; if(gt($x,"1") && le($x,$kkover2)){ $temp=aplusbc("-1",$x,$x); $z=bcdiv($temp,$kk); $zplus1=bcadd($z,"1"); $g=squaretest($zplus1); if(gt($g,"1") && lt($g,$k)){ $temp1=abminuscd($kk,$g,$k,$x); $temp2=aminusbc($x,$k,$g); $temp2=bcminus($temp2); print "k=$k: (X, Y) = ($x, $g), (x, y) = ($temp1, $temp2)
\n"; $count=bcadd($count,"1"); } } } /* end of for loop */ return($count); } /* m < 2^array_length */ function randomarray($m,$array_length,$flag){ global $global_binary_digit; global $global_digits; $t=$array_length; $r=binaryexpansion($m,"0"); for($i="0";lt($i,$t);$i=bcadd($i,"1")){ $global_digits[$i]="1"; } for($i="0";lt($i,$r);$i=bcadd($i,"1")){ if(eq($global_binary_digit[$i],"1")){ $global_digits[$i]="-1"; } if(neqzero($flag)){ print "$global_digits[$i] "; } } if(neqzero($flag)){ print "
\n"; } } function binaryexpansion($n,$flag){ global $global_binary_digit; $i="0"; while(neqzero($n)){ $temp=bcmod($n,"2"); $global_binary_digit[$i]=$temp; $i=bcadd($i,"1"); $n=bcdiv($n,"2"); } $g=$i; if(neqzero($flag)){ for($i="0";lt($i,$g);$i=bcadd($i,"1")){ print "binary digit $i = $global_binary_digit[$i] "; } print "
\n"; } return($g); } function chinesearray($a,$m,$n){ $m1=$m["0"]; $x=$a["0"]; for($i="1";lt($i,$n);$i=bcadd($i,"1")){ $x=chinese0($a[$i],$x,$m[$i],$m1); $m1=lcm($m[$i],$m1); } return($x); } function test($m,$n){ $count="0"; for($k=$m;le($k,$n);$k=bcadd($k,"1")){ $r=negdujella($k); if(eq($r,"1")){ $count=bcadd($count,"1"); } if(gt($r,"1")){ print "counter-example
\n"; return("-1"); } } return($count); } function squaretest($n){ $g=bcsqrt($n); $temp=bcmul($g,$g); if(eq($temp,$n)){ return($g); }else{ return("-1"); } } ?> php/dujella_minus.php0000644000175100017510000000223112747031772014215 0ustar keithkeith \n"; } else{ if(bccomp($Mvalue,"2")<0){ print "m < 2
\n"; }else if(bccomp($Nvalue,"2")<0){ print "n < 2
\n"; }else if(bccomp($Mvalue,"100000")>0){ print "m > 100000
\n"; }else if(bccomp($Nvalue,"100000")>0){ print "n > 100000
\n"; }else{ if(gt($Mvalue,$Nvalue)){ print "m>n
\n"; print "Return to main page
\n"; return; } $t=test($Mvalue,$Nvalue); print "The number of k possessing a unique exceptional solution is $t
\n"; } } print "

\n"; print "Return to main page
\n"; ?> php/dujella_test.html0000644000175100017510000000461013763561262014222 0ustar keithkeith Testing Dujella's unicity conjecture

Testing Dujella's unicity conjecture

The conjecture states that the diophantine equation x2 - (k2 + 1)y2 = k2 has at most one positive solution (x,y) with 1 ≤ y < k-1. (For background, see slides.)

We test the conjecture for k in the range m ≤ k ≤ n, where n < 105, exhibiting the k for which an exceptional solution exists.

If (x,y) is an exceptional solution, let d = gcd(x + k, x − k), a = gcd((x + k)/d, k2 + 1), b = gcd((x − k)/d, k2 + 1), p2 = (x+k)/da, q2 = (x-k)/db. Then ab = k2 + 1, 2 < a, 2 < b, gcd(a,b) = 1, d divides 2k, (d distinct from k and 2k, and d is even if k is odd) and ap2 - bq2 = 2k/d with gcd(p,q)=1.

(p,q) is found by considering the initial period of the continued fraction of √(b/a) (we can assume a < b by interchange): if d > 1, then p/q = Am/Bm (a convergent), where Qm+1 = 2k/d, whereas if d = 1, then p/q = (Am + eAm-1)/(Bm + eBm-1), (a quasi-convergent) where | Qm - Qm+1 + 2ePm+1 | =2k.

We verify that the unicity conjecture holds for k, by showing that there is at most one (d,a,b) for which a solution (p,q) exists and in the case of solubility, that we have precisely one solution (p,q) of ap2 - bq2 = ± 2k/d with gcd(p,q)=1 and satisfying dpq < k-1.

Enter m (1 < m < 1010 ):
Enter n (1 < m ≤ n < 1010 ):

Last modified 5th February 2015
Return to main page
php/dujella_test.php0000644000175100017510000000207612747031646014050 0ustar keithkeith \n"; } else{ if(bccomp($Mvalue,"2")<0){ print "m < 2
\n"; }else if(bccomp($Nvalue,"2")<0){ print "n < 2
\n"; }else if(bccomp($Mvalue,"10000000000")>0){ print "m > 10000000000
\n"; }else if(bccomp($Nvalue,"10000000000")>0){ print "n > 10000000000
\n"; }else{ if(gt($Mvalue,$Nvalue)){ print "m>n
\n"; print "Return to main page
\n"; return; } $t=dujellacfractest($Mvalue,$Nvalue); } } print "

\n"; print "Return to main page
\n"; ?> php/ecubed_table0000644000175100017510001023421213142467263013177 0ustar keithkeith0 20 1 11 2 1 3 2 4 4 5 3 6 1 7 5 8 1 9 2 10 16 11 1 12 1 13 16 14 2 15 13 16 14 17 4 18 6 19 2 20 1 21 1 22 2 23 2 24 2 25 3 26 5 27 1 28 3 29 1 30 1 31 68 32 7 33 5 34 1 35 4 36 2 37 1 38 1 39 1 40 1 41 1 42 1 43 7 44 3 45 1 46 6 47 1 48 2 49 5 50 4 51 7 52 2 53 1 54 3 55 2 56 2 57 1 58 2 59 1 60 4 61 1 62 1 63 13 64 1 65 1 66 2 67 1 68 1 69 1 70 1 71 3 72 7 73 11 74 18 75 54 76 1 77 2 78 2 79 2 80 1 81 1 82 6 83 2 84 2 85 46 86 2 87 189 88 1 89 24 90 1 91 8 92 13 93 4 94 1 95 1 96 1 97 3 98 1 99 1 100 1 101 1 102 1 103 2 104 7 105 5 106 4 107 3 108 8 109 1 110 1 111 1 112 2 113 8 114 1 115 1 116 1 117 1 118 3 119 1 120 3 121 2 122 1 123 2 124 6 125 3 126 15 127 4 128 1 129 1 130 77 131 1 132 2 133 492 134 1 135 1 136 48 137 4 138 6 139 2 140 7 141 1 142 9 143 2 144 1 145 3 146 6 147 1 148 15 149 1 150 4 151 7 152 1 153 1 154 1 155 4 156 1 157 3 158 1 159 34 160 3 161 5 162 16 163 4 164 1 165 6 166 4 167 1 168 1 169 9 170 2 171 67 172 3 173 3 174 3 175 110 176 1 177 1 178 1 179 2 180 1 181 1 182 4 183 27 184 6 185 2 186 11 187 1 188 3 189 4 190 1 191 8 192 4 193 1 194 1 195 13 196 9 197 1 198 2 199 1 200 2 201 1 202 19 203 2 204 4 205 3 206 24 207 1 208 5 209 3 210 1 211 739 212 1 213 62 214 1 215 1 216 2 217 1 218 5 219 1 220 2 221 5 222 1 223 1 224 6 225 1 226 1 227 23 228 1 229 3 230 1 231 2 232 3 233 35 234 1 235 2 236 2 237 1 238 3 239 2 240 3 241 4 242 1 243 9 244 2566 245 12 246 8 247 3 248 9 249 1 250 2 251 2 252 1 253 1 254 1 255 13 256 5 257 1 258 1 259 1 260 3 261 1 262 1 263 1 264 423 265 1 266 3 267 1 268 1 269 2 270 4 271 1 272 1 273 1 274 1 275 11 276 9 277 1 278 1 279 71 280 1 281 1 282 2 283 1 284 1 285 3 286 2 287 1 288 1 289 3 290 694 291 1 292 1 293 3 294 1 295 1 296 21 297 3 298 3 299 1 300 3 301 1 302 51 303 1 304 17 305 1 306 4 307 21 308 1 309 66 310 1 311 17 312 6 313 3 314 1 315 1 316 3 317 3 318 1 319 1 320 1 321 3 322 2 323 2 324 3 325 5 326 23 327 1 328 2 329 42 330 4 331 1 332 1 333 1 334 3 335 1 336 3 337 1 338 71 339 1 340 1 341 4 342 1 343 3 344 1 345 11 346 3 347 3 348 4 349 2 350 16 351 4 352 2 353 5 354 1 355 1 356 2 357 1 358 7 359 5 360 1 361 8 362 14 363 1 364 5 365 3 366 1 367 6 368 1 369 5 370 2 371 42 372 1 373 4 374 1 375 2 376 2 377 1 378 1 379 3 380 6 381 1 382 1 383 1 384 28 385 3 386 2 387 1 388 5885 389 3 390 1 391 1 392 47 393 6 394 1 395 5 396 11 397 2 398 3 399 3 400 5 401 1 402 1 403 2 404 1 405 1 406 3 407 2 408 1 409 22 410 12 411 1 412 2 413 1 414 1 415 1 416 2 417 2 418 1 419 4 420 19 421 1 422 1 423 3 424 1 425 26 426 2 427 4 428 3 429 3 430 1 431 1 432 1 433 3 434 337 435 5 436 2 437 1 438 4 439 1 440 2 441 1 442 2 443 1 444 3 445 1 446 1 447 1 448 1 449 1 450 9 451 24 452 113 453 1 454 10 455 1 456 1 457 2 458 3 459 1 460 7 461 1 462 3 463 1 464 2 465 9 466 4 467 6 468 2 469 2 470 1 471 1 472 3 473 1 474 10 475 4 476 2 477 1 478 2 479 3 480 1 481 1 482 1 483 10 484 13 485 2 486 8 487 1 488 10 489 1 490 7 491 4 492 2 493 3 494 1 495 3 496 2 497 62 498 7 499 24 500 4 501 1 502 5 503 6 504 5 505 2 506 2 507 4 508 1 509 1 510 48 511 5 512 3 513 1 514 1 515 1 516 6 517 10 518 2 519 2 520 47 521 1 522 8 523 7 524 1 525 4 526 2 527 1 528 3 529 2 530 5 531 1 532 286 533 1 534 1 535 1 536 85 537 2 538 1 539 12 540 2 541 1 542 4 543 2 544 9 545 13 546 1 547 2 548 3 549 3 550 1 551 1 552 1 553 3 554 5 555 3 556 1 557 2 558 7 559 5 560 1 561 16 562 8 563 1 564 81 565 2 566 2 567 1 568 3 569 1 570 2 571 3 572 1 573 1 574 2 575 1 576 1 577 7 578 770 579 2 580 1 581 1 582 5 583 1 584 37 585 45 586 3 587 1 588 1 589 10 590 1 591 4 592 2 593 4 594 1 595 1 596 1 597 1 598 6 599 1 600 76 601 3 602 1 603 2 604 3 605 1 606 15 607 2 608 116 609 15 610 2 611 6 612 1 613 1 614 1 615 6 616 29 617 26 618 3 619 3 620 1 621 4 622 3 623 2 624 1 625 14 626 4 627 1 628 1 629 3 630 4 631 19 632 1 633 1 634 30 635 58 636 2 637 1 638 17 639 5 640 6 641 2 642 1 643 2 644 2 645 48 646 1 647 5 648 20 649 1 650 12 651 2 652 1 653 1 654 4 655 13 656 2 657 1 658 1 659 1 660 2 661 2 662 1 663 4 664 4 665 1 666 17 667 2 668 1 669 1 670 3 671 1 672 4 673 9 674 1 675 7 676 1 677 10 678 27 679 1 680 8 681 1 682 2 683 2 684 1 685 2 686 5 687 2 688 2 689 1 690 168 691 1 692 1 693 14 694 1 695 2 696 2 697 2 698 2 699 2 700 6 701 1 702 3 703 1 704 4 705 1 706 8 707 1 708 2 709 2 710 1 711 1 712 4 713 27 714 4 715 1 716 1 717 29 718 1 719 1 720 1 721 6 722 1 723 8 724 7 725 4 726 1 727 1 728 1 729 12 730 3 731 4 732 203 733 34 734 2 735 1 736 4 737 2 738 1 739 1 740 50 741 26 742 10 743 15 744 1 745 39 746 1 747 1 748 1 749 3 750 7 751 1 752 2 753 1 754 2 755 1 756 7 757 1 758 1 759 1 760 1 761 1 762 3 763 1 764 40 765 3 766 5 767 1 768 3 769 1 770 41 771 2 772 7 773 7 774 1 775 6 776 1 777 34 778 1 779 19 780 1 781 1 782 3 783 1 784 92 785 1 786 1 787 3 788 1 789 1 790 1 791 20 792 4 793 3 794 1 795 3 796 3 797 2 798 2 799 5 800 10 801 10 802 1 803 17 804 2 805 1 806 1 807 2 808 1 809 1 810 1 811 2 812 1 813 1 814 218 815 2 816 2 817 3 818 12 819 3 820 1 821 1 822 3 823 1 824 6 825 5 826 2 827 12 828 5 829 1 830 22 831 1 832 5 833 2 834 1 835 1 836 8 837 1 838 1 839 1 840 1 841 6 842 2 843 1 844 3 845 1 846 1 847 55 848 2 849 18 850 2 851 1 852 5 853 39 854 3 855 1 856 5 857 8 858 2 859 1 860 8 861 3 862 5 863 1 864 1 865 25 866 3 867 1 868 2 869 1 870 1 871 4 872 1 873 6 874 3 875 1 876 1 877 1 878 9 879 10 880 1 881 2 882 1 883 3 884 1 885 1 886 5 887 1 888 1 889 2 890 52 891 5 892 1 893 1 894 1 895 3 896 1 897 46 898 1 899 2 900 2 901 1 902 1 903 4 904 1 905 7 906 2 907 1 908 2 909 7 910 1 911 5 912 1 913 8 914 1 915 1 916 2 917 1 918 37 919 8 920 5 921 3 922 1 923 1 924 1 925 6 926 1 927 9 928 1 929 7 930 4 931 35 932 1 933 2 934 1 935 1 936 18 937 1 938 178 939 3 940 1 941 5 942 8 943 4 944 2 945 1 946 1 947 1 948 6 949 1 950 12 951 5 952 4 953 1 954 3 955 1 956 11 957 5 958 2 959 5 960 1 961 1 962 5 963 4 964 191 965 1 966 10 967 3 968 14 969 8 970 3 971 2 972 7 973 1 974 1 975 45 976 3 977 14 978 2 979 3 980 2 981 4 982 19 983 2 984 1 985 1 986 1 987 4 988 1 989 1 990 1 991 1 992 1 993 365 994 4 995 7 996 14 997 1 998 9 999 1 1000 1 1001 2 1002 1 1003 1 1004 16 1005 1 1006 1 1007 1 1008 1 1009 1 1010 2 1011 2 1012 1 1013 2 1014 2 1015 2 1016 3 1017 3 1018 1 1019 1 1020 1 1021 1 1022 2 1023 1 1024 3 1025 25 1026 2 1027 365 1028 1 1029 1 1030 1 1031 2 1032 3 1033 1 1034 2 1035 5 1036 26 1037 2 1038 30 1039 6 1040 10 1041 15 1042 3 1043 1 1044 1 1045 1 1046 4 1047 2 1048 24 1049 2 1050 1 1051 4 1052 1 1053 1 1054 1 1055 22 1056 1 1057 1 1058 1 1059 3 1060 1 1061 1 1062 2 1063 1 1064 1 1065 1 1066 48 1067 1 1068 5 1069 2 1070 1 1071 2 1072 1 1073 8 1074 1 1075 3 1076 6 1077 1 1078 2 1079 1 1080 30 1081 1 1082 77 1083 1 1084 2 1085 1 1086 1 1087 1 1088 1 1089 1 1090 1 1091 1 1092 1 1093 6 1094 1 1095 195 1096 1 1097 1 1098 5 1099 1 1100 1 1101 1 1102 1 1103 1 1104 2 1105 3 1106 5 1107 2 1108 2 1109 2 1110 1 1111 2 1112 2 1113 1 1114 6 1115 3 1116 150 1117 1 1118 12 1119 2 1120 4329 1121 1 1122 4 1123 47 1124 1 1125 1 1126 1 1127 3 1128 204 1129 2 1130 15 1131 2 1132 1 1133 1 1134 1 1135 2 1136 1 1137 10 1138 2 1139 1 1140 2 1141 16 1142 1 1143 1 1144 8 1145 1 1146 22 1147 19 1148 16 1149 1 1150 1 1151 1 1152 6 1153 1 1154 3 1155 3 1156 2 1157 9 1158 1 1159 1 1160 10 1161 1 1162 41 1163 4 1164 2 1165 7 1166 2 1167 5 1168 1 1169 3 1170 3 1171 1 1172 1 1173 1 1174 1 1175 214 1176 1 1177 3 1178 10 1179 5 1180 2 1181 12 1182 1 1183 5 1184 2 1185 1 1186 128 1187 1 1188 2 1189 6 1190 1 1191 5 1192 3 1193 1 1194 2 1195 3 1196 2 1197 2 1198 5 1199 2 1200 31 1201 1 1202 1 1203 26 1204 3 1205 7 1206 2 1207 4 1208 2 1209 2 1210 1 1211 1 1212 1 1213 2 1214 3 1215 2 1216 1 1217 2 1218 5 1219 11 1220 1 1221 48 1222 1 1223 2301 1224 1 1225 14 1226 33 1227 1 1228 1 1229 2 1230 2 1231 14 1232 1 1233 1 1234 5 1235 1 1236 115 1237 1 1238 1 1239 25 1240 5 1241 13 1242 3 1243 16 1244 1 1245 1 1246 2 1247 2 1248 6 1249 1 1250 1 1251 3 1252 1 1253 4 1254 22 1255 13 1256 1 1257 23 1258 1 1259 3 1260 1 1261 4 1262 1 1263 1 1264 2 1265 1 1266 7 1267 1 1268 15 1269 2 1270 4 1271 55 1272 1 1273 13 1274 1 1275 11 1276 4 1277 3 1278 7 1279 8 1280 4 1281 1 1282 1 1283 1 1284 2 1285 9 1286 18 1287 1 1288 2 1289 2 1290 1 1291 4 1292 3 1293 5 1294 1 1295 1 1296 2 1297 3 1298 2 1299 3 1300 1 1301 7 1302 6 1303 1 1304 1 1305 2 1306 1 1307 2 1308 257 1309 4 1310 3 1311 1 1312 4 1313 2 1314 17 1315 1 1316 4 1317 410 1318 1 1319 3 1320 1 1321 1 1322 3 1323 20 1324 1 1325 15 1326 2 1327 2 1328 2 1329 2 1330 4 1331 3 1332 1 1333 1 1334 2 1335 1 1336 1 1337 2 1338 1 1339 1 1340 1 1341 7 1342 1 1343 3 1344 3 1345 1 1346 1 1347 6 1348 6 1349 8 1350 1 1351 4 1352 4 1353 1 1354 1 1355 1 1356 12 1357 2 1358 7 1359 3 1360 1 1361 1 1362 2 1363 1 1364 5 1365 3 1366 1 1367 4 1368 3 1369 11 1370 1 1371 3 1372 3 1373 2 1374 6 1375 3 1376 2 1377 12 1378 3 1379 2 1380 1 1381 2 1382 1 1383 175 1384 38 1385 1 1386 1 1387 11 1388 4 1389 4 1390 3 1391 1 1392 4 1393 2 1394 2 1395 8 1396 8 1397 9 1398 1 1399 2 1400 1 1401 2 1402 17 1403 1 1404 12 1405 1 1406 1 1407 1 1408 2 1409 6 1410 3 1411 4 1412 2 1413 15 1414 1 1415 27 1416 1 1417 1 1418 1 1419 1 1420 2 1421 30 1422 1 1423 11 1424 1 1425 8 1426 5 1427 1 1428 3 1429 3 1430 2 1431 7 1432 18 1433 1 1434 48 1435 1 1436 1 1437 2 1438 1 1439 2 1440 1 1441 2 1442 1 1443 4 1444 2 1445 5 1446 1 1447 4 1448 3 1449 1 1450 1 1451 1 1452 7 1453 1 1454 1 1455 1 1456 1 1457 2 1458 2 1459 2 1460 5 1461 6 1462 2 1463 1 1464 3 1465 1 1466 9 1467 32 1468 1 1469 1 1470 1 1471 2 1472 9 1473 1 1474 2 1475 1 1476 3 1477 75 1478 4 1479 9 1480 1 1481 1 1482 2 1483 1 1484 2 1485 34 1486 1 1487 18 1488 1 1489 2 1490 1 1491 1 1492 8 1493 2 1494 2 1495 3 1496 3 1497 1 1498 2 1499 4 1500 37 1501 6 1502 1 1503 2 1504 1 1505 1 1506 1 1507 8 1508 1 1509 6 1510 1 1511 2 1512 4 1513 89 1514 7 1515 5 1516 1 1517 2 1518 3 1519 2 1520 15 1521 210 1522 1 1523 1 1524 1 1525 3 1526 4 1527 1 1528 2 1529 2 1530 4 1531 1 1532 9 1533 2 1534 1 1535 3 1536 6 1537 6 1538 5 1539 1 1540 2 1541 1 1542 1 1543 25 1544 1 1545 7 1546 2 1547 1 1548 3 1549 1 1550 1 1551 14 1552 4 1553 1 1554 4 1555 1 1556 7 1557 2 1558 3 1559 5 1560 1 1561 4 1562 1 1563 6 1564 1 1565 1 1566 6 1567 3 1568 1 1569 10 1570 1 1571 4 1572 11 1573 28 1574 2 1575 1 1576 2 1577 1 1578 1 1579 1 1580 5 1581 1 1582 43 1583 2 1584 14 1585 6 1586 1 1587 6 1588 3 1589 2 1590 9 1591 1 1592 1 1593 1 1594 1 1595 2 1596 1 1597 1 1598 1 1599 1 1600 3 1601 1 1602 1 1603 1 1604 9 1605 1 1606 1 1607 3 1608 47 1609 1 1610 8 1611 1 1612 14 1613 1 1614 5 1615 4 1616 1 1617 5 1618 4 1619 4 1620 2 1621 1 1622 5 1623 1 1624 5 1625 1 1626 10 1627 1 1628 7 1629 1 1630 6 1631 1 1632 6 1633 1 1634 1 1635 1 1636 2 1637 2 1638 6 1639 7 1640 1 1641 2 1642 4 1643 1 1644 15 1645 2 1646 25 1647 2 1648 1 1649 6 1650 4 1651 1 1652 6 1653 1 1654 4 1655 1 1656 1 1657 5 1658 1 1659 1 1660 17 1661 7 1662 1 1663 2 1664 12 1665 1 1666 10 1667 6 1668 1 1669 15 1670 1 1671 12 1672 1 1673 4 1674 4 1675 1 1676 1 1677 1 1678 2 1679 1 1680 1 1681 1 1682 114 1683 3 1684 1 1685 1 1686 1 1687 1 1688 1 1689 1 1690 1 1691 1 1692 1 1693 1 1694 1 1695 4 1696 1 1697 1 1698 3 1699 1 1700 7 1701 1 1702 3 1703 1 1704 1 1705 11 1706 23 1707 1 1708 1 1709 4 1710 1 1711 1 1712 5 1713 17 1714 6 1715 2 1716 1 1717 3 1718 1 1719 1 1720 1 1721 44 1722 2 1723 1 1724 11 1725 2 1726 6 1727 5 1728 1 1729 8 1730 1 1731 2 1732 14 1733 1 1734 11 1735 4 1736 4 1737 1 1738 1 1739 1 1740 1 1741 1 1742 37 1743 91 1744 1 1745 2 1746 3 1747 1 1748 1 1749 42 1750 14 1751 2 1752 4 1753 1 1754 7 1755 2 1756 1 1757 1 1758 1 1759 3 1760 4 1761 120 1762 1 1763 3 1764 1 1765 3 1766 1 1767 1 1768 4 1769 19 1770 7 1771 3 1772 1 1773 6 1774 17 1775 1 1776 1 1777 2 1778 1 1779 2 1780 2 1781 8 1782 2 1783 2 1784 2 1785 1 1786 1 1787 1 1788 2 1789 1 1790 1 1791 3 1792 8 1793 3 1794 11 1795 1 1796 5 1797 1 1798 2 1799 2 1800 12 1801 3 1802 4 1803 2 1804 1 1805 6 1806 1 1807 1 1808 4 1809 1 1810 1 1811 4 1812 1 1813 1 1814 2 1815 1 1816 1 1817 2 1818 5 1819 1 1820 7 1821 1 1822 2 1823 11 1824 3 1825 2 1826 1 1827 1 1828 1 1829 2 1830 3 1831 2 1832 5 1833 1 1834 1 1835 3 1836 7 1837 4 1838 1 1839 1 1840 3 1841 4 1842 1 1843 1 1844 1 1845 1 1846 1 1847 7 1848 1 1849 24 1850 2 1851 1 1852 4 1853 3 1854 1 1855 1 1856 25 1857 1 1858 1 1859 2 1860 5 1861 2 1862 1 1863 7 1864 1 1865 11 1866 1 1867 4 1868 1 1869 32 1870 12 1871 1 1872 2 1873 1 1874 3 1875 1 1876 6 1877 12 1878 4 1879 1 1880 2 1881 3 1882 1 1883 19 1884 1 1885 2 1886 2 1887 1 1888 1 1889 2 1890 2 1891 5 1892 1 1893 1 1894 9 1895 1 1896 7 1897 3 1898 17 1899 3 1900 1 1901 3 1902 19 1903 1 1904 2 1905 3 1906 5 1907 1 1908 9 1909 1 1910 2 1911 1 1912 3 1913 2 1914 1 1915 23 1916 15 1917 11 1918 1 1919 2 1920 14 1921 3 1922 4 1923 2 1924 5 1925 1 1926 2 1927 11 1928 1 1929 1 1930 12 1931 1 1932 2 1933 1 1934 1 1935 1 1936 1 1937 5 1938 6 1939 19 1940 1 1941 11 1942 1 1943 1 1944 2 1945 3 1946 2 1947 3 1948 7 1949 5 1950 4 1951 2 1952 4 1953 72 1954 1 1955 1 1956 12 1957 4 1958 1 1959 2 1960 2 1961 1 1962 13 1963 9 1964 10 1965 1 1966 2 1967 3 1968 1 1969 1 1970 126 1971 1 1972 6 1973 3 1974 52 1975 1 1976 1 1977 1 1978 2 1979 4 1980 1 1981 2564 1982 8 1983 2 1984 17 1985 2 1986 619 1987 2 1988 13 1989 23 1990 1 1991 6 1992 7 1993 1 1994 3 1995 1 1996 443 1997 3 1998 1 1999 3 2000 1 2001 2 2002 1 2003 2 2004 1 2005 1 2006 2 2007 2 2008 3 2009 2 2010 1 2011 2 2012 1 2013 12 2014 2 2015 2 2016 1 2017 1 2018 2 2019 1 2020 1 2021 1 2022 2 2023 36 2024 7 2025 12 2026 4 2027 5 2028 4 2029 9 2030 3 2031 1 2032 7 2033 1 2034 5 2035 35 2036 2 2037 26 2038 6 2039 1 2040 33 2041 1 2042 5 2043 1 2044 3 2045 1 2046 1 2047 2 2048 1 2049 4 2050 9 2051 2 2052 3 2053 6 2054 1 2055 2 2056 1 2057 5 2058 2 2059 3 2060 5 2061 2 2062 1 2063 3 2064 6 2065 1 2066 3 2067 1 2068 2 2069 5 2070 10 2071 1 2072 1 2073 8 2074 1 2075 10 2076 18 2077 1 2078 1 2079 3 2080 1 2081 5 2082 4 2083 3 2084 164 2085 1 2086 1 2087 2 2088 3 2089 4 2090 10 2091 1 2092 1 2093 5 2094 1 2095 1 2096 1 2097 70 2098 1 2099 2 2100 4 2101 1 2102 1 2103 2 2104 4 2105 4 2106 1 2107 4 2108 1 2109 3 2110 1 2111 1 2112 32 2113 1 2114 1 2115 2 2116 2 2117 1 2118 3 2119 1 2120 1 2121 1 2122 1 2123 4 2124 1 2125 2 2126 21 2127 10 2128 4 2129 5 2130 3 2131 12 2132 1 2133 1 2134 23 2135 2 2136 2 2137 2 2138 4 2139 5 2140 11 2141 1 2142 9 2143 2 2144 2 2145 5 2146 3 2147 2 2148 1 2149 2 2150 5 2151 108 2152 1 2153 1 2154 1 2155 5 2156 1 2157 1 2158 1 2159 2 2160 16 2161 7 2162 1 2163 3 2164 10 2165 1 2166 1 2167 2 2168 1 2169 156 2170 3 2171 4 2172 3 2173 1 2174 1 2175 1 2176 2 2177 1 2178 2 2179 43 2180 3 2181 15 2182 6 2183 1 2184 3 2185 5 2186 5 2187 1 2188 1 2189 1 2190 1 2191 2 2192 1 2193 23 2194 1 2195 2 2196 7 2197 1 2198 1 2199 1 2200 3 2201 1 2202 48 2203 5 2204 1 2205 12 2206 8 2207 2 2208 1 2209 7 2210 1 2211 2 2212 1 2213 16 2214 2 2215 1 2216 3 2217 9 2218 6 2219 1 2220 1 2221 3 2222 2 2223 1 2224 21 2225 14 2226 3 2227 11 2228 12 2229 14 2230 1 2231 2 2232 1 2233 5 2234 1 2235 2 2236 1 2237 1 2238 3 2239 22 2240 2 2241 1 2242 1 2243 12 2244 1 2245 1 2246 27 2247 1 2248 1 2249 4 2250 2 2251 8 2252 8 2253 5 2254 1 2255 1 2256 3 2257 37 2258 5 2259 4 2260 2 2261 1 2262 22 2263 3 2264 3 2265 1 2266 2 2267 8 2268 11 2269 1 2270 4 2271 15 2272 1 2273 1 2274 13 2275 3 2276 15 2277 1 2278 1 2279 1 2280 4 2281 1 2282 6 2283 3 2284 1 2285 14 2286 6 2287 2 2288 2 2289 5 2290 8 2291 1 2292 7 2293 1 2294 3 2295 1 2296 2 2297 1 2298 1 2299 28 2300 2 2301 40 2302 1 2303 1 2304 1 2305 2 2306 1 2307 2 2308 8 2309 1 2310 4 2311 1 2312 2 2313 1 2314 1 2315 4 2316 4 2317 1 2318 3 2319 3 2320 1 2321 7 2322 1 2323 3 2324 2 2325 1 2326 2 2327 83 2328 6 2329 1 2330 1 2331 12 2332 1 2333 2 2334 1 2335 3 2336 1 2337 7 2338 4 2339 1 2340 2 2341 1 2342 33 2343 1 2344 15 2345 2 2346 13 2347 182 2348 85 2349 11 2350 3 2351 1 2352 4 2353 17 2354 1 2355 4 2356 1 2357 1 2358 1 2359 2 2360 4 2361 3 2362 22 2363 2 2364 1 2365 8 2366 9 2367 3 2368 2 2369 1 2370 2 2371 4 2372 2 2373 1 2374 2 2375 1 2376 1 2377 3 2378 2 2379 5 2380 1 2381 3 2382 24 2383 3 2384 1 2385 1 2386 248 2387 1 2388 4 2389 1 2390 2 2391 1 2392 1 2393 2 2394 8 2395 1 2396 2 2397 3 2398 9 2399 3 2400 12 2401 6 2402 1 2403 50 2404 12 2405 1 2406 16 2407 1 2408 228 2409 1 2410 2 2411 1 2412 1 2413 20 2414 1 2415 4 2416 1 2417 7 2418 1 2419 1 2420 2 2421 2 2422 5 2423 5 2424 1 2425 2 2426 22 2427 1 2428 2 2429 1 2430 1 2431 9 2432 1 2433 2 2434 1 2435 1 2436 2 2437 5 2438 2 2439 1 2440 3 2441 2 2442 2 2443 10 2444 1 2445 2 2446 13 2447 1 2448 8 2449 2 2450 2 2451 4 2452 2 2453 12 2454 1 2455 1 2456 1 2457 1 2458 6 2459 1 2460 11 2461 1 2462 3 2463 9 2464 1 2465 1 2466 2 2467 2 2468 2 2469 2 2470 1 2471 3 2472 4 2473 3 2474 3 2475 18 2476 1 2477 2 2478 2 2479 23 2480 2 2481 1 2482 22 2483 1 2484 1 2485 2 2486 2 2487 1 2488 1 2489 1 2490 6 2491 11 2492 1 2493 1 2494 16 2495 3 2496 28 2497 1 2498 2 2499 4 2500 1 2501 36 2502 20 2503 4 2504 3 2505 12 2506 8 2507 1 2508 2 2509 1 2510 2 2511 7 2512 2 2513 2 2514 2 2515 2 2516 3 2517 2 2518 5 2519 1 2520 5 2521 1 2522 5 2523 1 2524 3 2525 2 2526 1 2527 3 2528 1 2529 10 2530 36 2531 1 2532 1 2533 3 2534 1 2535 1 2536 12 2537 37 2538 2 2539 1 2540 1 2541 5 2542 3 2543 29 2544 1 2545 1 2546 1 2547 2 2548 4 2549 3 2550 3 2551 2 2552 75 2553 1 2554 7 2555 1 2556 1 2557 1 2558 8 2559 10 2560 10 2561 1 2562 4 2563 1 2564 8 2565 4 2566 7 2567 6 2568 2 2569 6 2570 1 2571 19 2572 7 2573 1 2574 1 2575 1 2576 1 2577 18 2578 1 2579 19 2580 10 2581 2 2582 441 2583 1 2584 16 2585 2 2586 10 2587 2 2588 2 2589 4 2590 2 2591 26 2592 2 2593 5 2594 1 2595 1 2596 2 2597 2 2598 6 2599 1 2600 18 2601 6 2602 5 2603 1 2604 2 2605 7 2606 1 2607 5 2608 1 2609 1 26