This function was first considered by François Édouard Anatole Lucas in 1883, followed by Joseph Jean Baptiste Neuberg in 1887. In 1918, A. J. Kempner gave the first correct algorithm for computing S. The Kempner function is also sometimes called the Smarandache function following Florentin Smarandache's rediscovery of the function in 1980.
Properties
Since n divides n!, S is always at most n. A number ngreater than 4 is a prime numberif and only ifS = n. That is, the numbers n for which S is as large as possible relative to n are the primes. In the other direction, the numbers for which S is as small as possible are the factorials: S = k, for all k ≥ 1. S is the smallest possible degree of a monic polynomial with integer coefficients, whose values over the integers are all divisible by n. For instance, the fact that S = 3 means that there is a cubic polynomial whose values are all zero modulo 6, for instance the polynomial but that all quadratic or linear polynomials are nonzero modulo 6 at some integers. In one of the advanced problems in the American MathematicalMonthly, set in 1991 and solved in 1994, Paul Erdős pointed out that the function S coincides with the largest prime factor of n for "almost all" n.
Computational complexity
The Kempner function S of an arbitrary number n is the maximum, over the prime powerspe dividing n, of S. When n is itself a prime powerpe, its Kempner function may be found in polynomial time by sequentiallyscanning the multiples of p until finding the first one whose factorial contains enough multiples of p. The same algorithm can be extended to any n whose prime factorization is already known, by applying it separately to each prime power in the factorization and choosing the one that leads to the largest value. For a number of the form n = px, where p is prime and x is less than p, the Kempner function of n is p. It follows from this that computing the Kempner function of a semiprime is computationally equivalent to finding its prime factorization, believed to be a difficult problem. More generally, whenever n is a composite number, the greatest common divisor of S and n will necessarily be a nontrivial divisor of n, allowing n to be factored by repeated evaluations of the Kempner function. Therefore, computing the Kempner function can in general be no easier than factoringcomposite numbers.