Note 1: This questions requires some new definitions, namely "continuous primeness" which I have made. Everyone is welcome to improve the definition without altering the spirit of the question. Click here for a somewhat related question.

A number is either prime or composite, hence primality is a binary concept. Instead I wanted to put a value of primality to every number using some function $f$ such that $f(n) = 1$ iff $n$ is a prime otherwise, $0 < f(n) < 1$ and as the number divisors of $n$ increases, $f(n)$ decreases on average. Thus $f(n)$ is a measure of the degree of primeness of $n$ where 1 is a perfect prime and 0 is a hypothetical perfect composite. Hence $\frac{1}{N}\sum_{r \le N} f(r)$ can be interpreted as a measure of average primeness of the first $N$ integers.

After trying several definitions and going through the ones in literature, I came up with:

Define $f(n) = \dfrac{2s_n}{n-1}$ for $n \ge 2$, where $s_n$ is the standard deviation of the divisors of $n$.

One advantage of using standard deviation is that even if two numbers have the same number of divisor their value of $f$ appears to be different hence their measure of primeness will be different.

Question 1: Does the average primeness tend to zero? i.e. does the following hold?

$$ \lim_{N \to \infty} \frac{1}{N}\sum_{r = 2}^N f(r) = 0 $$

Question 2: Is $f(n)$ injective over composites? i.e., do there exist composites $3 < m < n$ such that $f(m) = f(n)$?

My progress

  • $f(4.35\times 10^8) \approx 0.5919$ and decreasing so the limit if it exists must be between 0 and 0.5919.
  • For $2 \le i \le n$, the minimum value of $f(i)$ occurs at the largest highly composite number $\le n$.

Note 2: Here standard deviation of $x_1, x_2, \ldots , x_n$ is defined as $\sqrt \frac{\sum_{i=1}^{n} (x-x_i)^2}{n}$. Also notice that even if we define standard deviation as $\sqrt \frac{\sum_{i=1}^{n} (x-x_i)^2}{n-1}$ our questions remain unaffected because in this case in the definition of $f$, we will be multiplying with $\sqrt 2$ instead of $2$ to normalize $f$ in the interval $(0,1)$.

Note 3: Posted this question in MO and got answer for question 1. Indeed the limit tends to zero. Question 2 is still open.

  • 11
    $\begingroup$ Why involve the standard deviation? Why not something simpler, like $2/d(n)$, where $d(n)$ is the number of divisors of $n$? $\endgroup$ Apr 6, 2019 at 4:06
  • 7
    $\begingroup$ @GerryMyerson: Here is a more technical answer why standard deviation. If two numbers have the same number of divisors then the value $2/d(n)$ is same for both but the values of $f(n)$ is different. So under my definition, I will consider the number with smaller value of $f(n)$ to have a greater primness because we are not just measuring how many divisors a number has but also how scattered these divisors are. At the moment, I don't know if $f(n)$ is unique. I will add this to the question. $\endgroup$ Apr 6, 2019 at 7:27
  • 1
    $\begingroup$ I have written some code for this in R: stanfun <- function(n){sd(divisors(n))/(n-1)};funstan <- function(m){sum(sapply(2:m, function(i){stanfun(i)}))/m}, so $\frac1{10000}\sum\limits_{r=1}^{10000}f(r)$ is given by funstan(10000) which outputs $0.404801$. $\endgroup$
    – TheSimpliFire
    Apr 6, 2019 at 19:23
  • 2
    $\begingroup$ You might want to rephrase "is $f(n)$ unique" to "is $f(n)$ injective". At first glance I thought you didn't know whether $f(n)$ was well-defined. $\endgroup$
    – YiFan
    Apr 7, 2019 at 4:45
  • 2
    $\begingroup$ @daniel One of the reasons why I invented this definition was because even if two numbers have the same number of divisors or the same number distinct prime divisors, their value of $f(n)$ was found to be unique. In that way, $f(n)$ can uniquely identify $n$ but $\omega(n)$ or $d(n)$ cannot uniquely identify $n$. $\endgroup$ Sep 30, 2019 at 11:55

1 Answer 1


I calculated the first 9 composite standard deviations and fed them into f(n).These yielded: 0.47, 0.40, 0.43, 0.35, 0.44, 0.34, 0.49,0.28, 0.41. So there are no matching values and there is no injection among the earliest composites


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .