WoodCentral Forums

Est. 1998 — 27 years of woodworking knowledge

Friday Puzzler -- seven-digit number

Posts

Friday Puzzler -- seven-digit number

#1

Friday Puzzler -- seven-digit number

Alex Y

I have a seven digit number, composed of seven consecutive digits, scrambled to form my number.

I can take away the leftmost digit to form a six digit number, then take away the right-most digit of what is left to form a five digit number, then take away the left-most... continuing to alternate until I am left with only a single-digit number. Looking at the resulting seven numbers, I notice two things:

1) All seven numbers are odd

2) Only the six-digit number is divisible by three, and it is not divisible by nine.

Interestingly, if I start my alternating elimination of digits with the right-most digit, I get a set of seven numbers that also has the two properties above.

What is my seven-digit number?

Re: Friday Puzzler -- seven-digit number

#2

Re: Friday Puzzler -- seven-digit number

Larry Barrett

The sum of the 7th and 6th digits in your number, minus the 5th digit, is equal to the sum of the 1st and 2nd digits, and is also equal to the sum of the 3rd and 4th digits.

Re: Friday Puzzler -- seven-digit number

#3

I was about to say "wrong"

Alex Y

Then realized that you must be numbering the digits from the right. If that is the case, I think you have it!

Toward the end of next week, why don't you post your solution method.

Re: Friday Puzzler -- seven-digit number

#4

Re: I was about to say "wrong" - solution

Larry Barrett

Objective is to find a number N that contains 7 consecutive, scrambled, digits that satisfies the conditions stated in Alex’s problem. One of the conditions requires testing each new number to determine if it is divisible by three – the 6-digit number must be divisible by three (and not by nine), but none of the other numbers (including the objective number) is divisible by three. There are lots of numbers to be tested, and one way to avoid the use of a calculator is to use the rule for determining if a number is divisible by three (or by nine). This is one of those things you might have learned in HS but may have forgotten. The rule is that a number is evenly divisible by three if the sum of the digits in the number is divisible by three, and similarly, a number is evenly divisible by nine if the sum of the digits in the number is divisible by nine. For example, the sum of the digits in the number 132 is six, which is divisible by three, but not by nine. So the rule tells you that the number 132 is divisible by 3, but not by nine and you don’t need a calculator to find out. Since the order of the digits doesn’t matter, the same rule applies to the numbers 123, 321, 312, etc. All are divisible by three, but not by nine. Pretty handy for Alex’s problem.

So the possible starting sets for N are these sets of consecutive integers:

1) 0 1 2 3 4 5 6

2) 1 2 3 4 5 6 7

3) 2 3 4 5 6 7 8

4) 3 4 5 6 7 8 9

Since N will contain all of the digits in a set, we can use the ‘rule of three’ to eliminate sets 1 and 4, since the sum of the digits in these sets is 21 and 42, respectively, and any N formed from sets 1 or 4 will therefore be divisible by three. We can also eliminate set 3; it contains 4 even digits (2,4,6,8) and only three odd digits (3,5,7), and we know from the original problem that as new numbers are formed by removing digits alternating from left, then right (and the reverse sequence for the second set of numbers), each new number (including the original number) is always odd. So the possible starting sets must contain 4 odd digits, thus eliminating set 3. So N must be formed by arranging the digits in set 2 in some order; we know that the 4 odd digits must be right-most 4 digits in N, and we also know that the digit 3 cannot be the central digit in N since it is divisible by three.

Consider the set 1 2 3 4 5 6 7. The sum of these 7 digits is 28. New numbers will be formed by dropping digits - left-most, then right-most, then left-most, …, (and vice-versa). As a first step, we want to see if we can discover which two digits can be dropped from this set that will form the 6-digit numbers that will be divisible by three (but not by nine). When the digit 1 is removed the sum is 27 - divisible by both three and nine - so 1 cannot be either the left-most or the right-most digit in N. Continue testing this set by removing one digit at a time (2, then 3, then 4, etc., but retaining the remaining 6 digits); doing this, we see that the sum of the remaining digits is 26, 25, 24, 23, 22, 21, respectively. Observe that when 4 is removed, the sum of the remaining digits is 24 - divisible by three, but not by nine, and when 7 is removed the sum is 21, also divisible by three but not by nine. Since 4 and 7 are the only digits that satisfy this test, we can conclude that N must start with 4 and end with 7. The remaining three odd digits will be the right-most digits, and 3 will not the central digit.

So N could be 4261357, or 4621357, or 4265137, etc. To make further progress in determining N, we have to test each new number formed by dropping digits, using the ‘rule of three’ to verify divisibility by three, or not. For example, suppose we try the number 4261357. (For this example we will follow the ‘drop the left-most digit to form a 6 digit number, drop the right-most digit to form a 5 digit number, etc. A similar test must be made following the reverse set of steps). Dropping the left-most digit forms the 6 digit number 261357, which we already know is divisible by three, but not by nine. Now drop the right-most digit to form the 5 digit number 26135. The sum of the digits in this number is 17, not divisible by 3, so still OK. Now drop the left-most digit to form the 4 digit number 6135. The sum of the digits in 6135 is 15 - divisible by 3. So we must reject 4261357 and start anew. Continuing in this manner, we find that 4625317 works for all tests, and thus must be Alex’s number.

Re: Friday Puzzler -- seven-digit number

#5

Nicely done!

Alex Y

After you have determined 4 and 7 as the first and last digit, modulo arithmetic helps to determine the order of the rest without any trial and error.

In the five-digit number, the even digits are 2 and 6, which are 2 and 0 mod 3

The odd digits are 1,3,5, which are 1,0,2 mod 3

Working only with the mods, we have a five digit number ABCDE where ABCDE = 2

A=0, or else BCDE=0

B=2 (the modulo of the only even number left.

E<>2, or BCD would = 0

E<>0, or CD would =0

So E=1, C=2 (it is the single-digit number, not divisible by 3), and D=0

ABCDE=02201

which are the modulo representations of 62531

👍 This page answered my questions

Your vote helps other woodworkers quickly find the answers and techniques that actually work in the shop.