← Complete problem index

PROJECT EULER · #0823

Factor Shuffle

Statement only · UnsolvedOriginal problem ↗

A list initially contains the numbers 2,3,,n.
At each round, every number in the list is divided by its smallest prime factor. Then the product of these smallest prime factors is added to the list as a new number. Finally, all numbers that become 1 are removed from the list.

For example, below are the first three rounds for n=5: [2,3,4,5](1)[2,60](2)[30,4](3)[15,2,4]. Let S(n,m) be the sum of all numbers in the list after m rounds.
For example, S(5,3)=15+2+4=21. Also S(10,100)=257.

Find S(104,1016). Give your answer modulo 1234567891.

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.