Files
python/TangDou/Topic/Mobius/mobius_Prepare.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

21 lines
576 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <bits/stdc++.h>
using namespace std;
int main() {
// 讨论F(i)与f(i)的所有因子之间的关联关系
int n = 100;
for (int i = 1; i <= n; i++) {
printf("F(%d)=", i);
bool f = 1;
for (int j = 1; j <= n; j++) {
if (i % j == 0) { // 如果j是i的因子的话,输出f(j)
if (f) {
printf("f(%d)", j);
f = 0;
} else
printf("+f(%d)", j);
}
}
printf("\n");
}
return 0;
}