TOPICS
Search

Least Nondivisor


The least nondivisor of a positive integer n is the smallest positive integer that does not divide n. Writing this number as L(n) gives

 L(n)=min{k>=1:kn}.
(1)

For n=1, 2, ..., its values begin 2, 3, 2, 3, 2, 4, 2, 3, 2, 3, 2, 5, ... (OEIS A007978). In particular, L(n)=2 for odd n and L(n)>=3 for even n.

The possible values are exactly the prime powers p^a with a>=1. If m=L(n) had two distinct prime factors, each of its maximal prime power factors would be smaller than m and would divide n. Their product would then divide n, contrary to the definition. Conversely, the first occurrence of a prime power p^a is at

 n=(1,2,...,p^a-1),
(2)

since this least common multiple is divisible by every smaller positive integer but has exponent a-1 at p (OEIS A007978).

Put M_k=(1,2,...,k) for k>=1 and M_0=1. The exact distribution follows from

 L(n)>k <==> M_k|n,
(3)

so the number of positive integers n<=X with L(n)>k is |_X/M_k_|, where |_x_| denotes the floor function. Consequently, the natural density of the set with L(n)=k is

 delta_k=1/(M_(k-1))-1/(M_k).
(4)

This is positive precisely when k is a prime power. Farhi (2009, p. 556) proved the average-order formula

 lim_(X->infty)1/Xsum_(n=1)^XL(n)=sum_(k=0)^infty1/(M_k).
(5)

More generally, the rth least nondivisor is the rth smallest positive integer that does not divide n. The second least nondivisors begin 3, 4, 4, 5, 3, 5, 3, 5, 4, 4, ... (OEIS A396771). Their possible values are the integers m>=3 that are either a prime power or twice a prime power (Radcliffe 2026). Indeed, if p^a|m but p^an, then every multiple of p^a through m fails to divide n. There can be at most two such multiples when m is the second least nondivisor, forcing m/p^a<=2.


See also

Divisor, Least Common Multiple, Prime Power

Explore with Wolfram|Alpha

References

Farhi, B. "On the Average Asymptotic Behavior of a Certain Type of Sequence of Integers." Integers 9, 555-567, 2009. https://math.colgate.edu/~integers/j42/j42.pdf.Radcliffe, D. "Values of Higher Least Non-Divisors." SeqFan. Oct. 9, 2026. https://groups.google.com/g/seqfan/c/-KeK7BGzSDk.Sloane, N. J. A. Sequences A007978 A396771 in "The On-Line Encyclopedia of Integer Sequences."

Cite this as:

Weisstein, Eric W. "Least Nondivisor." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/LeastNondivisor.html

Subject classifications