	function soma=somatorio_p(num,y)
	
	sum1=0.d0;
	q=num+1;
	while (q<=5)
		sum1=sum1+y(num,q);
		q=q+1;
    end
	
    sum2=0.d0;
	q=1;
	while(q<=num-1)
		sum2=sum2+y(q,num);
		q=q+1;
    end
	
    soma=(sum1-sum2)/5.d0;
	
    end