Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

farey

Farey sequences


Description

Returns the Farey sequence of order n

Usage

farey(n, print=FALSE, give.series = FALSE)

Arguments

n

Order of Farey sequence

print

Boolean, with TRUE meaning to print out the text version of the Farey sequence in human-readable form. Default value of FALSE means not to print anything

give.series

Boolean, with TRUE meaning to return the series explicitly, and default FALSE meaning to return a 3 dimensional array as detailed below

Details

If give.series takes its default value of FALSE, return a matrix a of dimension c(2,u) where u is a (complicated) function of n. If v <- a[i,], then v[1]/v[2] is the i-th term of the Farey sequence. Note that det(a[(n):(n+1),])== -1

If give.series is TRUE, then return a matrix a of size c(4,u-1). If v <- a[i,], then v[1]/v[2] and v[3]/v[4] are successive pairs of the Farey sequence. Note that det(matrix(a[,i],2,2))== -1

Author(s)

Robin K. S. Hankin

References

G. H. Hardy and E. M. Wright 1985. An introduction to the theory of numbers, Oxford University Press (fifth edition)

See Also

Examples

farey(3)

elliptic

Weierstrass and Jacobi Elliptic Functions

v1.4-0
GPL-2
Authors
Robin K. S. Hankin [aut, cre] (<https://orcid.org/0000-0001-5982-0415>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.