Learn R Programming

elliptic (version 0.4-13)

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 an array a of dimension c(2,2,u) where u is a (complicated) function of n. The slices a[,,i], viewed as matrices, have determinant 1.

References

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

See Also

unimodular

Examples

Run this code
farey(3)

Run the code above in your browser using DataLab