Accolades for j---I didn't solve this the easy way.

With quite a few other j solutions already posted:

I arrived at a formula empirically.  By enumerating solutions from 1 to
10 digits long in base 3, 4, and 6 I discovered I needed polynomials of
order of the base to satisfy the problem for any number of digits in
that base.  My computer system rapidly enumerated the solutions for up
to 7 digits in base 10.  I then needed to find counts for 8 and 10 digit
numbers base 10 since the 1e9 count was given.

J works easily with arbitrary bases, used to find the pattern.  J can
solve matrix division with rational arithmetic, used to find the
polynomial.

There wasn't much code nor computer time but boy did I struggle.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to