Jump to content
  • 0
Freddy

Des chiffres et des lettres

Question

Chaque lettre correspond à un chiffre.

Des lettres distinctes correspondent à des chiffres distincts.

 

Et maintenant, trouvez quel chiffre se cache derrière chaque lettre :

 

  • 2 * bvph + 3 * ribi = djino
  • b < v < p < h

 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
Révélation

Je suis très nul à ce genre d'énigme.

Révélation

mais en programmant de façon bourrin :



pioche=[0,1,2,3,4,5,6,7,8,9]
for h in [9,8,7,6,5,4,3]:
    pioche2=pioche.copy()
    pioche2.remove(h)
    for i in pioche2:
        o=(2*h+3*i)%10
        r1=(2*h+3*i)//10
        if o in pioche2:
            pioche3=pioche2.copy()
            pioche3.remove(o)
        else:
            break
            
        for b in pioche3:
            pioche4=pioche3.copy()
            pioche4.remove(b)
            for p in pioche4:
                if p>h:
                    break
                pioche5=pioche4.copy()
                pioche5.remove(p)
                n=(2*p+3*b+r1)%10
                if n in pioche5:
                    pioche6=pioche5.copy()
                    pioche6.remove(n)
                else:
                    break
                r2=(2*p+3*b+r1)//10
                for v in pioche6:
                    if v>p:
                        break
                    if b>v:
                        break
                    if (2*v+3*i+r2)%10!=i:
                        break
                    r3=(2*v+3*i+r2)//10
                    pioche7=pioche6.copy()
                    pioche6.remove(v)
                    for r in pioche7:
                        j=(2*b+3*r+r3)%10
                        if j in pioche7:
                            pioche8=pioche7.copy()
                            pioche7.remove(j)
                        else:
                            break
                        d=(2*b+3*r+r3)//10
                        if d in pioche8:
                            print("bvph",[b,v,p,h],"ribi",[r,i,b,i],"djino",[d,j,i,n,o])

j'obtiens :

Révélation

bvph [0, 1, 3, 5] ribi [6, 4, 0, 4] djino [1, 9, 4, 8, 2]

 

et effectivement

  0135

+ 0135

+ 6404

+ 6404

+ 6404

_______

=19482

 

 

 

Share this post


Link to post
Share on other sites
  • 0

@ribi il est indiqué que les lettres doivent avoir des valeurs distinctes. v et d ne peuvent pas avoir la même valeur.

 

Share this post


Link to post
Share on other sites
  • 0

Effectivement, j'ai fait quelques erreurs dans mon programme.

Révélation

pioche=[0,1,2,3,4,5,6,7,8,9]
for h in [9,8,7,6,5,4,3]:
    pioche2=pioche.copy()
    pioche2.remove(h)
    for i in pioche2:
        piochee=pioche2.copy()
        piochee.remove(i)
        o=(2*h+3*i)%10
        r1=(2*h+3*i)//10
        if o in piochee:
            pioche3=piochee.copy()
            pioche3.remove(o)
        else:
            continue
            
        for b in pioche3:
            pioche4=pioche3.copy()
            pioche4.remove(b)
            for p in pioche4:
                if p>h:
                    continue
                pioche5=pioche4.copy()
                pioche5.remove(p)
                n=(2*p+3*b+r1)%10
                if n in pioche5:
                    pioche6=pioche5.copy()
                    pioche6.remove(n)
                else:
                    continue
                r2=(2*p+3*b+r1)//10
                for v in pioche6:
                    if v>p:
                        continue
                    if b>v:
                        continue
                    if ((2*v+3*i+r2)%10)!=i:
                        continue
                    r3=(2*v+3*i+r2)//10
                    pioche7=pioche6.copy()
                    pioche7.remove(v)
                    for r in pioche7:
                        j=(2*b+3*r+r3)%10
                        if j in pioche7:
                            pioche8=pioche7.copy()
                            pioche8.remove(j)
                        else:
                            continue
                        d=(2*b+3*r+r3)//10
                        if d in pioche8:
                            print("bvph",[b,v,p,h],"ribi",[r,i,b,i],"djino",[d,j,i,n,o])
 

Ce code est certainement encore bogué car il me donne comme résultat

bvph [1, 4, 7, 9] ribi [8, 5, 1, 5] djino [2, 8, 5, 0, 3]

bvph [2, 4, 7, 8] ribi [0, 5, 2, 5] djino [0, 6, 5, 3, 1]

bvph [2, 5, 7, 8] ribi [1, 9, 2, 9] djino [1, 0, 9, 4, 3]

bvph [4, 5, 6, 7] ribi [3, 9, 4, 9] djino [2, 0, 9, 8, 1]

Seule la dernière solution utilise 10 chiffres différents donc je la  propose comme solution :

  4567

+ 4567

+ 3949

+ 3949

+ 3949

_______

=20981

 

 

  • Bien joué ! 1

Share this post


Link to post
Share on other sites
  • 0
il y a 16 minutes, ribi a dit :

 

  Masquer le contenu

Seule la dernière solution utilise 10 chiffres différents donc je la  propose comme solution :

  4567

+ 4567

+ 3949

+ 3949

+ 3949

_______

=20981

 

 

 

GG, h4ck3r!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

En utilisant ce site, vous acceptez notre Privacy Policy et nos Terms of Use
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.