← RoseCode

ROSECODE 405

Carmichael chains

Philippe_57721 · Programming ·

A Carmichael number is a chain if when we remove repeatedly its largest factor, we still obtain a Carmicheal number.

174470590282430768272287350512321 is a Carmichael chain of length 10 (it has 10 factors).

174470590282430768272287350512321=7.13.31.61.181.541.2161.187921.3570481.7140961
24432368456070656074481761=7.13.31.61.181.541.2161.187921.3570481
6842878720281848881=7.13.31.61.181.541.2161.187921
36413592521761=7.13.31.61.181.541.2161
16850343601=7.13.31.61.181.541
31146661=7.13.31.61.181
172081=7.13.31.61
2821=7.13.31
All these numbers are Carmichael numbers.

Of course, we stop at 3 factors, as a Carmichael number can't have less than 3 factors.

Find the next Carmichael chain of length 10. We assume that no factor is greater than 107.

[My timing: 60 sec]