## ACM essential template - Number Theory

number theory
Prime table
Number of prime numbers with length i
cnt [ 1 ] = 4
cnt [ 2 ] = 21
cnt [ 3 ] = 143
cnt [ 4 ] = 1061
cnt [ 5 ] = 8363
cnt [ 6 ] = 68906
cnt [ 7 ] = 586081
Prime table within 1000
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47
53 59 61 67 71 73 79 83 89 97 101 103 107 109 113
127 131 137 139 149 151 157 163 167 17 ...

Posted by **deeem** on *Wed, 01 Dec 2021 13:14:09 -0800*

## Active Thought Training 4 | CF Number Theory 2000+ | Last Five Questions

G: The LCMs Must be Large | CF 1166E
meaning of the title
The LCMs Must be Large | CF 1166E Given a
n
n
n given
m
m
m groups of data, each set of data is ...

Posted by **mikkex** on *Fri, 12 Nov 2021 12:20:26 -0800*

## 2021 Niuke winter vacation algorithm basic training camp 1D parallel search set inverse element combinatorial mathematics two-dimensional grid to one-dimensional precautions

subject
Problem solving ideas
Firstly, the idea of two-dimensional to one-dimensional is discussed. Convert each point to abscissa multiplied by N + ordinate. It seems that it can be realized, but this problem needs four points, so 3 and 4 are implicitly connected. So it will be Wa. When we first increase N by 1, each available XY will not ...

Posted by **Bloodwine** on *Wed, 10 Nov 2021 20:13:54 -0800*

## E. Height All the Same-Codeforces Round #630 (Div. 2)

E. Height All the Same
General idea of the topic
Given the grid of \ (n * m \), cubes can be placed on each grid. Initially, there are \ (a_{i,j} \) cubes on the grid with coordinates of \ ((i,j) \). Now there are two operations:
Select two adjacent squares and place a cube on top of each
Select a person's Square and place two cubes on it
It ...

Posted by **Adarmo** on *Mon, 01 Nov 2021 04:53:03 -0700*

## [NOI P simulation] large factorial (Stirling number)

meaning of the title
seek
16
16
In hexadecimal,
n
!
n!
n! Remove the tail
0
0
...

Posted by **asterinex** on *Sun, 31 Oct 2021 08:21:42 -0700*

## BSGS and extended BSGS

summary
It is mainly used to solve the an=b(mod p) problem and solve the minimum non negative integer n to satisfy the left formula. Ordinary BSGS can solve the case of a and P coprime, and extended BSGS can solve the case of non coprime
Common BSGS
Problem solving steps
1. Take m=ceil(sqrt ยง) (rounded up). If the solution exists, ...

Posted by **EZE** on *Sat, 25 Sep 2021 22:11:21 -0700*

## On Mobius function & Inclusion exclusion theorem (example: number coloring, complete square number)

Today, I spent a day grinding Mobius function and did two questions. I have a lost understanding of Mobius. If I want to take notes, I'll write this blog
First, let's introduce what is an integral function. When gcd(a,b)=1 and f(a,b)=f(a)*f(b), f(x) is an integral function. For any a and B, f(a,b)=f(a)*f(b), it is called a complete integral fu ...

Posted by **ardyandkari** on *Tue, 21 Sep 2021 01:33:37 -0700*

## PTA-L3-023-calculation diagram, and some of my thoughts on the calculation diagram

Portal
Define dp1[u] the function value of the function composed of all points reachable by u sign; dp2[u] represents the partial derivative value of the function composed of all points reachable by u to the variable represented by varIdx, where varIdx is enumerated one by one outside the dp2 solution process and input.
Because we build an in ...

Posted by **stefandv** on *Mon, 20 Sep 2021 08:40:16 -0700*