1
$\begingroup$

I thought it would be fun to give my froshling students a short programming assignment to characterize numbers as: deficient, abundant, perfect, and prime. Then I got a little carried away and started looking for weird numbers.

A number is weird if it is abundant and not semiperfect. Semiperfect means that some subset of its divisors adds up to the number.

But then I ran the code and found something very weird. The vast majority of weird numbers have exactly 15 divisors. I had some idle cores laying about, and I ran out to 25.6 million (256 cores). If I look at the count of the number of weird numbers that had a given number of divisors I get:


  2   {11}
62348 {15}
  6   {19}
6596  {23}
 38   {27}
  2   {7}

The way to read this is: "2 out of 25.6 million had 11 divisors". The vast majority have exactly 15, about 1/10 as many have 23, and then you can see what happens.

My question is: Why? I have asked some clever people, number theorists and algebraists, and they shrug.

Here is the code in Python. The actual code to run through 25.6 million was in C.

#!/usr/bin/env python3

def divisors(n):
    return [ _ for _ in range(1, n) if n % _ == 0 ]

def combination(d):
    for c in range(2**len(d)):
        yield [ _ for _ in range(len(d)) if c & 2**_ ]

def semiperfect(d, n):
    for c in combination(d):
        if sum([ d[_] for _ in c ]) == n:
            return True
    return False

def classify(n):
    d = divisors(n)
    s = sum(d)
    if s == 1:
        return "prime"
    elif s == n:
        return "perfect"
    elif s < n:
        return "deficient"
    elif not semiperfect(d, n):
        return "weird"
    else:
        return "abundant"

def main():
    for i in range(10000):
        print(f"{i} {divisors(i)} is {classify(i)}")

if __name__ == '__main__':
    try:
        main()
    except:
        print("Quit")
```
$\endgroup$
0

2 Answers 2

5
$\begingroup$

I guess you mean $15$ proper divisors; it's less confusing to say $16$ divisors, and counting all the divisors has the nicest formula.

The sequence of weird numbers is A006037 on the OEIS; looking at some of their factorizations it looks like $16 = 2^4$ and these numbers are products of four distinct primes, e.g.

$$19390 = 2 \cdot 5 \cdot 7 \cdot 277, 18970 = 2 \cdot 5 \cdot 7 \cdot 271, , 18830 = 2 \cdot 5 \cdot 7 \cdot 269.$$

Actually these factorizations suggests a much more specific conjecture: that we are specifically seeing numbers of the form $70p$ where $p$ is a large prime. $70$ is the smallest weird number, and on the OEIS you can find the following remark:

A weird number $n$ multiplied by a prime $p > \sigma(n)$ is again weird.

So any number of the form $70p$ where $p > \sigma(70) = 144$ is prime is weird and I'll bet that's where most of your weird numbers with $16$ divisors are coming from. These have asymptotic density $\frac{1}{70 \ln \frac{n}{70}}$ among the numbers from $1$ to $n$ by the PNT.

The next smallest weird number is $836 = 2^2 \cdot 11 \cdot 19$ so we might guess that the next most common weird numbers are of the form $836p$ where $p > \sigma(836) = 1680$ is prime. These will have $24$ divisors which is the next most common number in your count. These have asymptotic density $\frac{1}{836 \ln \frac{n}{836}}$ which is about a tenth of the density of the previous, which is roughly consistent with your count.

The next smallest weird number is $4030 = 2 \cdot 5 \cdot 13 \cdot 31$ and from this we get weird numbers of the form $4030p$ where $p > \sigma(4030) = 8064$ with $32$ divisors. But this gives $4030p > 3.2 \times 10^7$ which is past where you searched.

A002975 records the primitive weird numbers, namely those not divisible by a previous weird number. These exhibit a different pattern of factorizations; the largest one listed on the OEIS is $4128448 = 2^6 \times 251 \times 257$ which has $28$ divisors, for example. So it might be interesting to restrict your attention to primitive weird numbers and see what the counts are in that case. Instead of just computing and comparing the number of divisors it would be more illuminating to compute and compare the sequence of exponents in the prime factorization.

$\endgroup$
2
  • $\begingroup$ Thanks. That is a nice analysis. I had noticed the prefix going up (to 70, for example). $\endgroup$ Commented Sep 9, 2022 at 1:17
  • 1
    $\begingroup$ I'm guessing we're being misled by only looking at small numbers, which don't have many factors. If you go far enough, you may find something that overtakes $15$ (proper) divisors, and then something that overtakes that number, and so on, ad infinitum. $\endgroup$ Commented Sep 9, 2022 at 13:37
1
$\begingroup$

In 2014 I proved (On the conditional infiniteness of primitive weird numbers, J. Numbers Theory 147) that for any $k$ and suitable primes $p$ and $q$, then $2^kpq$ is weird. This means that, upon the Cramér conjecture, there are weird numbers with arbitraryly large number of proper divisors.

$\endgroup$

You must log in to answer this question.

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