{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"The Farey Sequence Fn for any integer n with n \u0026gt;\u003d 2 is the set of irreducible rational numbers a/b with 0 \u0026lt; a \u0026lt; b \u0026lt;\u003d n and gcd(a,b) \u003d 1 arranged in increasing order. The first few are \r\u003cbr\u003eF2 \u003d {1/2}\r\u003cbr\u003eF3 \u003d {1/3, 1/2, 2/3}\r\u003cbr\u003eF4 \u003d {1/4, 1/3, 1/2, 2/3, 3/4}\r\u003cbr\u003eF5 \u003d {1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5}\r\u003cbr\u003e\r\u003cbr\u003eYou task is to calculate the number of terms in the Farey sequence Fn."}},{"title":"Input","value":{"format":"HTML","content":"There are several test cases. Each test case has only one line, which contains a positive integer n (2 \u0026lt;\u003d n \u0026lt;\u003d 10\u003csup\u003e6\u003c/sup\u003e). There are no blank lines between cases. A line with a single 0 terminates the input."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, you should output one line, which contains N(n) ---- the number of terms in the Farey sequence Fn.\r\u003cbr\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n3\r\n4\r\n5\r\n0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n3\r\n5\r\n9\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}