(* 4.381.4 *)

Integrate[Log[x]*Cos[n*x],{x,0,2*Pi},Assumptions->Element[n,Integers]&&n>0]//FullSimplify

f1[n_]:=NIntegrate[Log[x]*Cos[n*x],{x,0,2*Pi}];

f2[n_]:=N[-((SinIntegral[2 n π])/n)];

f[n_]:=f1[n]/f2[n];

f[RandomInteger[{0,500},20]]

(* Correct *)