A natural number is called powerful if, for each prime divisor of , is also divisor of . For example, is a powerful number, because every prime factor appears, at least, twice.
Your task is to write a program that reads a sequence of numbers and, for each one, prints all the powerful numbers between 1 and .
The input is a sequence of natural numbers .
For each of the input, print a line with all the powerful numbers between 1 and , separated by commas and in increasing order.
Your program must implement and use the function
bool is_powerful(int n);
that, given an integer strictly positive |n|, indicates if is powerful or is not
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T11:26:34.278Z
© Jutge.org, 2006–2026.
https://jutge.org