TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

On infinite decimal expansions, missing numbers, and generating functions (2021)

27 pointsby gone35about 3 years ago

2 comments

svatabout 3 years ago
Great stuff. The incredible identity at the end checks out:<p><pre><code> import sympy def divisor_power_sum(n, k): return sum(d**k for d in sympy.divisors(n)) n = 0 while True: n += 1 lhs = divisor_power_sum(n, 7) rhs = divisor_power_sum(n, 3) + 120 * sum( divisor_power_sum(m, 3) * divisor_power_sum(n - m, 3) for m in range(1, n)) print(n, lhs, rhs) assert lhs == rhs </code></pre> (Yes I see sympy has a `divisor_sigma` already, but I wanted to implement it myself.)<p>(BTW, one of my earliest well-received comments on HN, back from 2015, was about 1&#x2F;999999999999999999999998999999999999999999999999, discussed in the post: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9816375" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9816375</a>)
dataflowabout 3 years ago
Also see generatingfunctionology: <a href="https:&#x2F;&#x2F;www2.math.upenn.edu&#x2F;~wilf&#x2F;DownldGF.html" rel="nofollow">https:&#x2F;&#x2F;www2.math.upenn.edu&#x2F;~wilf&#x2F;DownldGF.html</a>