create a cFracConvergents function

This commit is contained in:
filifa
2025-09-05 23:52:40 -04:00
parent a65e54ff46
commit cafef6a4a2
2 changed files with 35 additions and 12 deletions

View File

@@ -47,13 +47,12 @@ func pell(cmd *cobra.Command, args []string) {
period = 2 * r
}
hch := gaussianBrackets(a0, big.NewInt(1), cycle(repetend))
kch := gaussianBrackets(big.NewInt(1), big.NewInt(0), cycle(repetend))
ch := cFracConvergents(a0, repetend)
for i := 1; true; i = (i + 1) % period {
h, k := <-hch, <-kch
r := <-ch
if i == period-1 {
fmt.Println(h, k)
fmt.Println(r.Num(), r.Denom())
}
}
}