var n = 2;
var k = 5;
var result = 1.00;
for (var i = 2; i <= k; i++)
result += 1.00 / (i * n);
Console.WriteLine(result);
var n = 2;
var k = 5;
var result = Enumerable.Range(2, k - 1)
.Select(x => 1.00 / (x * n))
.Aggregate(1.0, (l, r) => l + r);
Console.WriteLine(result);