随笔分类 -  数论

【数论】(欧拉函数)GCD HDU2588
摘要:描述 The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b),is the largest divisor common to a and b,For example, 阅读全文
posted @ 2019-10-26 16:20 qmzhna 阅读(137) 评论(0) 推荐(0)
【数论】-素数问题整理
摘要:1.素数定理: π(x)~x/ln(x) 其中π(x)是不超过x的范围中素数的个数,当x非常大时,π(x)与x/ln(x)比较接近。 2.埃拉托色尼筛法 应用:可以快速找到[2, n]内所有的素数。操作步骤如下: (1)输出最小的素数2,然后筛掉2的倍数 (2)输出最小的素数3,然后筛掉3的倍数 ( 阅读全文
posted @ 2019-09-19 20:24 qmzhna 阅读(729) 评论(0) 推荐(0)
辗转相除法--求最大
摘要:基本操作:设a<b,a÷b=q...r1 若r1=0,则最大公约数为r1 若r1!=0,则b÷r1=q...r2 r1÷r2=q...r3 直到rn为0为止 示例:280 380 280÷380=0...280 380÷280=1...100 280÷100=2...80 100÷80=1...20 阅读全文
posted @ 2018-12-04 19:18 qmzhna 阅读(120) 评论(0) 推荐(0)