← RoseCode

ROSECODE 342

Fraction decomposition

Philippe_57721 · Programming ·

There is a smallest n for which there exists a set of distinct integers S={s1,s2,,sn} such as
17670=(11s1)×(11s2)××(11sn)

Actually, for this least n the set S is unique.

You are given that S is composed of the union of no more than 4 subsets of consecutive integers.

Find S

Answer format: 'the smallest element'-'the largest element' comma separated for each subset.

For instance, if S={2,3,4,5,11,12,13}={2,3,4,5}{11,12,13}, the answer would be: 2-5,11-13

[My timing: 2 sec ]