coprime: Coprimality

View source: R/gcd.R

coprimeR Documentation

Coprimality

Description

Determine whether two numbers are coprime, i.e. do not have a common prime divisor.

Usage

coprime(n,m)

Arguments

n, m

integer scalars

Details

Two numbers are coprime iff their greatest common divisor is 1.

Value

Logical, being TRUE if the numbers are coprime.

See Also

GCD

Examples

coprime(46368, 75025)  # Fibonacci numbers are relatively prime to each other
coprime(1001, 1334)

numbers documentation built on Nov. 23, 2022, 9:06 a.m.