C++ (Qt)#include <iostream>#include <fstream>#include <cmath> double func(int n) { double v = 1.0; for (int i = 0; i < n; ++i) { int l = 0; while (true) { l++; int s = (int)ceil(double(2*l+1)/double(n)+v)-1; if (l==s) break; } v += (2.0*l+1.0)/double(n); } return v;} int main(){ std::ofstream out("test.txt"); for (int i = 3; i < 50; ++i) { out << i << " " << func(i) << std::endl; } return 0;}