• Aucun résultat trouvé

2): return True if (atester

N/A
N/A
Protected

Academic year: 2022

Partager "2): return True if (atester"

Copied!
1
0
0

Texte intégral

(1)

from math import * 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 nmax=10002

dmax=8

for n in range(14,nmax,2):

pi2x = 0

for compteprem in range(2,n+1,1):

if (prime(compteprem)):

pi2x=pi2x+1 xa=0 ; xd=0

for x in range(3,n//2+1,2):

if (prime(x)):

if (prime(n-x)):

xa=xa+1 else:

if (not(prime(n-x))):

xd=xd+1 print('')

print('%6d : Xa %6d Xd %6d' % (n,xa,xd))

print(' : E(n/4) %6d pi(n) %6d E(n/4)-pi(n) %6d delta %6d' % (n//4,pi2x,n//4-pi2x,xd-xa-n//4+pi2x))

##############################################################################

# valeurs des variables

##############################################################################

#

# xa = #{p+q=n / p%2 = 1 et q%2 = 1 et 3 <= p <= n/2 et p et q premiers}

# xd = #{p+q=n / p%2 = 1 et q%2 = 1 et 3 <= p <= n/2 et p et q composes}

#

##############################################################################

# invariants

##############################################################################

#

# xd-xa=floor(n/4)-pi2x+delta

#

###########################################################################

Références

Documents relatifs

exécuter des instructions si la condition est vraie, ce qui s´écrit en pseudo code:.

On the other hand, asynchronous innocence generalizes the usual notion of in- nocence to more ”concurrent” arenas, in which several moves n 1 , ..., n k may justify the same move m —

[r]

The pertinent register contents pertaining to each type of alarm are filled in at the time an alarm occurred. If prints are needed they may be ordered at the

Dans les espaces publics, les jardins privés, les zones résidentielles et les hôtels : habillée d'un boîtier élégant dont la forme claire et discrète fait appel aux sens,

AllocGlobalFrame: PROCEDURE [cseg: SegmentDefs.FileSegmentHandle] RETURNS [frame: Globa1FrameHand1e, size: CARDINAL, cp: POINTER TO CsegPrefix] = 8EGIN OPEN

Créer un programme demandant à l'utilisateur son salaire annuel, et renvoyant son impôt sur le revenu.. Vérier le programme sur

We establish indeed that the cardinal notion of sequential game semantics — innocence — follows from el- ementary principles of concurrency theory, formulated in asynchronous