← CodeNation questions

Prime factors with powers using a custom oracle function

Filed under CodeNation

The question

Given a function f(n) that returns n if n is 1 or prime, or any proper divisor otherwise, write a function to find all prime factors of n and their powers.

No write-up yet. Related questions below have one.

Related CodeNation questions

Collected from public candidate posts and coding forums. Updated Nov 2026.