fred(X,Y) :- fred(Y,X).

% what is the fibinachi(20).
fib(0,1).
fib(1,1).
fib(2,1).
fib(N, X) :-
	N > 2,
	N1 is N - 1,
	N2 is N-2,
	fib(N1, A),
	fib(N2, B),
	X is A+B.

randy(0,1).
randy(1,1).
randy(N, Answer) :-
	N > 1,
	N2 is N // 2,
	N3 is N // 3,
	randy(N2, Sub2),
	randy(N3, Sub3),
	Answer is Sub2 + Sub3.



biglist(0, []).
%biglist(1, [x]).
biglist(Count, [x|Answer]) :-
	Count > 0,
	Count1 is Count - 1,
	biglist(Count1, Answer).


count(_, [], 0).
count(Item, [Item|Tail], Answer) :- 
	count(Item, Tail, SubAnswer),
	Answer is SubAnswer+1.
count(Item, [NotItem|Tail], Answer) :- 
	Item \= NotItem, 
	count(Item, Tail, Answer).


printt(X) :-
	X < 21,
	write(X), nl, X1 is X + 1, printt(X1).
