Skip to content

Sunday Times Teaser 2945 – Infernal Indices

by Stephen Hogg

Published March 3 2019 (link)

The above is the size of the evil multitude in the last “Infernal indices” novel “A deficit of daemons”.

“Spoiler alert” — at the end, the forces of good engage in the fewest simultaneous battles that prevent this evil horde splitting, wholly, into equal-sized armies for that number of battles. The entire evil horde is split into one army per battle, all equally populated, bar one which has a deficit of daemons, leading to discord and a telling advantage for the forces of good.

How many battles were there?

One Comment Leave one →
  1. Brian Gladman permalink

    This is very easy in Python since the language has ‘unlimited’ length integers – good news since in this case the integer being considered has 36306 digits. However, a manual solution requires the progressive modular reduction of repeated powers (known as “power towers” if you are running to Google for inspiration) and it is interesting to use this idea to see how much we pay for the simplicity of large integer maths in Python. I have done this here by doing an initial modular reduction and comparing this with a simple use of Python’s ‘mod’ operation.

    On my Skylake system the comparison is 1.8 milliseconds for the plain ‘mod’ version and 23 microseconds with modular reduction.

Leave a Reply

Note: HTML is allowed. Your email address will not be published.

Subscribe to this comment feed via RSS