<p>Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let's say the phone catalogue listed these numbers:</p> <pre> - Emergency 911 - Alice 97 625 999 - Bob 91 12 54 26 </pre&…
<p>Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let's say the phone catalogue listed these numbers:</p> <pre> - Emergency 911 - Alice 97 625 999 - Bob 91 12 54 26 </pre&…
Mike is very lucky, as he has two beautiful numbers, 3 and 5. But he is so greedy that he wants infinite beautiful numbers. So he declares that any positive number which is dividable by 3 or 5 is beautiful number. Given you an integer N (1 <= N <= 100000…
Prime Number Definition An integer greater than one is called a prime number if its only positive divisors (factors) are one and itself. For instance, 2, 11, 67, 89 are prime numbers but 8, 20, 27 are not. Semi-Prime Number Definition An integer greater than o…
<p>Given positive integers B and N, find an integer A such that A<sup>N</sup> is as close as possible to B. (The result A is an approximation to the N<sup>th</sup> root of B.) Note that A<sup>N</sup> may be less than, …
In recreational mathematics, a magic square of n-degree is an arrangement of n2 numbers, distinct integers, in a square, such that the n numbers in all rows, all columns, and both diagonals sum to the same constant. For example, the picture below shows a 3-deg…