/* -*- coding: utf-8 -*- * * 1273.cc: No.1273 はじめのζ関数 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int N = 8000; /* typedef */ typedef long long ll; /* global variables */ double zeta(int n) { double sum = 0.0; for (int i = N; i >= 1; i--) sum += pow(1.0 / i, n); return sum; } /* subroutines */ /* main */ int main() { int x; scanf("%d", &x); double sum = 0.0; for (int i = N; i >= x; i--) sum += zeta(i) - 1.0; printf("%d\n", (int)(sum * 1000000)); return 0; }