Skip to contents

Every reduced fraction in \([0,1]\) with denominator at most n, in ascending order, generated by the neighbour recurrence \(k = \lfloor (n+b)/d \rfloor\) rather than by enumerate-and-sort.

Usage

DiopT(n)

Arguments

n

Order, at least 1.

Value

Named list with estimate (the length), terms (a two column numerator/denominator matrix), values, n, method.

References

Classical number theory; no single owning source.

Examples

DiopT(5)
#> $estimate
#> [1] 11
#> 
#> $terms
#>       num den
#>  [1,]   0   1
#>  [2,]   1   5
#>  [3,]   1   4
#>  [4,]   1   3
#>  [5,]   2   5
#>  [6,]   1   2
#>  [7,]   3   5
#>  [8,]   2   3
#>  [9,]   3   4
#> [10,]   4   5
#> [11,]   1   1
#> 
#> $values
#>  [1] 0.0000000 0.2000000 0.2500000 0.3333333 0.4000000 0.5000000 0.6000000
#>  [8] 0.6666667 0.7500000 0.8000000 1.0000000
#> 
#> $n
#> [1] 5
#> 
#> $method
#> [1] "Farey sequence of order n"
#>