HDU 5608 function(杜教筛)

Posted jpphy0

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HDU 5608 function(杜教筛)相关的知识,希望对你有一定的参考价值。

0 链接

1 描述

  • 已 知 N 2 − 3 N + 2 = ∑ d ∣ N f ( d ) , 求 ∑ i = 1 n f ( i ) . 已知 N^2-3N+2 = \\sum_{d|N}f(d), 求\\sum_{i=1}^{n}f(i). N23N+2=dNf(d)i=1nf(i).

2 分析

2.1杜教筛

  • 2.1.1 莫比乌斯反演

N 2 − 3 N + 2 = ∑ d ∣ N f ( d ) , 根 据 莫 比 乌 斯 反 演 得 : N^2-3N+2 = \\sum_{d|N}f(d),根据莫比乌斯反演得: N23N+2=dNf(d)
f ( n ) = ∑ d ∣ n ( d − 2 ) ⋅ ( d − 1 ) ⋅ μ ( n d ) f(n)=\\sum_{d|n}(d-2)\\cdot (d-1)\\cdot \\mu(\\frac{n}{d}) f(n)=dn(d2)(d1)μ(dn)

  • 2.1.2 迪立克利卷积 g ∗ f g*f gf

( g ∗ f ) ( n ) = ∑ d ∣ n g ( d ) ⋅ f ( n d ) = ∑ d ∣ n g ( n d ) ⋅ f ( d ) (g*f)(n) = \\sum_{d|n}g(d)\\cdot f(\\frac{n}{d}) = \\sum_{d|n}g(\\frac{n}{d})\\cdot f(d) (gf)(n)=dng(d)f(dn)=dng(dn)f(d)

  • 2.1.3 杜教筛

∑ i = 1 n ( g ∗ f ) ( i ) = ∑ i = 1 n ∑ d ∣ i g ( d ) ⋅ f ( i d ) \\sum_{i=1}^{n}(g*f)(i)= \\sum_{i=1}^{n}\\sum_{d|i}g(d)\\cdot f(\\frac{i}{d}) i=1n(gf)(i)=i=1ndig(d)f(di)
= ∑ d = 1 n ( g ( d ) ⋅ ∑ i d = 1 ⌊ n d ⌋ f ( i d ) ) = ∑ d = 1 n g ( d ) ⋅ S ( ⌊ n d ⌋ ) =\\sum_{d=1}^{n}\\left(g(d)\\cdot \\sum_{\\frac{i}{d}=1}^{\\lfloor\\frac{n}{d}\\rfloor}f(\\frac{i}{d})\\right)=\\sum_{d=1}^{n}g(d)\\cdot S(\\lfloor\\frac{n}{d}\\rfloor) =d=1ng(d)di=1dnf(di)=d=1ng(d)S(dn)
= g ( 1 ) ⋅ S ( n ) + ∑ d = 2 n g ( d ) ⋅ S ( ⌊ n d ⌋ ) , 式 中 S ( k ) = ∑ i = 1 k f ( i ) =g(1)\\cdot S(n)+\\sum_{d=2}^{n}g(d)\\cdot S(\\lfloor\\frac{n}{d} \\rfloor),式中S(k)=\\sum_{i=1}^{k}f(i) =g(1)S(n)+d=2ng(d)S(dn)S(k)=i=1kf(i)
∴ g ( 1 ) ⋅ S ( n ) = ∑ i = 1 n ( g ∗ f ) ( i ) − ∑ d = 2 n g ( d ) ⋅ S ( ⌊ n d ⌋ ) \\therefore \\quad g(1)\\cdot S(n)=\\sum_{i=1}^{n}(g*f)(i)-\\sum_{d=2}^{n}g(d)\\cdot S(\\lfloor\\frac{n}{d} \\rfloor) g(1)S(n)=i=1n(gf)(i)d=2ng(d)S(dn)

2.2 数学模型

  • 2.2.1 已知条件

∑ d ∣ N f ( d ) ⋅ 1 = ( f ∗ I ) ( n ) = ( I ∗ f ) ( n ) = ∑ d ∣ N 1 ⋅ f ( n d ) , 式 中 I ( n ) = 1 \\sum_{d|N}f(d)\\cdot 1 = (f*I)(n)=(I*f)(n)=\\sum_{d|N}1\\cdot f(\\frac{n}{d}) ,式中I(n)=1 dNf(d)1=(fI)(n)=(If)(n)=dN1f(HDU-5608(杜教筛)

HDU-5608(杜教筛)

●HDU 5608 function

HDU 5608 function

hdu6607 min25筛+杜教筛+伯努利数求k次方前缀和

HDU6706 CCPC 2019网络赛 huntian oy 推式子+杜教筛