John Horton Conway has a ten
digit number, abcdefghij. Each of the digits is different, and
- a is divisible by 1
- ab is divisible by 2
- abc is divisible by 3
- abcd is divisible by 4
- abcde is divisible by 5
- abcdef is divisible by 6
- abcdefg is divisible by 7
- abcdefgh is divisible by 8
- abcdefghi is divisible by 9
- abcdefghij is divisible by 10
Write a predicate solution/1
that unifies its argument with the solution as a
list of numbers.
?- solution(X).
X = [...] ;