随笔分类 -  数论

摘要:说明:本文用 ϕ 表示欧拉函数而不用 φ,尽管后者更为常用。 欧拉函数 ϕ:Z>0Z 定义为 \[ \phi(n) = |\{ 阅读全文
posted @ 2021-08-18 18:07 Pat 阅读(1142) 评论(0) 推荐(0) 编辑
摘要:此题是 2018 年 ICPC Asia Beijing Regional Contest 的 C 题。 题目大意 求斜边长度不超过 nn109) 的勾股数的数量。不计两直角边的顺序,即勾股数 (a,b,c)(b,a,c) 视作同一组。 分析 这是一道颇 阅读全文
posted @ 2019-03-31 22:01 Pat 阅读(595) 评论(0) 推荐(0) 编辑
摘要:本文是一篇长文,尚未完成。 引子 一 算法竞赛中常见一类计数问题: 函数 g:Z_1Z_0 已知。函数 f:Z1Z0, $f(n) := 阅读全文
posted @ 2019-03-15 20:57 Pat 阅读(792) 评论(0) 推荐(0) 编辑
摘要:在集合 [n] 上使用容斥原理。 固定 i,考虑有多少个 j[n] 满足 gcd(i,j)=gcd(ai,aj)=1,将此数目记作 fi。暂时不考虑条件 ij 。 考虑 [n] 的某些子集。$S_{x,y} := \{ i\ 阅读全文
posted @ 2018-11-14 13:30 Pat 阅读(286) 评论(0) 推荐(0) 编辑
摘要:设在第 x 天二人都 lucky,则有 x=yata+Ra x=ybtb+Rb 约束条件: laRaralbRbrb 阅读全文
posted @ 2018-11-12 01:06 Pat 阅读(363) 评论(0) 推荐(0) 编辑
摘要:For non negative integers m and n and a prime p, the following congruence relation holds: $$\binom{m}{n} \equiv \prod_{i=0}^{k} \binom {m_i}{n_i 阅读全文
posted @ 2018-07-26 15:22 Pat 阅读(160) 评论(0) 推荐(0) 编辑
摘要:题目大意 n1n2000)个正整数 a1,a2,,anai5×107)分布在一个圆环上。 定义 bk 为:将环上的数划分成 k 段,每段上的数之和的 GCD 的最大值。 求 $b_1, b_2, \dots, 阅读全文
posted @ 2018-02-03 12:14 Pat 阅读(167) 评论(0) 推荐(0) 编辑
摘要:题目大意 给定 n1n1000)个正整数 a1,a2,,anai1012),令 s 为这 n 个数之和。求 $$ \frac{s! } {\prod\limits_{1\le i\le n} a_i !} \bmod 阅读全文
posted @ 2018-01-01 13:49 Pat 阅读(255) 评论(0) 推荐(0) 编辑
摘要:费马测试(Fermat test) Some of the cryptographic algorithms make use of big prime numbers. However, checking if a big number is prime is not so easy. Howev 阅读全文
posted @ 2016-11-24 12:58 Pat 阅读(293) 评论(0) 推荐(0) 编辑
摘要:Problem 求 [1N]中素因子数最多且最小的数 nN 充分大。 Solution 将任意自然数 n (n>2) 分解 $$ n = p_1^{k_1 } p_2^{k_2} p_3^{k_3} \dots P_m^{k_m} \quad (p_1<p_2< 阅读全文
posted @ 2016-11-22 12:02 Pat 阅读(387) 评论(0) 推荐(0) 编辑
摘要:"传送门" time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder has recently found an 阅读全文
posted @ 2016-09-11 14:48 Pat 阅读(272) 评论(0) 推荐(0) 编辑
摘要:分数的和取模 考虑两个分数 ab,cda,b,c,dZb,d0),正整数 mb,d 都互质。若正整数 xm 互质,用 x1 表示 x 在模 m 下的逆元。则有 $ab^{ 1} 阅读全文
posted @ 2016-09-08 16:40 Pat 阅读(318) 评论(0) 推荐(0) 编辑
摘要:传送门 GCD Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem DescriptionGive you a sequence of N(N100,000) int 阅读全文
posted @ 2016-08-05 21:19 Pat 阅读(188) 评论(0) 推荐(0) 编辑
摘要:问题 求 [L,R] 之间的素数表。 解法 一个合数 n 的最小素因子不超过 n。因此,在埃氏筛法的过程中,每当“新发现”一个素数 p,可以从 p2 筛起,而不必从 2p 筛起。 先用埃氏筛法求出 [1,R] 阅读全文
posted @ 2015-09-13 17:17 Pat 阅读(753) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示