Given an integer n, find out number of ways to represent it as the sum of two or more integers ai with the next property: ratio ai / ai - 1 is the same positive integer for all possible i > 1.
原题:这里
题目大意:
给定n,找到合法序列的个数。给定规则如下:
1.,
2.
即等比数列。
等比数列求和公式:(b为起始项,q为等比)。
思路:
首先计算q=1时个数,q=1时即计算n因子个数,且,
其次计算的情况,for循环枚举;但是发现枚举起始项时复杂度太高,
所以枚举项数x。等比公式变形为,对x进行枚举。