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.
December 2024 - Solution
December 2024 Solution:
The solution for 1/2 is [1062880, 2125762, 3188644, 4251526, 5314408, 6377290, 17006110, 18068992, 19131874].
The solution for 3/4 is 10167463313312
A simple formula giving the solutions is where
; this gives the correct values for
(and for
gives values which result in
but are not maximal). Other (non-maximal) values resulting in 1/2 also corresponds to this formula for other values of
.
To solve the problems efficiently, it is useful to have
1. An efficient algorithm for computing
.
2. An upper bound on the value of
for which
is possible.
For a simple recursive algorithm for , first note that any
can be written as
where
, i.e. we split
by taking its most significant digit
and the rest of the number
.
For example, if then
so in this case,
and
.
Now note that we have the relation
Using this relation, computing is immediate even for very large values of
.
For an upper bound, first note that computing is very easy: The total number of
-length strings of digits is
, and the number of such strings not containing
is
, so up to and not including
we have
such strings. If
we also count
itself, so all in all
with
being the usual Kronecker's delta.
This upper bound shows that as tends to infinity, the proportion
tends to 1. Combined with a quick way to compute
for specific numbers and using smart search methods (even binary search is efficient here, given a better understanding of the behaviour of
) this solves both the standard problem and the bonus.
We do not know of an analytical way to solve the problem. Some of you suggested beautiful approaches based in one way or another on the formula described above which generalizes to
when we want to find the proportion
; e.g. for
choosing
we obtain the formula
which correctly yields 10167463313312 for
However, as the counterexamples for the formula for
and
show, it does not always work.