{"size": 750, "ext": "scrbl", "max_stars_repo_path": "scribblings/numerics/integer/farey.scrbl", "max_stars_repo_name": "bennn/mechanics", "max_stars_repo_stars_event_min_datetime": "2015-05-08T23:10:09.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-05T21:03:02.000Z", "max_issues_repo_path": "scribblings/numerics/integer/farey.scrbl", "max_issues_repo_name": "bennn/mechanics", "max_issues_repo_issues_event_min_datetime": "2015-05-03T01:32:29.000Z", "max_issues_repo_issues_event_max_datetime": "2021-06-23T02:12:53.000Z", "max_forks_repo_path": "scribblings/numerics/integer/farey.scrbl", "max_forks_repo_name": "bennn/mechanics", "max_forks_repo_forks_event_min_datetime": "2018-01-23T07:39:01.000Z", "max_forks_repo_forks_event_max_datetime": "2021-06-22T22:24:11.000Z"}
{"max_stars_count": 31, "max_issues_count": 28, "max_forks_count": 4, "avg_line_length": 34.0909090909, "max_line_length": 196, "alphanum_fraction": 0.74}
#lang scribble/manual

@require[mechanics/private/numerics/integer/farey]
@require[scribble/eval]

@title[#:tag "farey"]{Farey Sequences}
@defmodule[mechanics/private/numerics/integer/farey]
@(define farey-eval
  (make-base-eval
    '(begin (require mechanics/private/numerics/integer/farey))))

@hyperlink["http://mathworld.wolfram.com/FareySequence.html"]{Farey Sequences} enumerate reduced fractions.

@defproc[(farey [lo integer?] [hi integer?]) (-> integer? (listof integer?))]{
  Given a lower and upper bound, return a function on naturals @racket[n] that enumerates all fractions between @racket[lo] and @racket[hi] inclusive, with denominators no greater than @racket[n].
}

@examples[#:eval farey-eval
  ((farey 0 1) 1)
  ((farey 0 1) 5)
]
