Practical numbers P72581


Statement
 

pdf   zip

thehtml

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 106.

Output

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

Public test cases
  • Input

    1
    3
    12
    999998
    999999
    1000000
    

    Output

    yes
    no
    yes
    no
    no
    yes
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Official solutions
    C++
    User solutions
    C++