CPSolver.Examples.Euler43 (Fixpoint v0.10.2)

https://projecteuler.net/problem=43

Summary

Functions

int: n = 10; array[1..n] of var 0..9: x; array[int] of int: primes = [2,3,5,7,11,13,17]; solve satisfy; constraint all_different(x) / forall(i in 2..8) (

Functions

check_solution(solution)

model()

int: n = 10; array[1..n] of var 0..9: x; array[int] of int: primes = [2,3,5,7,11,13,17]; solve satisfy; constraint all_different(x) / forall(i in 2..8) (

(100*x[i] + 10*x[i+1] + x[i+2]) mod primes[i-1] = 0

) ; output [ show(x)," "];

run(opts \\ [search: {:input_order, :indomain_random}, space_threads: 8])