About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
March 2024 - Solution
March 2024 Solution:
The solution for is 115192665.
The solution for is 117778830159.
The case is difficult to obtain, usually requiring low-level optimizations. Here is one approach for example, as
described by Asaf Zimmerman:
I implemented a straightforward check, using a sieve for primality check.
To be able to run the 2024 case (i.e. to hundreds of billions) I used the following optimizations: 1) the sieve excluded numbers divisible by 2,3 or 5 (so only 8 remainders modulo 30) which means it needed 8/30 bits for each number covered. 2) the a0 candidates were batched in jumps of 30 so that they (and consecutive ai) shared a remainder modulo 30 and some checks could be skipped altogether for the entire batch when they all divisible by 2, 3 or 5. this made the checks compatible with the sieve structure 3) vectorization and caching using the bit structure of the sieve to check 32 numbers in a single operation.
This was enough to reduce the run time to around 1hr using python+numpy covering numbers to 300,000,000,000