teaching:progappchim:algos_entiers

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
teaching:progappchim:algos_entiers [2023/01/10 09:00] – [Factorisation en nombres premiers] villersdteaching:progappchim:algos_entiers [2023/01/10 09:04] (Version actuelle) villersd
Ligne 137: Ligne 137:
   * librairie sympy → pip install sympy (ou conda install sympy)   * librairie sympy → pip install sympy (ou conda install sympy)
     * Use the function sympy.ntheory.factorint : "Given a positive integer n, factorint(n) returns a dict containing the prime factors of n as keys and their respective multiplicities as values." For example:     * Use the function sympy.ntheory.factorint : "Given a positive integer n, factorint(n) returns a dict containing the prime factors of n as keys and their respective multiplicities as values." For example:
-    * from sympy.ntheory import factorint +<code python> 
-    factorint(10**20+1) → {73: 1, 5964848081: 1, 1676321: 1, 137: 1}+from sympy.ntheory import factorint 
 +factorint(10**20+1) → {73: 1, 5964848081: 1, 1676321: 1, 137: 1} 
 +</code> 
 ===== Références ===== ===== Références =====
   * [[http://stackoverflow.com/questions/16996217/prime-factorization-list]]   * [[http://stackoverflow.com/questions/16996217/prime-factorization-list]]
  • teaching/progappchim/algos_entiers.txt
  • Dernière modification : 2023/01/10 09:04
  • de villersd