Practical numbers

A practical number is a natural n such that all smaller naturals can be
represented as sums of distinct divisors of n. For instance, 12 is a
practical number, because all numbers from 1 to 11 can be expressed as
sums of 1, 2, 3, 4, and 6: 5 = 2 + 3, 7 = 1 + 6, 8 = 2 + 6, 9 = 3 + 6,
10 = 1 + 3 + 6, and 11 = 2 + 3 + 6.

Given several naturals, are them practical numbers?

Input

Input consists of at most 50 naturals, all between 1 and 10⁶.

Output

For each given natural, print “yes” or “no” depending on whether it is a
practical number or not.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T11:42:44.543Z

© Jutge.org, 2006–2026.
https://jutge.org
