rec.puzzles Archive

3435 = 3^3 + 4^4 + 3^3 + 5^5: it equals the sum of its digits each raised to its own power (taking 0^0 = 0).

arithmetic/digits/own.powers New

New entry, edited from material collected for the archive and not yet in a released version.

Problem

3435 = 3^3 + 4^4 + 3^3 + 5^5: it equals the sum of its digits each
raised to its own power (taking 0^0 = 0).  What is the next number
after 3435 with this property?  And the next after that?
Show solution
Some time ago someone posted an article asking for the next number
after 3435 where the sum of the digits raised to the power of that
digit was the same as the number, where 0^0 = 0.

We can see that this is true for 3435 because 3^3 + 4^4 + 3^3 + 5^5 =
27 + 256 + 27 + 3125 = 3435.  It is also true for 0 and 1, but there
are no numbers between 1 and 3435 for which it holds.  The question,
then, was: what is the next number after 3435 for which this property
is true?

I wrote a very inefficient program in bc (the GNU bignum calculator)
and left it running on a Pentium 166 for over a week.  It consisted
of the following two functions:

define val(x) {
  auto r, v;
  while (x) {
    r = x%10;
    x /= 10;
    if (r) r = r^r;
    v += r;
  }
  return (v);
}

define search(x) {
  auto v;
  v = val(x);
  while (v != x) {
    v = val(++x);
  }
  return (v);
}

search(3436) eventually returned 438579088.

So now I pose the following question: what is the next number after
438,579,088 for which the property holds true?

-- David Conrad <conrad@grfn.org>

If such a number has d digits, then 9^9d >= 10^(d-1), and therefore d<=10,
so the problem is finite.  In fact, there are no more such numbers.
The complete set of such numbers is {0, 1, 3435, 438579088}.
If we use 0^0=1, the set is {1, 3435}.

You need only test all ways to choose no more than ten digits from
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, with repetitions allowed.  There
are only C(20,10)=184756 such choices, so this is easy.

-- David Moews <dmoews@xraysgi.ims.uconn.edu>