Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,13 @@
from collections import Counter
def function_length_frequency(func, hrange):
return Counter(len(func(n)) for n in hrange).most_common()
if __name__ == '__main__':
from executable_hailstone_library import hailstone
upto = 100000
hlen, freq = function_length_frequency(hailstone, range(1, upto))[0]
print("The length of hailstone sequence that is most common for\n"
"hailstone(n) where 1<=n<%i, is %i. It occurs %i times."
% (upto, hlen, freq))