Sum[ Cos[ π (2 k+1)(i/(2 N))]Cos[π (2k+1)(j/(2 N))],{k,0,N-1}]

Sum[ ((Cos[ π (2 k+1)(i/(2 N))])^2),{k,0,N-1}]