Approximate number (Divisors)
Approximate numbers are other integers that divide some integer. For example, for an integer ( a ), if there exists an integer ( b ) such that ( a = b*c ), then ( b ) is an approximant of ( a ).
Nature:
- 1 and itself is an approximation of each integer: Every integer ( a ) has at least two approximations: 1 and ( a ) itself.
- Approximate range: If ( d ) is an approximant of ( n ), then ( d <=sqrt(n)). This means that finding an approximation of ( n ) only requires searching in the range 1 to sqrt(n).
- The approximate number of perfect squares is odd: If ( n ) is a perfect square number, then it must have an odd number of approximations because there is only one square root of a perfect square number.
Multiples
A multiple is an integer multiple of some integer. If ( a ) is a multiple of ( b ), then there exists an integer ( c ) such that ( a = b \times c ).
Nature:
- The nature of multiples: If ( b ) is a multiple of ( a ), then ( a ) is also an approximate number of ( b ).
- The relationship between multiples: If ( a ) is a multiple of ( b ), then ( ka ) (where ( k ) is any integer) is also a multiple of ( b ).
- Least Common Multiples (LCM): If ( a ) and ( b ) are two integers, then LCM(a,b) is the smallest positive integer that is a multiple of both ( a ) and ( b ).
Examples and Applications:
- If ( a = 12 ), its approximate numbers include ( 1, 2, 3, 4, 6, 12 ).
- If ( b = 5 ), its multiples include ( 5, 10, 15, 20,......) .
In mathematics and computer science, understanding and applying the properties of approximations and multiples is important for solving problems such as integer factorization, covenants and common multiples, greatest common divisor (GCD), least common multiple (LCM), and so on.
The following is an example of C++ code to find all the approximate numbers of n:
int find_divisors(int n, int a[])
{
// as the index of the array subscript
int index = 0; // not written as k*k<=n
//Not k*k<=n because k is large and out of long long data range
for (int k = 1; k <= n / k; k++) {
if (n % k == 0) {
a[index++] = k.
// Approximate numbers occur in pairs, but be careful a bit k = n / k may be repeated. (Prevents the same approximation of a perfect square number from recurring)
if (n / k ! = k) a[index++] = n / k; }
}
}
return index; }
}