Problem 42413. Divisible by 11

Created by goc3 in Community

Pursuant to the first problem in this series, this one involves checking for divisibility by 11.

Write a function to determine if a number is divisible by 11. Like the number seven, this can be done by a variety of methods. Some are:

  1. Form the alternating sum of the digits (e.g., positive even digits and negative odd digits). Apply recursively until a two-digit number results. If that result is divisible by 11, then so is the original number.
  2. Add the digits of the number in blocks of two from right to left. Apply recursively, as needed, and check for divisibility as stated in the previous method.
  3. Subtract the last digit from the remaining number (e.g., 649: 64 - 9 = 55). Apply recursion, as needed.
  4. Add ten times the last digit to the remaining number. Apply recursion, as needed. For example: 737: 73 + 70 = 143: 14 + 30 = 44.
  5. Etc.

Previous problem: divisible by 10. Next problem: divisible by 12.

Solution Stats

31.07% Correct | 68.93% Incorrect
Last solution submitted on Jan 16, 2019

Problem Comments

Solution Comments

Recent Solvers43

Suggested Problems

More from this Author161

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!