Category Archives: Mathematical

Find politeness of a number

Given an integer n. Find politeness of number n. Politeness of a number is defined as the number of ways it can be expressed as the sum of consecutive integers. Input: n = 15 Output: 3 Explanation: There are only three ways to express 15 as sum of consecutive integers i.e., 15 = 1 +… Read More »

Superperfect Number

Given an integer n. Check whether the number n is superperfect number or not. A superperfect number is a positive integer which satisfies σ2(n) = σ(σ(n)) = 2n, where σ is divisor summatory function. Input: n = 16 Output: yes Explanation: 16 is a superperfect number as σ(16) = 1 + 2 + 4 +… Read More »