/* Prime looking problem in Picat. From Scampi's model PrimeLooking.scala """ Martin Gardner Problem: Call a number "prime-looking" if it is composite but not divisible by 2,3 or 5. The three smallest prime-looking numbers are 49, 77 and 91. There are 168 prime numbers less than 1000. How many prime-looking numbers are there less than 1000? @author Pierre Schaus pschaus@gmail.com """ 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. go ?=> N = 999, Vars = [X,D1,D2], Vars :: 2..N, X #= D1*D2, D1 #<= D2, foreach(I in [2,3,5]) X mod I #> 0 end, solve(Vars), println(x=X), println(d1=D1), println(d2=D2), nl, fail, nl. go => true.