function ki=hatvanyit(A,n)

x=ones(size(A,1),1);

for i=1:n
    x=A*x/norm(A*x);
end
ki=(x'*A*x)/(x'*x);