% Produces a list of numbers generated by a decreasing fator N, so that 
% Xi = Xi-1 - N, Xi+1 = Xi - N - 1.

:- use_package(fd).
:- use_module(library(prolog_sys), [statistics/2]).
:- use_module(library(format)).

dec_seqs(N, L) :-
	statistics(runtime,_),
	do_seqs(N,_,L),
	labeling(L), 
	statistics(runtime,[_, Time]),
	format("Used ~d milliseconds~n", Time).


do_seqs(N, A, [A|L]) :-
	N .>. 0,
	A .=. B + N,
	N1 .=. N - 1,
	do_seqs(N1, B, L),
	all_different([A|L]).
do_seqs(0,0,[]).
