Skip to content

Instantly share code, notes, and snippets.

  • Save Denenberg/3fc83c325311d8b6b177cd5dfdc62911 to your computer and use it in GitHub Desktop.
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», они ведь так похожи, прямо сёстры-близняшки:
# В 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