-
-
Save Denenberg/3fc83c325311d8b6b177cd5dfdc62911 to your computer and use it in GitHub Desktop.
В OEIS есть последовательность A162462 Sum of all numbers from n to sigma(n). Мне вот подумалось, а почему бы не создать последовательность «Sum of all numbers from τ(n) to n», они ведь так похожи, прямо сёстры-близняшки:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# В OEIS есть последовательность | |
# A162462 Sum of all numbers from n to sigma(n). | |
# Мне вот подумалось, а почему бы не создать последовательность | |
# «Sum of all numbers from τ(n) to n», | |
# они ведь так похожи, прямо сёстры-близняшки: | |
from sympy import divisors | |
def b(n): | |
return sum(range(len(divisors(n)), n+1)) | |
for i in range(1, 101): | |
print(b(i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment