Skip to content
Snippets Groups Projects
Commit bb4b1b5c authored by François Lasota's avatar François Lasota
Browse files

Algorithme python PGCD fini mais pas bo

parent 1359d8e3
Branches
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage[a4paper, total={6in, 8in}]{geometry}
\usepackage{movie15} % Pour pouvoir mettre des gifs
\usepackage{listings}
\newtheorem{theorem}{Théorème}
\newtheorem{proof}{Démonstration}
\title{Le théorème fondamental de l'arithmétique}
......@@ -216,8 +216,17 @@ Il a été énoncé par Euclide dans son livre \textit{Les Éléments} numéro V
Effectivement, $12=4 \times 3$ et $8=4 \times 2$
\begin{lstlisting}[language=Python]
def PGCD(A,B): # On assume que A>B
E=[] # Je n'ai pas fait l'algorithme humain, mais un algorithme plus efficace pour les ordinateurs
for i in range(A):
if A%i==0 and B%i==0: # Si Le nombre est diviseurs de A et B.
E.append(i)
return E[-1] # Le dernier etant le plus grand, pouvant etre 1
\subsection{Algotrithme du PPCM}
\end{lstlisting}
\subsection{Algorithme du PPCM}
\begin{itemize}
\item Déterminons l'algorithme que l'humain utiliserait pour calculer le PPCM entre 2 nombres A et B appartenant à $\mathbb{N^{*}}$:
\item En premier lieu, il faut trouver \hyperref[th:exemple]{la décomposition en facteurs premiers} $F_{A}$ de A, et respectivement $F_{B}$ de B.
......
{
"command": "config",
"jobname": "Rapport",
"timestamp": "20250114184021",
"cachedir": "_minted",
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment