| Deutsch English Français Italiano |
|
<tut1em$1079d$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Dominique <zzz@aol.com>
Newsgroups: fr.sci.maths
Subject: Re: 0!=1 ?
Date: Wed, 15 Mar 2023 19:06:14 +0100
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <tut1em$1079d$1@dont-email.me>
References: <turdrh$naru$1@dont-email.me> <tusrn5$v1lf$1@dont-email.me>
<tuss29$1dfo$1@cabale.usenet-fr.net> <tusvf0$vs65$1@dont-email.me>
<tusvt2$1i19$1@cabale.usenet-fr.net> <tut05s$vs65$2@dont-email.me>
<tut09u$vs65$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 15 Mar 2023 18:06:14 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="5f157d7e8166bebf3e8b4121eb1e2840";
logging-data="1056045"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+aPBUIjuS55lt29P6EfJl6ILLaWcNwP1Y="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:wYLYVWYQ34VX8vnqHXojfKwnnqA=
In-Reply-To: <tut09u$vs65$3@dont-email.me>
Content-Language: fr
Bytes: 2103
Le 15/03/2023 à 18:46, Dominique a écrit :
> Le 15/03/2023 à 18:44, Dominique a écrit :
>> Le 15/03/2023 à 18:39, Olivier Miakinen a écrit :
>>
>>
>>> Mais je me suis dit qu'il serait étonnant qu'elle n'existe pas, et
>>> aussi que le module math serait le plus approprié pour l'y trouver :
>>> <https://docs.python.org/3/library/math.html>.
>>
>> Et moi qui me suis cassé les pieds à coder une factorielle, en me
>> trompant en plus :)
>
> Et je résous mon énigme arithmétique du premier coup :)
>
from math import factorial
result=False
cpt=1
while not result:
nb=str(cpt)
nb1=[int(x) for x in nb]
nb2=0
for i in nb1:
nb2+=factorial(i)
if nb2==cpt:
if cpt==40585:
result=True
print(cpt)
cpt+=1
--
Dominique
Courriel : dominique point sextant ate orange en France
Esto quod es