/* Belgian Mystery Number in Picat. MindYourDecisions: Belgian Mystery Number https://www.youtube.com/watch?v=KHLnnPix5aY """ I am thinking of a two-digit number. If i write 3 to the left of my number and double this three-digit number, the result is 27 times my original number. """ This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ import cp. main => go. % LP I go ?=> member(N,10..99), 2*(300+N) == 27*N, println(N), fail, nl. go => true. % LP II go2 ?=> foreach(N in 10..99, 2*(300+N) == 27*N) println(N) end, nl. go2 => true. % CP I go3 ?=> N :: 10..99, 2*(300+N) #= 27*N, solve([N]), println(N), fail, nl. go3 => true. % CP II go4 ?=> [A,B] :: 0..9, 600 + 20*A+2*B #= 27*(10*A+B), solve([A,B]), println([A,B]), fail, nl. go4 => true. % LP III go5 ?=> member(A,0..9), member(B,0..9), 600 + 20*A+2*B == 27*(10*A+B), println([A,B]), fail, nl. go5 => true