# 12345678901234567890123456789012345 sub r{1+4*y/VLD//.E.(3*/M/+2*/C|D/+/X|L/)} ##```## 3*/M/+2*/C|D/+/X|L/ ##``````## for my \$m (1 .. 999) { for my \$n (1 .. 99) { for my \$p (4 .. 9) { \$M = ord(M)x3%\$m%\$n%\$p; \$D = ord(D)x3%\$m%\$n%\$p; \$C = ord(C)x3%\$m%\$n%\$p; \$L = ord(L)x3%\$m%\$n%\$p; \$X = ord(X)x3%\$m%\$n%\$p; \$V = ord(V)x3%\$m%\$n%\$p; \$I = ord(I)x3%\$m%\$n%\$p; if (\$M==3 && \$D==2 && \$C==2 && \$L==1 && \$X==1 && \$V==0 && \$I==0) { print "m=\$m n=\$n p=\$p: M=\$M D=\$D C=\$C L=\$L X=\$X V=\$V I=\$I\n"; } } } } ##``````## #include #define magic(v,m,n,p) ((v) % (m) % (n) % (p)) #define MATCH_M(M,D,C,L,X,V,I) ( (M)==3 \ && (D)==2 && (C)==2 \ && (L)==1 && (X)==1 \ && (V)==0 && (I)==0) int main(int argc, char* argv[]) { int m, n, p; int I, V, X, L, C, D, M; for (m = 1; m <= 999; ++m) { for (n = 1; n <= 99; ++n) { for (p = 4; p <= 9; ++p) { M = magic(777777, m, n, p); // 777777 is ord(M)x3 D = magic(686868, m, n, p); // 686868 is ord(D)x3 C = magic(676767, m, n, p); // 676767 is ord(C)x3 L = magic(767676, m, n, p); // 767676 is ord(L)x3 X = magic(888888, m, n, p); // 888888 is ord(X)x3 V = magic(868686, m, n, p); // 868686 is ord(V)x3 I = magic(737373, m, n, p); // 737373 is ord(I)x3 if (MATCH_M(M,D,C,L,X,V,I)) { printf("m=%d n=%d p=%d: M=%d D=%d C=%d L=%d X=%d V=%d I=%d\n", m, n, p, M, D, C, L, X, V, I); } } } } return 0; } ##``````## m=75 n=50 p=4: M=3 D=2 C=2 L=1 X=1 V=0 I=0 m=734 n=13 p=4: M=3 D=2 C=2 L=1 X=1 V=0 I=0 m=737 n=92 p=5: M=3 D=2 C=2 L=1 X=1 V=0 I=0 ##``````## ord()x3%75%50%4 ##``````## 3*/M/+2*/C|D/+/X|L/ ##``````## sub m1{1+4*y/VLD//.E.ord()x3%75%50%4} sub m2{1+4*y/VLD//.E.ord()*49/3%54%4} sub d1{1 .E.ord()*39%73%7%5>>y/VLD//} sub d2{1 .E.ord()*38/9%62%4>>y/VLD//} sub d3{1 .E.~-ord()*41%52%5>>y/VLD//} sub d4{1 .E.(8^ord)*29%65%4>>y/VLD//} ##``````## sub d5{1 .E.(72^ord)*5/7%5>>y/VLD//} sub d6{1 .E.(6^ord)%72%7%4>>y/VLD//} sub d7{1 .E.(76^2+ord)%7%5>>y/VLD//} ##``````## sub d8{1 .E.(3^77%ord)%7>>y/VLD//} sub m8{5**y/VLD//.E.(42^88*ord)%5} ```