2
$\begingroup$

Using the divisor_sigma[n, k] function from the python sympy library where n is the positive integer which is having its divisors added and k is the power each factor is raised to, I was looking for the first number that satisfies divisor_sigma[n, k] - n^k = n^m, where m and k are positive integers less than or equal to 5.

I am denoting this as a (k,m) generalized perfect number, for (k,m) = (1,1) this corresponds to the perfect numbers.

With python I checked n from 1 to 50000 and had it print if it found a number n that satisfied the condition divisor_sigma[n, k] - n^k = n^m. Here is the smallest number that satisfies the condition I found for all 25 possible combinations of (k,m). I also checked (2,2) from n = 1 to 2000000. If I didn't find a number within the range 1 to n I wrote unknown.
Edit: I have now checked n from 1 to 1500000, as I check larger values of n I will update the table accordingly.
Edit: Based on my answer and Peter's comment I have updated the table accordingly, "dne" stands for does not exist.

k, m -> 1 2 3 4 5
1 6 dne dne dne dne
2 dne unknown > $10^8$ dne dne dne
3 dne 6 unknown > $10^8$ dne dne
4 dne dne unknown > $10^8$ unknown > $10^8$ dne
5 dne dne unknown > $10^8$ unknown > $10^8$ unknown > $10^8$

My question is: for a given (k,m) does there exist a number n that satisfies the condition, if not could it be proven that such a number does not exist. If for (k,m) the number n does exist, what is the smallest number that satisfies the condition?

I conjecture that if k and m are far apart such as k = 1, m = 5 or k = 5, m = 1 no such n will exist that satisfies the condition.

Here is the python code I used for each pair (k,m):

import sympy
from sympy.ntheory import divisor_sigma

n = 50000

for x in range(n):
if divisor_sigma(x + 1, k) - (x + 1)**k == (x + 1)**m:
print(x + 1, "is a (k,m) generalized perfect number")

The x + 1 is because otherwise the function would check from 0 to 49999 rather than 1 to 50000.

Additionally, if you know the computational complexity of this algorithm and how the time to compute would scale as I increase n that would be appreciated.

Thank you.

$\endgroup$
1
  • $\begingroup$ Besides the perfect numbers and the example $6$ , I found no further examples upto $10^8$ $\endgroup$
    – Peter
    Commented Jun 15 at 9:38

1 Answer 1

0
$\begingroup$

To answer my question I decided to write another python program that counts (k,m) generalized deficient, perfect, and abundant numbers.
A natural number n is (k,m) deficient if:
$divisorSigma[n,k] - n^k < n^m.$
A natural number n is (k,m) abundant if:
$divisorSigma[n,k] - n^k > n^m.$

This is what the function to count the number of deficient, perfect, and abundant numbers looks like.

 
perfectN = 0 
deficientN = 0 
abundantN = 0 

def dS(n0, n1, k, m): 
    global perfectN  
    global deficientN 
    global abundantN 
    for x in range(n0, n1, 1): 
        if divisor_sigma(x + 1, k) - (x + 1)**k == (x + 1)**m: 
            perfectN = perfectN + 1 
        elif divisor_sigma(x + 1, k) - (x + 1)**k < (x + 1)**m:
            deficientN = deficientN + 1 
        elif divisor_sigma(x + 1, k) - (x + 1)**k > (x + 1)**m: 
            abundantN = abundantN + 1 

And here is what the function to collect and list the number of deficient, perfect, and abundant numbers looks like.
listPerfectN = []
listDeficientN = []
listAbundantN = []
      
def dsCount(n0, n1, k, k, m):
    global listPerfectN
    global listDeficientN
    global listAbundantN
    for x in range(n0, n1, 1):
        if divisor_sigma(x + 1, k) - (x + 1)**k == (x + 1)**m:
            listPerfectN.append(x + 1)
        elif divisor_sigma(x + 1, k) - (x + 1)**k < (x + 1)**m:
            listDeficientN.append(x + 1)
        elif divisor_sigma(x + 1, k) - (x + 1)**k > (x + 1)**m:
            listAbundantN.append(x + 1)

Here is the driver code.

minN = 0
maxN = 150000

For k in range(0, 5, 1):
    For m in range(0, 5, 1):
        perfectN = 0
        deficientN = 0
        abundantN = 0
        dS(minN, maxN, k + 1, m + 1)
        listPerfectN = []
        listDeficientN = []
        listAbundantN = []
        dsCount(minN, maxN, k + 1, m + 1)
        . . . 
        print(. . . perfectN . . . listPerfectN . . .)
        print(. . . deficientN . . . listDeficientN . . .)
        print(. . . abundantN . . . listAbundantN . . .)

