Half Perfect

Find the smallest positive integer that is exactly half the sum of its proper divisors.


The answer is 120.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

5 solutions

Sahil Goyat
Sep 3, 2019

Solution using Python(Jupyter Notebook):

INPUT:-


y=1000
for i in range(1,y+1):
    s=0
         for m in range(1,i):
          x=i%m
          if x==0:
              s=s+m
     if s==2*i:
     print(i)

OUTPUT:-


120
672

Out of which 120 is the smallest and hence it is the solution :) i hope python as a solution is accepted.

are you comparing between 120 and 6 ,and conclude that 120 is smallest?

trupal panchal - 1 year, 7 months ago

Log in to reply

Thanks for pointing out i wrote 6 instead of 672.

Sahil Goyat - 1 year, 6 months ago
Patrick Corn
Aug 22, 2019

The equation we are trying to solve is σ ( n ) = 3 n , \sigma(n) = 3n, where σ ( n ) \sigma(n) is the sum of the divisors of n . n. It's not hard to see that 120 \fbox{120} is the answer by inspection. Here's an indication of how I got to it.

The fraction σ ( n ) n \frac{\sigma(n)}{n} is multiplicative , and it's not hard to see that, for any prime p , p, we have p + 1 p σ ( p k ) p k < p p 1 . \frac{p+1}{p} \le \frac{\sigma(p^k)}{p^k} < \frac{p}{p-1}. (The left inequality is because σ ( p k ) p k + p k 1 , \sigma(p^k) \ge p^k + p^{k-1}, and the right inequality is because σ ( p k ) p k = p k + 1 1 ( p 1 ) p k < p k + 1 ( p 1 ) p k = p p 1 . \frac{\sigma(p^k)}{p^k} = \frac{p^{k+1}-1}{(p-1)p^k} < \frac{p^{k+1}}{(p-1)p^k} = \frac{p}{p-1}. ) So 3 2 σ ( 2 k ) 2 k < 2 4 3 σ ( 3 k ) 3 k < 3 2 6 5 σ ( 5 k ) 5 k < 5 4 \begin{aligned} \frac32 \le \frac{\sigma(2^k)}{2^k} &< 2 \\ \frac43 \le \frac{\sigma(3^k)}{3^k} &< \frac32 \\ \frac65 \le \frac{\sigma(5^k)}{5^k} &< \frac54 \end{aligned} so if n n has only 2 2 s and 3 3 s in its prime factorization, we always have σ ( n ) n < 2 3 2 = 3. \frac{\sigma(n)}{n} < 2 \cdot \frac32 = 3. This argument also shows that a solution n n must have at least three distinct prime factors.

So let's try n n of the form 2 a 3 b 5 c . 2^a 3^b 5^c. In this case, we will need σ ( 2 a ) \sigma(2^a) or σ ( 3 b ) \sigma(3^b) to be divisible by 5. 5. The first such b b is b = 3 , b=3, which leads to a number that's at least 270. 270. The first such a a is a = 3. a=3. In this case, σ ( 2 3 ) / 2 3 = 15 / 8. \sigma(2^3)/2^3 = 15/8. In this case, 15 8 4 3 6 5 σ ( 2 3 3 b 5 c ) 2 3 3 b 5 c , \frac{15}8 \frac43 \frac65 \le \frac{\sigma(2^3 3^b 5^c)}{2^3 3^b 5^c}, but the left side equals 3, and equality holds precisely when b = c = 1 , b=c=1, which gives us n = 2 3 3 5 = 120. n=2^3 \cdot 3 \cdot 5 = 120.

There aren't very many numbers less than 120 120 with three distinct prime factors, so it's easy to check them all directly to see that σ ( n ) < 3 n \sigma(n) < 3n for all of them.

Razing Thunder
Jul 1, 2020
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
def factor_sum(a):
    x=0
    for i in range(1,a+1):
        if a%i==0:
            x=x+i
    return x

for j in range(1,1000000):
    v=factor_sum(j)
    if j==(v-j)/2:
        print(j)

Feras Mahmoud
Oct 29, 2019

Using Mathematica: i = 1; While[True, If[i == (Total@Divisors[i] - i)/2, Print[i]; Break[]]; i++ ]

Zaid Ahmed
Sep 9, 2019

We are looking for n n where σ ( n ) = 3 n σ(n) = 3n

(where σ ( n ) σ(n) = sum of divisors of n n including n n )

A perfect number has σ ( n ) = 2 n σ(n) = 2n and therefore a half perfect number is σ ( n ) = 3 n σ(n) = 3n .

Note: we are looking for proper divisors of n n so we discount n n and therefore σ ( n ) = 3 n σ (n) = 3n in order for an integer to be exactly half the sum of its proper divisors.

Example: the proper divisors of 12 12 are 1 , 2 , 3 , 4 , 6 1, 2, 3, 4, 6 where the sum = 16 = 16 . σ ( 12 ) = 28 σ(12) = 28 .

The formula for σ ( p k ) = p k + 1 1 p 1 σ(p^k) = \frac {p^{k+1} - 1} {p - 1}

For example, consider n = 28 n = 28 , which is a perfect number:

n = 2 2 7 1 n = 2^2 * 7^1

=>

