countdown(0) :- write(0).

countdown(N) :- write(N), N1 is N-1, countdown(N1).