CPSolver.Examples.Euler43 (Fixpoint v0.8.50)

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

Link to this function

check_solution(solution)

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)," "];

Link to this function

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