Teaser 3072

by Danny Roth

Published Sunday August 08 2021

Dial M for Marriage (link)

George and Martha work in a town where phone numbers have seven digits. “That’s rare!” commented George. “If you look at your work number and mine, both exhibit only four digits of the possible ten (0-9 inclusive), each appearing at least once. Furthermore, the number of possible phone numbers with that property has just four single-digit prime number factors (each raised to a power where necessary) and those four numbers are the ones in our phone numbers.”

“And that is not all!” added Martha. “Both numbers have their highest digits first, working their way down to the lowest, and both give perfect numbers [1] when their digits are summed.”

What are the two phone numbers?

[1] a perfect number equals the sum of its factors, eg, 6 = 1 + 2 + 3

28 Replies to “Teaser 3072”

  1. Oh, too easy, Danny.
    The line about “four single-digit prime number factors” is not needed for the solution.

    1. Hi Truner,

      I think the line you mentioned can not be omitted.

      Without it one could have a pair of different numbers such as 7744330 and 7774300.
      Their sum of digits is a perfect number as required. Digit zero is permitted due to “0-9 inclusive”.

      1. Peter, if I have grasped the problem correctly, I think the digits are PRIME and included in BOTH (not EACH) phone number. I have easily found two compliant phone numbers (there aren’t that many relevant Perfect Numbers). For me, a more difficult task would be to calculate the “number of possible phone numbers” (permutations and combinations is my nemesis).

  2. As I read it, each of the single-dugit primes has to be in each phone no. once at least, and only one perfect number fits both sums.

    1. Hi Truner,

      yes, the text of the teaser postulates the use of prime digits. They appear in the prime number factorisation of the three numbers of possible of phone numbers for the options (aaaa, b, c, d), (aaa, bb, c, d) and (aa, bb, cc, d).

      What I meant with my remark is: if you omit the line “Furthermore, the number of possible phone numbers….” then a,b,c,d may be four out of 0,1..9. So one could have (0,3,4,7) as given in my example, apart from prime digits (2,3,5,7), thus allowing more than one solution.

      1. What I meant was there’s no need to work out “the number of possible phone numbers with that property” because there are only four single-digit primes, so we need the sum of those, plus the sum of three of them to make the only possible perfect number, and there are only two ways to do that.

        1. Thanks Turner,

          now I understand that you did not think the line “four single-digit prime numbers,,,” is superfluous, but rather only that the working out the number N of possible phone numbers is not required.

          N = 7! / (na! x nb! x nc! x nd!), with na+nb+nc+nd = 7, na = frequency of digit a etc, as you surely know.
          .

  3. I don’t follow Peter’s last comment – it seems to offer three different values for N (210, 420 and 630) and all much too small. For fun, I tried to find the value for N (which is not needed, as already pointed out) and found N is a product of 2^9, 3^5, 5^2 and 7^2. This may be wrong but confirmation or otherwise welcome!

    1. Hi xgha,

      consider, as a simple example, a 4-digit number using only 2 different digits, say 1 and 2.

      When 1 and 2 occur twice one can have 6 ways: 1122, 1212, 1221, 2112, 2121, 2211. 6 = 4! / (2! x 2!).

      When 1 occurs once and 2 occurs trice one can have 4 ways: 1222, 2122, 2212, 2221. 4 = 4! / (1! x 3!).

      Please note that, at this stage, the digits are not ordered according to magnitude.

      I used the general expression for the arrangements of n elements using m different elements. When m < n then some of the m elements occur more than once.

      I hope this clarifies my previous comment.

    2. Hi Ciaran,

      With seven decimal digits there cannot be more than 10^7 different arrangements but your value (152,409,600) is more than 15 times larger so I don’t think it can be right.

      I have to admit that I am pretty hopeless at these combinatorial calculations so I have resorted to counting them by programming and this gave the number as 1,764,000 permutations (2^5 x 3^2 x 5^3 x 7^2).

      If we know the digits are 2, 3, 5, and 7 there are then 420 different values (2^2 x 3 x 5 x 7).

  4. Agree the answer to the teaser is easy to reach. The number of 7 digit phone numbers with only 4 different digits, that we don’t need, is trickier. I got 2^5×3^3×5^2×7^2

    1. I still we don’t need to do all that.
      Only four s-d primes 7, 5, 3, 2, which can sum to (max) 7+5+3+2+2+2+2 and (min) 7+5+3+2+2+2+2, so 23 to 38, and the only perfect no. in the range is 28.
      7+5+3+2+5+3+3 or 7+5+3+2+7+2+2.
      7553332, 7753222

  5. Hi Nicky and Brian,

    I am surprised about your large number of 7-digit numbers using 4 different digits. I found only 8400. How?

    There are 3 types
    aaaa b c d –> 210 arrangements
    aaa bb c d –> 420 arrangements
    aa bb cc d –> 630 arrangements

    4 given digits can be distributed among a,b,c,d in different ways.

    Type 1 allows 4 ways for digit a (the distribution among b,c,d is irrelevant) –> N1 = 4 x 210 = 840 possible numbers.
    Type 2 allows 4 ways for digit a and 3 ways for digits bb –> N2 = 4 x 3 x 420 = 5040 possible numbers.
    Type 3 allows 4 ways for digit d (the distribution among aa, bb, cc is irrelevant) –> N3 = 4 x 630 = 2520 possible numbers.

    So N1 + N2 + N3 = 8400 possible numbers using a given set of 4 digits, for example 2, 3, 5, 7.

    Did you include all other options for digits, (0,1,2,3)….(6,7,8,9) ? Leading zero allowed or not ?

    Is the basis of your calculations different from mine?

    1. Hi Peter,

      I now think your number is correct because George knows which four digits are involved.

      My number is wrong because I counted the permutations for ANY four digits so I would have to multiply your number by 210 [i.e. 10! / (6! x 4!)] to get my number, which does indeed give the 1,764,000 value that I quoted.

      EDIT: I have had second thoughts about this and now think that the property being referred to in the sentence “… the number of possible phone numbers with that property …” is the property of using “only four digits of the possible ten (0-9 inclusive)”. And this now leads me to believe that the 1,764,000 value is the correct one. Otherwise it would surely have said “using only our four digits” or something similar.

      What is surprising is that (a) either answer results in (2, 3, 5, 7) and (b) it doesn’t matter anyway!

      And this makes me wonder if “single-digit” was not intended to be there and got edited in at some point to make a more challenging teaser a lot easier (too easy for many here!).

      Here is my solution

      1. If “single-digit” is removed we can still deduce immediately that the two phone numbers are formed from (2,3,5,7).

          1. If any of the “four prime number factors” had more than one digit it would not be possible that “those four numbers are the ones in our phone numbers”.

            1. You are right that my attempt to explain the teaser’s wording by leaving out “single-digit” doesn’t work The word “prime” would have to go as well and if this is omitted, it is hard to make sense of what is left.

              Maybe the wording is no more than an attempt to make an easy teaser appear harder than it really is by adding in superfluous information.

              But the information added is interesting in that it does produce (2, 3, 5 and 7) and it seems to me a pity that it is not (or cannot be) worded in a way that makes the solution of this element of the teaser necessary in solving the teaser itself.

              EDIT: Maybe this teaser is an effort to produce a puzzle with a shortcut, such as, for example, the well known train and fly puzzle in which there is a hard and an easy way to reach the solution.

              If so it worked, at least in the sense that quite a few of us did work through both paths to the solution.

              1. 3210000 meets all conditions apart from the last 11 words of George’s statement.

                I was posed the fly/train puzzle in a university interview. I said that I knew the shortcut and the interviewer told me the von Neumann story given in your link.

    2. I’m along the same lines as you but using any 4 digits in any order. But I strongly suspect I have some serious double counting going on. I may look at it again later but unfortunately have some much less interesting chores to do at present.

    3. Hi Peter, I didn’t find double counting but I found my mistake. I was with you as far as the 3 types and the 210, 420, 630 arrangements were concerned. But then I just multiplied all these by 4, I was wrong there because you pointed out the subtelty that type 2 needs to be multiplied by 12. The reason my number was big was because I then multipled by 210 for choosing any 4 digits from 10. Thanks for your working.

  6. Thanks Brian – I clearly made basic mistake by not checking my analysis gave N < 10^7 . Have gone through it again and spotted some double-counting and some under-counting. I now agree with your value.
    My analysis defines W as the number of ways to select 4 different digits with values O-9 with any order (ie 1234 = 3214 = 4231 etc are equivalent and counted once). This gives W = 210 = 2.3.5.7
    To make a 7-digit number from any of these sets of four, say (abcd), we can arrange them to contain 4, 3 or 2 multiples of any value. For digit a, we have (4a,b,c,d) with 1 X 210 combinations and only 1 variant, (3a,2b,c,d) with 2 X 210 combos and 3 variants and (a,2b,2c,2d) with 3 x 210 combos and a single variant. In total, based on digit a, this gives (1 x 1 + 2 x 3 + 3 x 1) x 210 combinations. Replacing a with each of the other three digits in the set introduces a factor of 4 so that the total number of combinations for any set of 4 digits is C = 4 x 10 x 210 =2^4 x 3 x 5^2 x 7^2. Multiplying C x W gives the total number of possible phone numbers as N = 2^5 x 3^2 x 5^3 x 7^2 = 1,764,000

  7. NB The multiples of any value in a 7-digit 4,3,2 should read 4,3,1. Using shorthand Q, T, D and S for quartets, triplets doubles and singles of any digit we have 7-digit numbers of form QSSS with one option, TDSS with three options and SDDD with one option.

  8. APART FROM the last 11 words of George’s statement, 3210000 meets all the conditions. So do other numbers with (0,1,2,3) prime digits and digit sum 28.

  9. I agree with you guys who think that finding the total possible phone numbers would have
    been the better challenge. Here are two approaches. I leave figuring the logic to you.

    ( 4^^7 – 4×1806 – 6×126 – 4×1) x 10C4 = 8400 x 210 = 1 764 000

    or, 7!( 4C1/4! + 4C2 x 2 / 2!3! + 4C3 /2!2!2! ) x 10C4= 8400 x 210 =1 764 000

    For 1/2/3/5/6/7 digits the totals would be:
    10 / 5670 / 216720 /4 233 600 / 3 175 200 / 604 800.

Leave a comment

Design a site like this with WordPress.com
Get started