Mathématiques

Question

Bonjour a tous. Je suis en seconde j'ai besoin d'aide pour un devoir en maths. Merci pour tout ceux qui m'aideront !

Exercice 1: en 1742 Christophe a écrit une lettre adressée à Léonard que tout entier pair strictement supérieur à 2 peut s’écrire comme la somme de deux nombres premiers vérifie que la conjecture de Christophe Vrai pour tous les nombre entier compris entre 50 et 80 entre (inclus). Info : la conjecture de Christophe est l’un des célèbre résultas non encore démontrer en 2019 en2014 elle l’avais été vérifier numériquement pour tout les entier pairs inférieurs à 4x10 au carrer 18

1 Réponse

  • Réponse :

    Bonjour,

    Explications étape par étape

    50 = 3 + 47

    52 = 5 + 47

    54 = 7 + 47

    56 = 3 + 53

    58 = 5 + 53

    60 = 7 + 53

    62 = 3 + 59

    64 = 3 + 61

    66 = 5 + 61

    68 = 7 + 61

    70 = 3 + 67

    72 = 5 + 67

    74 = 3 + 71

    76 = 3 + 73

    78 = 5 + 73

    80 = 7 + 73

    Voici le programme de vérification en qb64

    data 2,3,5,7,11,13,17,19,23,29

    data 31,37,41,43,47,53,59,61,67,71

    data 73,79

    const nbPrime=22

    const Faux=(0=1)

    const Vrai=not(Faux)

    dim shared Primes(nbPrime) as integer

    call init

    call Traiter(50,80)

    end

    function IsPrime%(p as integer)

       dim rep as integer

       rep=Faux

       for i=nbPrime to 1 step -1

           if Primes(i)=p then

               rep=Vrai

               exit for

           else

               if Primes(i)<p then

                   exit for

               end if

           end if

       next i

       IsPrime%=rep

    end function

    function GoldBach%(p1 as integer,pa as integer,pb as integer)

    dim rep as integer,a as integer,b as integer

       rep=Faux

       i=1

       do

           a=primes(i)

           b=p1-a

           if b<a then

               pa=-1

               pb=-1

               exit do

           end if

           if IsPrime%(b) then

               rep=Vrai

               pa=a

               pb=b

               exit do

           end if

           i=i+1

       loop

       GoldBach%=rep

    end function

    sub Traiter(p1 as integer,p2 as integer)

    dim n as integer, a as integer,b as integer

    open "c:\nosdevoirs\goldbach.txt" for output as #1

    for n=p1 to p2 step 2

       if not(Goldbach%(n,a,b)) then

           print "pas verifie:";n

           end

       else

           print n;"=";a;"+";b

           print #1,n;"=";a;"+";b

       end if

    next n

    close #1

    end sub

    sub Init

    dim i as integer

    restore

    for i=1 to nbPrime

       read Primes(i)

    next i

    end sub

Autres questions