The Smarandache function is the function first considered by Lucas (1883), Neuberg (1887), and Kempner (1918) and subsequently rediscovered by Smarandache (1980) that gives the smallest value for a given at which (i.e., divides factorial). For example, the number 8 does not divide , , , but does divide , so .
For , 2, ..., is given by 1, 2, 3, 4, 5, 3, 7, 4, 6, 5, 11, ... (OEIS A002034), where it should be noted that Sloane defines , while Ashbacher (1995) and Russo (2000, p. 4) take . The incrementally largest values of are 1, 2, 3, 4, 5, 7, 11, 13, 17, 19, 23, 29, ... (OEIS A046022), which occur at the values where . The incrementally smallest values of relative to are = 1, 1/2, 1/3, 1/4, 1/6, 1/8, 1/12, 3/40, 1/15, 1/16, 1/24, 1/30, ... (OEIS A094404 and A094372), which occur at , 6, 12, 20, 24, 40, 60, 80, 90, 112, 120, 180, ... (OEIS A094371).
Formulas exist for immediately computing for special forms of . The simplest cases are
(1)
| |||
(2)
| |||
(3)
| |||
(4)
| |||
(5)
|
where is a prime, are distinct primes, , and (Kempner 1918). In addition,
(6)
|
if is the th even perfect number and is the corresponding Mersenne prime (Ashbacher 1997; Ruiz 1999a). Finally, if is a prime number and an integer, then
(7)
|
(Ruiz 1999b).
The case for is more complicated, but can be computed by an algorithm due to Kempner (1918). To begin, define recursively by
(8)
|
with . This can be solved in closed form as
(9)
|
Now find the value of such that , which is given by
(10)
|
where is the floor function. Now compute the sequences and according to the Euclidean algorithm-like procedure
(11)
| |||
(12)
| |||
(13)
| |||
(14)
| |||
(15)
|
i.e., until the remainder . At each step, is the integer part of and is the remainder. For example, in the first step, and . Then
(16)
|
(Kempner 1918).
The value of for general is then given by
(17)
|
(Kempner 1918).
For all
(18)
|
where is the greatest prime factor of .
can be computed by finding and testing if divides . If it does, then . If it doesn't, then and Kempner's algorithm must be used. The set of for which (i.e., does not divide ) has density zero as proposed by Erdős (1991) and proved by Kastanas (1994), but for small , there are quite a large number of values for which . The first few of these are 4, 8, 9, 12, 16, 18, 24, 25, 27, 32, 36, 45, 48, 49, 50, ... (OEIS A057109). Letting denote the number of positive integers such that , Akbik (1999) subsequently showed that
(19)
|
This was subsequently improved by Ford (1999) and De Koninck and Doyon (2003), the former of which is unfortunately incorrect. Ford (1999) proposed the asymptotic formula
(20)
|
where is the Dickman function, is defined implicitly through
(21)
|
and the constant needs correction (Ivić 2003). Ivić (2003) subsequently showed that
(22)
|
and, in terms of elementary functions,
(23)
|
Tutescu (1996) conjectured that never takes the same value for two consecutive arguments, i.e., for any . This holds up to at least (Weisstein, Mar. 3, 2004).
Multiple values of can have the same value of , as summarized in the following table for small .
such that | |
1 | 1 |
2 | 2 |
3 | 3, 6 |
4 | 4, 8, 12, 24 |
5 | 5, 10, 15, 20, 30, 40, 60, 120 |
6 | 9, 16, 18, 36, 45, 48, 72, 80, 90, 144, 180, 240, 360, 720 |
Let denote the smallest inverse of , i.e., the smallest for which . Then is given by
(24)
|
where
(25)
|
(J. Sondow, pers. comm., Jan. 17, 2005), where is the greatest prime factor of and is the floor function. For , 2, ..., is given by 1, 2, 3, 4, 5, 9, 7, 32, 27, 25, 11, 243, ... (OEIS A046021). Some values of first occur only for very large . The sequence of incrementally largest values of is 1, 2, 3, 4, 5, 9, 32, 243, 4096, 59049, 177147, 134217728, ... (OEIS A092233), corresponding to , 2, 3, 4, 5, 6, 8, 12, 16, 24, 27, 32, ... (OEIS A092232).
To find the number of for which , note that by definition, is a divisor of but not of . Therefore, to find all for which has a given value, say all with , take the set of all divisors of and omit the divisors of . In particular, the number of for which for is exactly
(26)
|
where denotes the number of divisors of , i.e., the divisor function . Therefore, the numbers of integers with , 2, ... are given by 1, 1, 2, 4, 8, 14, 30, 36, 64, 110, ... (OEIS A038024).
In particular, equation (26) shows that the inverse Smarandache function always exists since for every there is an with (hence a smallest one a(n)), since for .
Sondow (2006) showed that unexpectedly arises in an irrationality bound for e, and conjectures that the inequality holds for almost all , where "for almost all" means except for a set of density zero. The exceptions are 2, 3, 6, 8, 12, 15, 20, 24, 30, 36, 40, 45, 48, 60, 72, 80, ... (OEIS A122378).
Since for almost all (Erdős 1991, Kastanas 1994), where is the greatest prime factor, an equivalent conjecture is that the inequality holds for almost all . The exceptions are 2, 3, 4, 6, 8, 9, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32, 36, ... (OEIS A122380).
D. Wilson points out that if
(27)
|
is the power of the prime in , where is the sum of the base- digits of , then it follows that
(28)
|
where the minimum is taken over the primes dividing . This minimum appears to always be achieved when is the greatest prime factor of .