First we prove that 1 or a prime number is always deficient.Suppose n is 1 or a prime number, then we have:
$divisorSigma[1,k] - n^k = 1 - 1^k = 0 < 1^m$ For $ m \in \mathbb{N}$
$divisorSigma[n,k] - n^k = 1 + n^k - n^k = 1 < n^m$ For $n > 1$ and $ m \in \mathbb{N}$
Therefore for any n, and any (k,m) there are at least the number of prime numbers from 1 to n plus 1 (k,m) deficient numbers.

Out of the n = 150000 numbers tested for (k,m) other than (1,1) if $k \le m$ then all numbers are deficient.

I do not have the proof that for cases (2,2), (3,3), (4,4), and (5,5) that all n are deficient, but I do have a proof that for all the cases where k < m that all n are deficient.

Case (1,2), (1,3), (1,4), (1,5). Proving case (1,2) will prove cases (1,3), (1,4) and (1,5).

Because the number of divisors of a natural number n is less than the amount of numbers from 1 to n we have:
$divisorSigma(n,1) - n < \sum_{x=1}^{n - 1} x $
$\sum_{x=1}^{n - 1} x = \frac{n^2}{2} - \frac{n}{2} < n^2 $ For all n > 0.
This implies $ divisorSigma(n, 1) - n < n^2 < n^3 < n^4 < n^5 $

Case (2,3), (2,4), (2,5)
$divisorSigma(n, 2) - n^2 < \sum_{x=1}^{n - 1} x^2 $
$ \sum_{x=1}^{n - 1} x = \frac{n^3}{3} - \frac{n^2}{2} + \frac{n}{6} < n^3 $ The inequality for the summation formula being less than $n^3$ was checked with the desmos graphing calculator, replacing n with x. For all $ n \ge 1 $
This implies $ divisorSigma(n, 2) - n^2 < n^3 < n^4 < n^5 $

Case (3,4), (3,5)
$ divisorSigma(n, 3) - n^3 < \sum_{x=1}^{n - 1} x^3 $
$ \sum_{x=1}^{n - 1} x^3 = \frac{n^4}{4} - \frac{n^3}{2} + \frac{n^2}{4} < n^4 $ for all $ n \ge 1 $
This implies $ divisorSigma(n, 3) - n^3 < n^4 < n^5 $

Case (4,5)
$ divisorSigma(n, 4) - n^4 < \sum_{x=1}^{n - 1} x^4 $
$ \sum_{x=1}^{n - 1} x^4 = \frac{n^5}{5} - \frac{n^4}{2} + \frac{n^3}{3} - \frac{n}{30} < n^5 $ For all $ n > 0 $

For (k,m) = (1,1) there are 112857 deficient numbers, 4 perfect numbers, and 37139 abundant numbers from n = 1 to 150000.

For (k,m) = (2,1), (3,1), (4,1), (4,2), (5,1), and (5,2) there are 13849 (k,m) deficient numbers, 0 (k,m) perfect numbers and 136151 (k,m) abundant numbers. There are 13848 prime numbers from n = 1 to 150000, and the (k,m) deficient numbers correspond to the prime numbers and also the number 1, so the abundant numbers correspond to the composite numbers from 1 to 150000.

Proof that for (k,m) = (2,1), (3,1), (4,1), (4,2), (5,1), and (5,2) that composite numbers are always abundant.

Case (2,1), (3,1), (4,1), (5,1)
The smallest aliquot divisorSum[n,k] that a natural number n can have relative to n^m if n is composite is if n is square, because then $divisorSigma[n,k] - n^k $ is $ 1 + \sqrt {n^k} $. Otherwise we have a divisor that is bigger than $\sqrt{n^k} $ which is a factor pair with a number smaller than $\sqrt{n^k}$, which makes the sum more than $ 1 + \sqrt{n^k} $

For case (2,1) If n is square we have: $1^2 + \sqrt{n^2} = 1 + n > n^1. $
Since square composite numbers have a smaller sum than non-square composite numbers relative to $n^1$, all composite numbers are (2,1) abundant.

This implies that all composite numbers are (3,1), (4,1) and (5,1) abundant.
$ 1 + n^{\frac{5}{2}} > 1 + n^{\frac{4}{2}} > 1 + n^{\frac{3}{2}} > 1 + n^{\frac{2}{2}} > n^1. $ For $ n \ge 1 $.

Case (4,2), (5,2)
If n is square we have: $ 1^4 + \sqrt{n^4} = 1 + n^2 > n^2 $

This implies that all composite numbers are (5,2) abundant.
$ 1 + n^{\frac{5}{2}} > 1 + n^{\frac{4}{2}} > n^2. $

For (k,m) = (3,2) there are 22498 (3,2) deficient numbers, there is 1 (3,2) perfect number (6), and there are 127501 (3,2) abundant numbers.

