在C语言中,预订的数字是什么意思?
订婚数是两个数字的对,其除数之和等于另一个数字。
例如 (a, b) 是一对订婚数,如果 s(a) = b + 1 且 s(b) = a + 1,其中 s(b) 是 b 的等分和:等效条件是 σ(a) = σ(b) = a + b + 1,其中 σ 表示除数和函数。
前几对订婚号码为:(48, 75)、(140, 195)、(1050, 1925) )、(1575, 1648)、(2024, 2295)、(5775, 6128)。
所有已知的订婚号码对都具有相反的奇偶性。任何一对相同的奇偶校验数都必须超过 1010。
算法
Step 1: Find the sum of all divisors for both numbers. Step 2: Finally check if the sum of the divisors of number added by one is equal to the other number or not. Step 3: If yes, it is a Betrothed number and otherwise not.登录后复制
Input:a = 48 b = 75 Output: 48 and 75 are Betrothed numbers登录后复制