/* -*- 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; const int as[21] = { 0, 0, 999874, 355065, 153009, 70685, 33758, 16414, 8065, 3988, 1979, 985, 491, 245, 122, 61, 30, 15, 7, 3, 1 }; /* 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; } void calc() { for (int x = 2; x <= 30; x++) { double sum = 0.0; for (int i = N + x; i >= x; i--) sum += zeta(i) - 1.0; printf("%d %d\n", x, (int)(sum * 1000000)); } } /* subroutines */ /* main */ int main() { //calc(); return 0; int x; scanf("%d", &x); printf("%d\n", (x <= 20) ? as[x] : 0); return 0; }