Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
environments = [{'cnt':0, 'seq':i+1} for i in range(12)]
|
||||
|
||||
code = '''
|
||||
print('% 4d' % seq, end='')
|
||||
if seq != 1:
|
||||
cnt += 1
|
||||
seq = 3 * seq + 1 if seq & 1 else seq // 2
|
||||
'''
|
||||
|
||||
while any(env['seq'] > 1 for env in environments):
|
||||
for env in environments:
|
||||
exec(code, globals(), env)
|
||||
print()
|
||||
|
||||
print('Counts')
|
||||
for env in environments:
|
||||
print('% 4d' % env['cnt'], end='')
|
||||
print()
|
||||
Loading…
Add table
Add a link
Reference in a new issue