Not everything can be done in constant time, that's O(k)
magic_lobster_party @ magic_lobster_party @kbin.run Posts 1Comments 624Joined 1 yr. ago
magic_lobster_party @ magic_lobster_party @kbin.run
Posts
1
Comments
624
Joined
1 yr. ago
My implementation: https://pastebin.com/3PskMZqz
Results at bottom of file.
I’m taking into account that when I update a hash, all the hashes to the right of it should also be updated.
Number of hashes is about 2.71828 x n! as predicted. The time seems to be proportional to n! as well (n = 12 is about 12 times slower than n = 11, which in turn is about 11 times slower than n = 10).
Interestingly this program turned out to be a fun and inefficient way of calculating the digits of e.