[UP]


Manual Reference Pages  - M_factor (3)

NAME

M_factor(3fm) - [M_factor] module for least common multiple, greatest common divisor, and prime factors

CONTENTS

Synopsis
Description
Primes
Examples

SYNOPSIS

least_common_multiple
  least common multiple of two integers ((i,j)) or integer array m(:|:,:|:,:,:)
greatest_common_divisor
  greatest common divisor of two integers ((i,j)) or integer array m(:|:,:|:,:,:)
prime_factors
  prime factors of a number
i_is_prime
  determine if an integer is a prime

DESCRIPTION

This module is a collection of procedures that perform common functions found in arithmetic and number theory such as Least Common Multiples, Greatest Common Divisors, and Prime Factors of INTEGER variables. The INTEGER values are typically limited to values up to the magnitude (2**31)-1= 2147483647.

PRIMES

Date 10/06/97 at 12:47:29
From Doctor Rob
Subject
  Re: The number 1 and zero
One is neither a prime nor a composite number. A prime number is one with exactly two positive divisors, itself and one. One has only one positive divisor. It cannot be written as a product of two factors, neither of which is itself, so one is also not composite. It falls in a class of numbers called units. These are the numbers whose reciprocals are also whole numbers.
Zero is not a prime or a composite number either. Zero has an infinite number of divisors (any nonzero whole number divides zero). It cannot be written as a product of two factors, neither of which is itself, so zero is also not composite. It falls in a class of numbers called zero-divisors. These are numbers such that, when multiplied by some nonzero number, the product is zero.
The most important fact of multiplication of integers is called the Fundamental Theorem of Arithmetic. It says that every whole number greater than one can be written *uniquely* (except for their order) as the product of prime numbers. This is so important that we tailor our idea of what a prime number is to make it true. If 1 were a prime number, this would be false, since, for example,
 

7 = 1*7 = 1*1*7 = 1*1*1*7 = ...,

and the uniqueness would fail.

EXAMPLES

The individual man(1) pages for each procedure contain examples and a full description of the procedure parameters.


M_factor (3) October 17, 2020
Generated by manServer 1.08 from 493abb43-22d7-4e3c-831f-6878089359ed using man macros.