D
D
d1zz72021-09-25 18:54:04
Mathematics
d1zz7, 2021-09-25 18:54:04

What is the maximum sum of divisors?

There is a task:

Дано число n. Найдите число из диапазона от 1 до n с максимальной суммой своих делителей (включая непростые делители, 1 и само число). Если таких чисел несколько, выведите минимальное из них.
Пример: Вход 5 -> выход 4. Вход 12 -> выход 12


I can not understand one thing, what is the maximum sum of divisors?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2021-09-25
@d1zz7

The divisor of the number A is the number B, when divided by which the number A is an integer. And A can have many divisors.
The number 8 has divisors - 1, 2, 4, 8. Their sum is 15.
The number 9 has divisors - 1, 3, 9. Their sum is 13.
The sum of the divisors of 8 is greater

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question