Skip to content
Ruby Quest Online is a vibrant blog dedicated to Ruby progr…

Did You Figure Out It? These Puzzles Revolving Around the Digit 11

This morning, we presented a trio of challenges focused on the digit 11. Below, revisited along with their solutions.

1. Funny Formation

Imagine you are the manager of a football team. The players have shirt numbers from 1 to 11, and the goalkeeper using number 1. Your task is to divide the other ten field players into three groups: defenders, midfielders, and forwards.

The question is: Is it possible to set up the team so that the total of the shirt numbers in each group is evenly divided by 11?

Give one arrangement, or prove it cannot be done.

Solution

This arrangement is impossible.

The sum total of all numbers from 1 to 11 is 66. Therefore, the sum for the ten field players is 66 - 1 = 65.

Should the totals for the defenders, midfielders, and forwards were each divisible by 11, then their combined sum must also be divisible by 11. However, we know this is false, because 65 cannot be divided evenly by 11.

2. Pals or Not

As we learn our multiplication tables, the 11-times table seems wonderfully easy.

11 × 1 = 11
11 × 2 = 22
11 × 3 = 33
…
11 × 9 = 99

Every answer are palindromic numbers (digits that are identical forwards and backwards).

Carrying on up to 11 × 99, how many more products are palindromes?

Answer

There are nine more.

Think about the method of multiplying by 11. When a two-digit number has digits a and b, the product with 11 is created by writing the first digit, then their sum, then the second digit—as long as no regrouping is needed.

As an illustration, 11 × 52 = 572, because the middle digit is simply 5 + 2 = 7.

i) Identical Digits (four cases)

If the two digits are the same, as in 11, 22, 33, or 44, then the product with 11 yields 121, 242, 363, and 484—all palindromes.

This works only as long as the sum in the middle remains under 10, which limits us to these four cases.

ii) “Consecutive” Numbers (four cases)

Look at numbers where the second digit is the successor of the first. In these cases, the outer digits of the product are the same, producing palindromes.

  • 11 × 56 = 616
  • 11 × 67 = 737
  • 11 × 78 = 858
  • 11 × 89 = 979

iii) The Last Example (single case)

Go a little higher, the product becomes four digits. The leading digit will be a 1, so the sole chance for a palindrome is when the final digit is also 1. Let's test 91 shows it succeeds! 11 × 91 = 1001.

3. Big Divide

Less well known as other divisibility rules, there is a simple method to check for divisibility by 11.

Take the digits of a number and sum them alternately with plus and minus signs (starting with a plus). Should the total is a divisible by 11 (including 0), then the starting number is a multiple of 11.

As an example, for 132 we calculate +1 - 3 + 2 = 0, so 132 is divisible by 11.

Employing each of the digits 0–9 exactly once, create the largest possible 10-digit number that is a multiple of 11.

Solution

The number is 9876524130.

The largest 10-digit number with the digits 0–9 once each is 9876543210.

Applying the divisibility test for 11, we contrast the sum of digits in odd places with the sum in even places. For this number:

  • Digits in odd places: 9, 7, 5, 3, 1 total 25.
  • Even positions: 8, 6, 4, 2, 0 sum to 20.

Their difference is 5, which is not divisible by 11.

Since the sum of all digits 0–9 is 45, the two sums must invariably total 45, so their difference can never be 0. The nearest multiple of 11 we can aim for is therefore 11.

To keep the number as high as possible, we try to keep the descending prefix. If the number began 987654…

The digits fixed so far give a difference of (9+7+5) - (8+6+4) = 3. The other digits 3,2,1,0 must contribute 8, but in the best arrangement they can only contribute (3+1) - (2+0) = 2. So no number starting 987654… will succeed.

Next, attempt keeping the prefix 98765…

These digits give a difference of (9+7+5) - (8+6) = 7. The other digits 4,3,2,1,0 must provide precisely 4.

To make as large as possible the difference, place the biggest digits left, 4 and 3, into odd places, and 2,1,0 into even places. This yields (4+3) - (2+1+0) = 4, exactly what we need.

Arranged to maintain the number as great as possible, this gives us 9876524130.

Verifying confirms: the odd-position sum is 28, the sum in even places is 17, and 28 - 17 = 11, so the number is truly divisible by 11.

We hope you enjoyed these puzzles. More puzzles will be coming soon.

CC
About the author

Cynthia Campbell

Akiko is a Rubyist and blogger who loves sharing clean code and elegant solutions with the community.

Ruby Quest Online

Type to search articles.