Pseudoperfect numbers P82891


Statement
 

pdf   zip

html

The proper divisors of a number n are all the positive divisors of n that are smaller than n. For instance, the proper divisors of 20 are 1, 2, 4, 5, and 10. In this problem, we will say that a number is pseudoperfect if it can be obtained by adding up some of (or all) its proper divisors. For instance, 20 is pseudoperfect, because 1 + 4 + 5 + 10 = 20.

Write a program that, for every given number n,

  • if n has more than 15 proper divisors, prints how many it has;
  • if n has 15 or less proper divisors, tells if n is pseudoperfect or not.

Input

Input consists of several strictly positive natural numbers.

Output

For every given n, print its number of proper divisors, if this is larger than 15. Otherwise, tell if n is pseudoperfect or not. Follow the format of the example.

Public test cases
  • Input

    1
    6
    10
    20
    210
    2310
    65536
    1000000000
    999999996
    999999937
    999999936
    

    Output

    1 : NOT pseudoperfect
    6 : pseudoperfect
    10 : NOT pseudoperfect
    20 : pseudoperfect
    210 : pseudoperfect
    2310 : 31 proper divisors
    65536 : 16 proper divisors
    1000000000 : 99 proper divisors
    999999996 : pseudoperfect
    999999937 : NOT pseudoperfect
    999999936 : 167 proper divisors
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++