• Aucun résultat trouvé

2): return True if (atester

N/A
N/A
Protected

Academic year: 2022

Partager "2): return True if (atester"

Copied!
2
0
0

Texte intégral

(1)

from math import *

from numpy import * import numpy as np

def prime(atester):

pastrouve = True k = 2

if (atester == 1): return False if (atester == 2): return True if (atester == 3): return True if (atester == 5): return True if (atester == 7): return True while (pastrouve):

if ((k * k) > atester):

return True else:

if ((atester % k) == 0):

return False else: k=k+1

tabfacteurs=np.zeros((1000),dtype='i') tabpuiss=np.zeros((1000),dtype='i') tabexpo=np.zeros((1000),dtype='i') nbmaxfixes = 0 ;

for i in range(3,1000,2):

comptelesptsfixes = 0 tabfacteurs[i] = 1 tabpuiss[i] = 1 tabexpo[i] = 1 somme = 0 tempo = i p = i/2 nbdiv = 1 nbdivp = 0 print(' ')

if (prime(tempo)):

print(str(tempo)+" est premier.") tabfacteurs[1] = tempo

tabpuiss[1] = tempo tabexpo[1] = 1

while ((tempo > 1) and (p > 1)):

if ((prime(p)) and ((tempo%p) == 0)):

tabfacteurs[nbdiv] = p nbdiv = nbdiv+1

tempo = tempo/p p=p-1

if (not(prime(i))):

nbdiv=nbdiv-1

if ((nbdiv == 1) and (prime(i))):

tabpuiss[1] = i tabexpo[1] = 1

elif ((nbdiv == 1) and (not(prime(i)))):

tempo = tabfacteurs[1]

tabpuiss[1] = i expo = 1

while (tempo < i):

tempo=tempo*tabfacteurs[1] ; expo = expo+1

tabexpo[1] = expo elif (nbdiv > 1):

for k in range(1,nbdiv+1,1):

tempo = tabfacteurs[k]

expo = 1

while (((i%tempo) == 0) and (tempo < i)):

(2)

tempo=tempo*tabfacteurs[k]

expo = expo+1

tabpuiss[k] = tempo/tabfacteurs[k]

tabexpo[k] = expo-1 machaine = ""

for k in range(1,nbdiv+1,1):

machaine+=str(tabfacteurs[k])+"^"+str(tabexpo[k])+"."

print(str(i)+' = '+machaine) #partie x^2=x

k = 0

while (k <= i-1):

machaine=""

if (((k*k)%i) == 0):

if (k == 0):

print("0 fixe")

comptelesptsfixes = comptelesptsfixes+1 else :

print(str(k)+" de carre nul.") elif (((k*k) % i) == k):

machaine+=str(k)+" fixe "

print(machaine)

comptelesptsfixes = comptelesptsfixes+1 k=k+1

resal = comptelesptsfixes

print("Nombre de points fixes "+str(resal))

Références

Documents relatifs

The PC Network Technical Reference Manual (IBM Part Number 6322505) documents the original PC Network LANA NetBIOS program- ming interface and includes a Network Adapter

Theorem 6.4.1 For nite nets that may contain hidden transitions, the trace equivalence problem and the failure equivalence problem can be decided in space which is a product

Three key ingredients of our analysis are: a suitable concrete form of the Araki-Woods representation of the radiation field, Mourre’s positive commutator method combined with a

More generally, one might be tempted to endorse the following principle: if a context-insensitive, temporally specific sentence is uttered in a context in which it is about the

……… her father in Forks, Washington to allow her mother to travel with her new husband, a minor league baseball player. After moving to Forks, Bella finds herself involuntarily

The Fundamental Theorem of Calculus

“with its single serpent is the only true symbol of medicine.” If one looks anywhere on the island of Kos or around the archeological sites of the Aesculapeon, the single

Here we use numerical dynamos driven by heterogeneous core–mantle boundary heat flux from a mantle global circulation model to demonstrate how mantle convection produces true