永夜初晗凝碧天

本博客现已全部转移到新地址,欲获取更多精彩文章,请访问http://acshiryu.github.io/

导航

2011年8月7日 #

poj3090 欧拉函数与法雷级数

摘要: A lattice point (x, y) in the first quadrant (x and y are integers greater than or equal to 0), other than the origin, is visible from the origin if the line from (0, 0) to (x, y) does not pass through any other lattice point. For example, the point (4, 2) is not visible since the line from the origin passes through (2, 1). The figure below shows the points (x, y) with 0 ≤ x, y ≤ 5 with lines from the origin to the visible points. 阅读全文

posted @ 2011-08-07 11:35 ACShiryu 阅读(808) 评论(0) 推荐(0) 编辑

poj2478 又一欧拉公式的运用

摘要: The Farey Sequence Fn for any integer n with n = 2 is the set of irreducible rational numbers a/b with 0 a b = n and gcd(a,b) = 1 arranged in increasing order. The first few are F2 = {1/2} F3 = {1/3, 1/2, 2/3} F4 = {1/4, 1/3, 1/2, 2/3, 3/4} F5 = {1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5} You task is to calculate the number of terms in the Farey sequence Fn. 阅读全文

posted @ 2011-08-07 11:17 ACShiryu 阅读(1733) 评论(0) 推荐(0) 编辑

POJ 2773 互素问题

摘要: Two positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instance, 1, 3, 5, 7, 9...are all relatively prime to 2006. Now your job is easy: for the given integer m, find the K-th element which is relatively prime to m when these elements are sorted in ascending order. 阅读全文

posted @ 2011-08-07 11:04 ACShiryu 阅读(1694) 评论(0) 推荐(1) 编辑