The first 10 (3,2) deficient numbers are [1, 2, 3, 4, 5, 7, 9, 11, 13, 15], n = 6 is perfect, and all even numbers greater than or equal to 8 are abundant.

Proof: Let n be divisible by 2, then we have:

$divisorSigma[n,3] - n^3 > ((\frac{1}{2})n)^3 = (\frac{1}{8}) n^3 $
In order to be abundant $divisorSigma[n,3] - n^3 $ must be greater than $n^2$.
$(\frac{1}{8}) n^3 > n^2 \implies (\frac{1}{8})n > 1 \implies n \ge 8 \implies divisorSigma[n,3] - n^3 > n^2 $ when $ n \ge 8 $.
Furthermore, all numbers divisible by 3 greater than or equal to 27 are abundant.

For a prime divisor of n (call it p), we have:
$divisorSigma[n,3] - n^3 > ((\frac{1}{p})n)^3 = (\frac{1}{p^3}) n^3 $
$(\frac{1}{p^3}) n^3 \ge n^2 \implies n \ge p^3. $
So for $ n \ge p^3, divisorSigma[n,3] - n^3 > n^2. $

It is still uncertain if this completely classifies all the (3,2) abundant numbers, it does however provide an upper bound on deficient numbers divisible by a prime p.

For (k,m) = (4,3) there are 28643 (4,3) deficient numbers, 0 (4,3) perfect numbers, and 121357 (4,3) abundant numbers.

For n from 1 to 15 all numbers are (4,3) deficient, 16 is abundant and then after that all multiples of 2 are abundant. A similar line of reasoning shows that for prime divisors p of n we have:
$ divisorSigma[n,4] - n^4 > ((\frac{1}{p})n)^4 = (\frac{1}{p^4}) n^4 $
$(1/p^4) n^4 \ge n^3 \implies (1/p^4) n \ge 1 \implies n \ge p^4. $
So $ divisorSigma[n,4] - n^4 > n^3 $ For $ n \ge p^4 $ where p is a divisor of n.

For (k,m) = (5,3) there are 18937 (5,3) deficient numbers, 0 (5,3) perfect numbers, and 131063 (5,3) abundant numbers.

For n divisible by p we have:
$ divisorSigma[n,5] - n^5 > (\frac{1}{p})n)^5 \ge n^3 $
$(\frac{1}{p^5}) n^5 \ge n^3 \implies (1/p^5) n^2 \ge 1 \implies n^2 \ge p^5 \implies n \ge p^{5/2} $

So for n divisible by 2 we have, n is abundant if $ n \ge 2^{\frac{5}{2}} \implies n \ge 32^{\frac{1}{2}} \implies n \ge 6. $
For n divisible by 3 we have, n is abundant if $ n \ge 3^{\frac{5}{2}} \implies n \ge 243^{\frac{1}{2}} \implies n \ge 16. $

For (k,m) = (5,4) there are 35107 (5,4) deficient numbers, 0 (5,4) perfect numbers, and 114893 (5,4) abundant numbers.

The natural numbers from 1 to 29 are (5,4) deficient, however surprisingly 30 is the first abundant number, not 32.
A similar line of reasoning used before shows that as an upper bound if $ n \ge 2^5 = 32 $, then the even numbers are abundant. To understand why 30 is the first abundant number we use a composite divisor of 30, 6.
If n is divisible by 6, then n is also divisible by 2 and 3 so (for n not equal to 6) we have:
$ divisorSigma[n,5] - n^5 > ((\frac{1}{6})n)^5 + ((\frac{1}{3})n)^5 + ((\frac{1}{2})n)^5 \ge n^4 $
$((\frac{1}{7776}) + (\frac{1}{243}) + (\frac{1}{32})) n^5 \ge n^4 \implies (23/648) n \ge 1 \implies n \ge 648/23 > 28 $

Which demonstrates that for n divisible by 6 where n > 28, n is (5,4) abundant.

This does not exhaust all possible divisors that put an upper bound on n being (k,m) deficient but it does illustrate a technique to find an upper bound for (k,m) deficient numbers divisible by a divisor d.

To recap, for $ k < m $ all n are (k,m) deficient, it is likely that for $ k = m $ other than (1,1) all n are (k,m) deficient, and for k = 1,2,3,4,5 and m = 1 and for k = 4,5 and m = 2 all prime numbers and 1 are (k,m) deficient and all composite numbers are (k,m) abundant. Thus we can conclude with certainty, that there are no (1,2), (1,3), (1,4), (1,5), (2,1), (2,3), (2,4), (2,5), (3,1), (3,4), (3,5), (4,1), (4,2), (4,5), (5,1), or (5,2) perfect numbers.

$\endgroup$

You must log in to answer this question.

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