Learn R Programming

pracma (version 1.1.6)

coprime: 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

Value

  • Logical, being TRUE if the numbers are coprime.

Details

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

See Also

GCD

Examples

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

Run the code above in your browser using DataLab