← RoseCode

ROSECODE 523

重温最大素因数之和

Sum of largest prime factors revisited

liuguangxi · 数学 ·

令 f(n) 为 n 的最大质因数。例如 f(1)=0、f(6)=3 和 f(30)=5。

定义 S(k,n)=∑x1=1n∑x2=1n⋯∑xk=1nf(∏i=1kxi)。

给定 S(2,3) = f(1×1) + f(1×2) + f(1×3) + f(2×1) + f(2×2) + f(2×3) + f(3×1) + f(3×2) + f(3×3) = 21、S(3,10)=4790、S(6,10)=5697722。

找到S(9,109)mod109。
感谢 百黑客 为了这个想法。

这个问题的灵感来自 Project Euler 的 Problem 642 (https://projecteuler.net/problem=642)