Weird Sum
Recently, Chef Alex invented a weird function F. Give an integer n (n ≥ 2), consider the prime factorization n = p1k1 · p2k2 · … · prkr. Let g = gcd(k1, k2, … kr) and mi = ki / g. The function F is defined as: F(n) = p1m1 · p2m2 · … · prmr. Now, Alex is interested in summing up the value of this function for the first N natural numbers (other than 1, since its prime factorization is undefined
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start