A notation for the GCD and LCM functions
暂无分享,去创建一个
This paper proposes a notation to be used for the greatest common divisor (gcd) and least common multiple (1cm) functions in APL. The notation proposed is that in use for the logical or and and functions: @@@@ for gcd and Λ for lcm. For this reason, special attention is paid to the cases of gcd and lcm for the arguments 0 and 1. Also, because we wish to define the functions for negative and complex rational values as well as for positive integers, we discuss the functions more generally than is the case in standard number theory texts, which usually restrict their discussions to positive integers. For this reason we give proofs of some of the basic theorems concerning gcd and lcm, written to insure that they are valid for the entire domain of values for which it is proposed the APL functions be defined. The discussion in this paper is couched in terms of integral arguments. The theoretical extension to rational arguments is an easy one, and it is assumed that the gcd and lcm functions, which depend on the residue function for their definitions, will be implemented for non-integral arguments, just as is the residue function, with all the practical difficulties which this entails.
In this paper, the terms “greatest” and “least” are taken to refer to magnitudes, and the terms “divisor” and “multiple” mean integer divisor and integer multiple.
[1] Oystein Ore,et al. Number Theory and Its History , 1949 .
[2] G. Birkhoff,et al. A survey of modern algebra , 1942 .
[3] Kenneth E. Iverson. Algebra an Algorithmic Treatment , 1977 .
[4] I. Vinogradov,et al. Elements of number theory , 1954 .
[5] Kenneth E. Iverson. Formalism in programming languages , 1964, CACM.