
数论——欧拉函数
Alex_McAvoy
想要成为渔夫的猎手
展开
-
数论 —— 欧拉函数
【定义】对正整数 n,欧拉函数是小于等于 n 的数中与 n 互质的数的个数,记作:例如:,因为 1、3、5、7 均与 8 互质。【性质】1)若 n 为一素数 p,则:2)若 n 为一素数 p 的幂次,则:例如:要求,由于 16=2*2*2*2,故3)若 n 为任意两个互质的数 a、b 的积,则:例如:要求,由于 40=5*8,且 5、8 互质,所以4)...原创 2019-03-20 19:02:03 · 740 阅读 · 0 评论 -
小a与黄金街道
【题目描述】小a和小b来到了一条布满了黄金的街道上。它们想要带几块黄金回去,然而这里的城管担心他们拿走的太多,于是要求小a和小b通过做一个游戏来决定最后得到的黄金的数量。游戏规则是这样的:假设道路长度为n米(左端点为0,右端点为n),同时给出一个数k(下面会提到k的用法)设小a初始时的黄金数量为A,小b初始时的黄金数量为B小a从1出发走向n−1,小b从n−1出发走向1,两人的速度均为1...原创 2019-02-11 20:46:12 · 308 阅读 · 0 评论 -
Visible Lattice Points(POJ-3090)
Problem DescriptionA 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...原创 2018-08-01 20:50:18 · 326 阅读 · 0 评论 -
Farey Sequence(POJ-2478)
Problem DescriptionThe 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....原创 2018-08-10 10:43:38 · 514 阅读 · 0 评论 -
Relatives(POJ-2407)
Problem DescriptionGiven n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y >...原创 2018-08-10 10:19:46 · 346 阅读 · 0 评论