BYE-LAWS of the H.PIPER STEAM-ENGINE RAILROAD (H.P.S-E.R.R.)
1. Every train on the H.P.S-E.R.R. must comprise only consecutively serial-numbered wagons.
2. Once chosen, such wagons must be assembled in ascending order of the quantity, size and (if necessary) power of the distinct prime factors of the wagons’ serial-numbers; e.g car 41 before car 1681(41,41) before car 39(3,13 )before car 30(2,3,5).
3. The lowest serial-numbered wagon must be in caboose* position.
If the serial-number of the first wagon in today's train is a perfect cube, what is the maximum length of the train?
(Small hint: wagon No. 194481 is the most recent addition to the rolling stock of the H.P.S-E.R.R.)
There is also a bonus, for the ingenious reader.
* a 'caboose' is the last wagon at the back end of the train.
(In reply to extra credit
Thank you for point out my misinterpretation of the problem,
although this does not affect the position of the caboose, it could have possibly invalidated my answer so I reran the search with the corrected ordering function and luckily came up with the same solution. The corrected ordering is shown below. However, it did affect my extra credit answer, as when I reran that search it gave the longest train as 4591 from 162690 to 167280.
Edited on October 2, 2010, 9:16 pm
Posted by Daniel
on 2010-10-02 21:07:19