整数p> 1が与えられた場合、qの素因数分解の指数のリストが素因数の順序や値に関係なくpの指数と同じになるように、最小整数q> pを見つけます。
例
p = 20の素因数分解は2 2 x 5 1です。素因数分解で同じ指数を持つpより大きい最小整数はq = 28 = 2 2 x 7 1です。
p = 2500の素因数分解は2 2 x 5 4です。素因数分解で同じ指数を持つpより大きい最小整数は、q = 2704 = 2 4 x 13 2です。
ルール
- 入力は1より大きい整数であることが保証されています。
- これはcode-golfであるため、バイト単位の最短回答が優先されます。
テストケース
Input | Output
------+-------
2 | 3
20 | 28
103 | 107
256 | 6561
768 | 1280
2500 | 2704
4494 | 4510
46552 | 46584
75600 | 105840
2
参考までに、これはOEISのA081761です。
—
ジョナサンフレッチ