Sup'Internet: collatz

This commit is contained in:
Julien Palard 2018-04-28 16:38:49 +02:00
parent 308dd288e1
commit 6b3acb8445
1 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,57 @@
status: hidden
title: Python — Collatz
slug: nohl8aTh-collatz
robots: noindex
# Longest Collatz sequence you can find
## Introduction
The project name is: *collatz*.
You'll give back your project using this protocol:
https://mdk.fr/pages/obiree2uaza2sh-rendu.html
The mail body should also contain the longest collatz sequence you
found.
## Project
Make a program taking *no paramter*, named *collatz.py*, computing
Collatz sequences, and printing its best findings as it goes, maybe
like:
$ python3 collatz.py
Collatz from 1 of len 1
Collatz from 2 of len 2
Collatz from 3 of len 8
Collatz from 6 of len 9
Collatz from 7 of len 17
Collatz from 9 of len 20
Collatz from 18 of len 21
Collatz from 25 of len 24
Collatz from 27 of len 112
Collatz from 54 of len 113
Collatz from 73 of len 116
Collatz from 97 of len 119
Collatz from 129 of len 122
Collatz from 171 of len 125
Collatz from 231 of len 128
Collatz from 313 of len 131
Collatz from 327 of len 144
Collatz from 649 of len 145
Collatz from 703 of len 171
Collatz from 871 of len 179
Collatz from 1161 of len 182
Collatz from 2223 of len 183
Collatz from 2463 of len 209
Collatz from 2919 of len 217
Collatz from 3711 of len 238
Collatz from 6171 of len 262
Collatz from 10971 of len 268
Collatz from 13255 of len 276
Collatz from 17647 of len 279
Collatz from 23529 of len 282
Your program should never end.