Skip to content

FareyNeighbours ​

Whether p/qp/q and r/sr/s are Farey neighbours — adjacent in some Farey sequence, which is the determinant test ∣ps−qr∣=1|ps-qr|=1.

FareyNeighbours(p, q, r, s)∣ps−qr∣=1|ps-qr|=1
Typed signatures
TypePackageApplies
(integer, integer, integer, integer) -> booleanmodularalways

Domain: The modular group

Examples

Basic #

∣1⋅3−2⋅2∣=1|1\cdot 3-2\cdot 2| = 1

live ↗
InFareyNeighbours(1,2,2,3)\mathrm{FareyNeighbours}(1, 2, 2, 3)OutTrue\mathrm{True}

∣1⋅5−2⋅3∣=1|1\cdot 5-2\cdot 3| = 1

live ↗
InFareyNeighbours(1,2,3,5)\mathrm{FareyNeighbours}(1, 2, 3, 5)OutTrue\mathrm{True}
Properties #

∣1⋅7−2⋅3∣=1|1\cdot 7-2\cdot 3| = 1

live ↗
InFareyNeighbours(1,2,3,7)\mathrm{FareyNeighbours}(1, 2, 3, 7)OutTrue\mathrm{True}
About
Examples3

See also: SternBrocotPath