Ken's POTW


Productive Numbers, and a Series
Some smaller puzzles this time:
  1. Find all numbers i, such that i is equal to the sum of the squares of its digits.
  2. Find all numbers n, such that n is equal to the product of its first three and last three digits (taken as 3-digit numbers). Assume the first digit of n is not zero. Ignore leading zeros in the second 3-digit number if necessary.
  3. The following series eventually repeats. Where?
    1, 11, 21, 1112, 3112, ...

Source: Original and previous puzzle experience.


Solutions:

1. PaulWogJ@aol.com and Ken Burres sent the solution that only the numbers 0 and 1 meet the requirements. Ken Burres checked this with a program. PaulWogJ gives this rationale:

First I found that all solutions had to be three digits or less. Assume that the solution has 4 digits. Even if all the digits were nine, the sum of the squares would only be 4 * 81, which isn't four digits. I also found that if a solution had three digits it had to start with a 1. If you use all nines the sum of the squares is 243, The max you could get with 3 digits, so it has to start with a two or a one. If you use a 2 and two nines, the sum of the squares is 163, the max you can get when you have a two as the first digit. So all solutions must have 1 2 or 3 digits, and all 3 digit solutions would start with a 1.

[KD: I stated the problem inacurrately and I believe this is the correct solution as I stated it. I have restated it in a later puzzle: Productive Numbers Revisited .]

2. Bill Chapp solved this problem and sent the following:
    There are 99 solutions!  9 solutions x010, where x is a single
    digit 1 through 9, and 90 solutions xy100, where xy is a two digit
    number 10 through 99.

    All solutions must be between 3 and 6 digits inclusive , since the
    problem requires "the first three digits and the last three digits"
    and the largest product of three digit numbers is 999*999 = 998001.

    Therefore, I used the following awk program to find the solutions:

      BEGIN {
        for(num=100;num<999999;num++) {
          first=substr(num,1,3);
          last=substr(num,length(num)-2,3);
          if (num==first*last) print num,first,last;
        }
      }
I [Ken] think these solutions can also be found through logic:
3. Arie Zilberstein solved this, showing the rest of the series as well:
Each number describes the number of digits in the previous number.
1        <-- We have to begin somewhere
11       <-- '1' appears 1 time
21       <-- '1' appears 2 times
1112     <-- '1' appears once, '2' appears once
3112     <-- '1' appears 3 times, '2' appears 1 time
211213   <-- '1' appears 2 times, '2' appears 1 time, '3' appears 1 time

Continuing with a more readable format:
21 12 13
31 22 13
21 22 23
11 42 13
31 12 13 14
41 12 23 14
31 22 13 24
21 32 23 14
21 32 23 14

That's it, 21322314 !

Mail to Ken