"Algorithm" Dirichlet convolution & the inverse of the UFA

Source: Internet
Author: User
Tags gcd greatest common divisor

Although the title is Dirichlet convolution & the inverse of the Möbius, this article should be said to weigh in on some of the feelings of the inversion + linear sieve.

Thank you for a few papers & blogs and a big-guy remoon_ofnbefore the text starts.

1.2016 national training Team papers Ningzhi "several methods of summation of integrable function"

2. The relevant POPOQQQ (%%%).

3. Of course there are many more ...

In fact, two or three months ago I have been in touch with the inversion, but at that time on the inversion is completely a state of being ignorant. In fact, the focus is to understand and accept convolution by self-propelled formulas and by multiple formulas. Of course, the wealth of number theory is also essential (sometimes some of the topics will be used in some bizarre nature). In summary, inversion is a very magical algorithm:

The content is: if we have \ (f = 1 * g\)

Then there \ (g = \mu * f\)

This is a variant of the equation, and when \ (f\) or \ (g\) is present in the original equation, consider replacing it with another function to find an easy-to-obtain formula. There are several common convolution relationships:

\ (\MU * 1 = \epsilon \)

\ (\phi * 1 = id\)

\ (id * \mu = \phi\)

(The functions in these equations are all integrable functions). Note: Convolution of the integrable function is still an integrable function, and convolution satisfies the binding law, commutative law, and distributive law.

First, we have a simple topic to feel the convolution and inversion of the role played: the surface in this: HAOI2011

Notice that \ (i, j\) has a certain range, but such a range can obviously be solved by the repulsion. So the question turns into: How to quickly find out

\ (\sum_{i = 1}^{n}\sum_{j = 1}^{m}gcd\left (i, j \right) = K\)

Found if \ (i,j\) greatest common divisor is \ (k\), then \ (Gcd\left (\frac{i}{k}, \frac{j}{k} \right) = 1\).

So we instead enumerate \ (\frac{i}{k}, \frac{j}{k}\):

\ (\sum_{i = 1}^{\frac{n}{k}}\sum_{j = 1}^{\frac{m}{k}}gcd\left (i, j \right) = 1\)

Notice that the final is a discriminant, so it is a primitive function \ (\epsilon \)

Lenovo to \ (\MU * 1 = \epsilon \)

We convert the formula to \ (\sum_{i = 1}^{\frac{n}{k}}\sum_{j = 1}^{\frac{m}{k}}\sum_{d|gcd\left (i,j \right)}\mu \left (d \right) \)

And because one of these \ (d\) contributes to each of the two-tuple \ (\left (i,j \right) \) that is its multiple

So there \ (\sum_{d = 1}^{n}\mu \left (d \right) \left \lfloor \frac{n}{dk} \right \rfloor\left \lfloor \frac{m}{dk} \right \RFL oor\)

At this point we do the number theory, prefix and optimization of the solution is OK.

Here are a few questions, according to the difficulty of the individual as a general ranking of the order, should be written in succession:

1.haoi2011 Problem B

2.YY of GCD

3.sdoi2015 about a few numbers and

4.Crash's digital form/Jzptab

5.bzoj3309 Dyz loves Math

6. Simple math problem (Duchi sieve)

7.sdoi2014 tables

Then there are a few questions that are not done, but feel very god:

1.bzoj4174 TTY for help

2. Cancer in the tree \ bzoj3512 dzy Loves Math IV

3.bzoj3601 A person's number theory

I wish you all good food ...

"Algorithm" Dirichlet convolution & the inverse of the UFA

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.