evennum(N) :- 0 is N mod 2.
nonevennum(N) :- 1 is N mod 2.
sumsq_even([], 0).
sumsq_even([N | TailN], Sum) :-
evennum(N), sumsq_even(TailN, S), Sum is S + N * N.
sumsq_even([N | TailN], Sum) :-
sumsq_evennum(TailN, Sum),sumsq_even(TailN, S),Sum is S.