coprime: Coprimality

Description Usage Arguments Details Value See Also Examples

View source: R/gcd.R

Description

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

Usage

1
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

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

Example output

[1] TRUE
[1] TRUE

numbers documentation built on May 15, 2021, 1:08 a.m.