Puzzle #68

Aufgabe:

Code 01:

f(x):=makelist(10^(x-i),i,1,x);
zahl1:[s,p,r,i,n,g];
zahl2:zahl1;
zahl3:[a,l,l,e,r,g,y];
gleichung:zahl1.f(6)+zahl2.f(6)=zahl3.f(7);
buchstaben:setify(flatten([zahl1,zahl2,zahl3]));

Code 02:

ziffern:setify(makelist(i,i,0,9))$
disp(" {a,e,g,i,l,n,p,r,s,y}")$
for a in setdifference(ziffern,{0}) do \
for e in setdifference(ziffern,{a}) do \
for g in setdifference(ziffern,{a,e}) do \
for i in setdifference(ziffern,{a,e,g}) do \
for l in setdifference(ziffern,{a,e,g,i}) do \
for n in setdifference(ziffern,{a,e,g,i,l}) do \
for p in setdifference(ziffern,{a,e,g,i,l,n}) do \
for r in setdifference(ziffern,{a,e,g,i,l,n,p}) do \
for s in setdifference(ziffern,{0,a,e,g,i,l,n,p,r}) do \
for y in setdifference(ziffern,{a,e,g,i,l,n,p,r,s}) do \
if 200000*s+2000*r+20000*p+20*n+200*i+2*g= \
y+100*r+110000*l+10*g+1000*e+1000000*a then \
disp([a,e,g,i,l,n,p,r,s,y]);


Lösung
:

l68

Vroomlab: http://vroomlab.com oder http://www.omega-math.com/

puzzle68
Copy&Paste Code 02