σ ( 28 ) = σ ( 2 2 7 1 ) = σ ( 2 2 ) σ ( 7 1 ) = ( 2 3 1 2 1 ) ( 7 2 1 7 1 ) = 56 σ(28) = σ(2^2 * 7^1) = σ(2^2) * σ(7^1) = (\frac {2^{3} - 1} {2 - 1}) * (\frac {7^{2} - 1} {7 -1}) = 56

=>

σ ( 28 ) = 56 = 2 n σ(28) = 56 = 2n = perfect number.

A Solution

With the knowledge that σ ( n ) = 3 n σ(n) = 3n , I first started by considering the values of 2 k 1 2 1 = 2 k 1 \frac {2^{k} - 1} {2-1} = 2^{k} - 1 where 3 3 is a factor. So 2 4 1 2^{4} - 1 , 2 6 1 2^{6} - 1 , 2 8 1 2^{8} - 1 etc etc

Take σ ( 2 3 ) = 2 4 1 2 1 = 15 = 3 5 σ(2^{3}) = \frac {2^{4} - 1} {2 - 1} = 15 = 3 * 5 which is a factor of σ ( n ) σ(n) if n = 2 3 a b c . . . . . . n = 2^{3} * a * b* c......

So in our value of σ ( n ) σ(n) we will have 2 4 1 2 1 = 15 = 3 5 \frac {2^{4} - 1} {2 - 1} = 15 = 3 * 5 as a factor.

Therefore, as σ ( n ) σ(n) is 3 3 times n n , I began by letting n = 2 3 5 a b . . . . . n = 2^{3} * 5 * a * b ..... not including the factor 3 3 from σ ( 2 4 ) σ(2^{4}) because of the fact σ ( n ) = 3 n σ(n) = 3n .

Note that we have not yet accounted for 2 3 2^{3} in our value of n n which is our aim.

With 5 5 added as a factor of n n we consider σ ( 5 k ) = 5 k 1 5 1 σ(5^{k}) = \frac {5^{k} - 1} {5-1} which will be a factor of σ ( n ) σ(n) .

Let's consider σ ( 5 1 ) = 5 2 1 5 1 = 6 = 2 3 σ(5^{1}) = \frac {5^{2} - 1} {5-1} = 6 = 2 * 3

Now let n = 2 3 3 5 . . . . . n = 2^{3} * 3 * 5 * ..... and we have now accounted for 2 1 2^{1} from our value of σ ( 5 1 ) σ(5^{1})

With 3 3 added as a factor of n n we consider σ ( 3 k ) = 3 k 1 3 1 σ(3^{k}) = \frac {3^{k} - 1} {3-1} which will be a factor of σ ( n ) σ(n) .

Let's consider σ ( 3 1 ) = 3 2 1 3 1 = 4 = 2 2 σ(3^{1}) = \frac {3^{2} - 1} {3-1} = 4 = 2^{2} .

From this result we add no more distinct prime factors to the value of n n and have accounted for the remaining factorisation of 2 3 2^{3} .

Therefore n = 2 3 3 5 n = 2^{3} * 3 * 5 .

I hope this explanation does make sense. It is one way to solve the question.

I had initially got the question half-wrong, in that I discovered a half perfect number but not the smallest. This is because I actually first considered 2 6 1 = 63 2^{6} -1 = 63 and in my haste rushed to produce an answer.

The solution for that is as follows:

Take σ ( 2 5 ) = 2 6 1 2 1 = 63 = 3 3 7 σ(2^{5}) = \frac {2^{6} - 1} {2 - 1} = 63 = 3 * 3 * 7 which is a factor of σ ( n ) σ(n) if n = 2 5 a b c . . . . . . n = 2^{5} * a * b* c......

Let n = 2 5 7 3 a b . . . . . n = 2^{5} * 7 * 3 * a * b ..... removing a factor 3 3 .

Consider σ ( 7 1 ) = 7 2 1 7 1 = 8 = 2 3 σ(7^{1}) = \frac {7^{2} - 1} {7-1} = 8 = 2^{3}

Now let n = 2 5 7 3 a b . . . . . n = 2^{5} * 7 * 3 * a * b ..... with no distinct primes being added and 2 3 2^{3} being accounted for.

Consider σ ( 3 1 ) = 3 2 1 3 1 = 4 = 2 2 σ(3^{1}) = \frac {3^{2} - 1} {3-1} = 4 = 2^{2}

Now let n = 2 5 7 3 n = 2^{5} * 7 * 3 be our final answer with no distinct primes being added and the remaining 2 2 2^{2} being accounted for.

Therefore n = 2 5 7 3 = 672 n = 2^{5} * 7 * 3 = 672 and is a half perfect number.

σ ( 672 ) = σ ( 2 5 ) σ ( 7 1 ) σ ( 3 1 ) σ(672) = σ(2^{5}) * σ(7^{1}) * σ(3^{1})

= 2 6 1 2 1 7 2 1 7 1 3 2 1 3 1 = 63 8 4 = 2016 = 3 672 = \frac {2^{6} - 1} {2 - 1} * \frac {7^{2} - 1} {7 - 1} * \frac {3^{2} - 1} {3 - 1} = 63 * 8 * 4 = 2016 = 3 * 672

=>

672 672 is a half perfect number.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...