Which numbers from 1 to 100 are divisible by 9?

    Find a mod b for negative numbers, decimals or 300-digit integers, see how Python, Excel and JavaScript differ, and get powers mod n, remainder tables and divisibility checks.

    The calculator below is set to a table of remainders for the numbers from 1 to 100 with divisor 9. Press Calculate to see how many of them divide evenly by 9, marked with a remainder of 0, together with the remainder of every other number and how often each remainder occurs. Change the range for other limits, up to 200 numbers at a time.

    Parameters

    Enter data for calculations

    Only the boxes for your choice appear

    Form progress0 / 1 fields

    💡 Fill in all required fields to unlock the calculate button

    Modulo and remainders, with the sign rule spelled out

    Ask Python for -7 mod 3 and it says 2; ask JavaScript and it says -1. Both are right under their own rules, and this modulo calculator prints both, plus the Euclidean remainder that number theory uses, so you can see which one your code or your homework expects. It works on whole numbers of any length (a 31-digit number is no problem), on decimals such as 7.5 mod 2 = 1.5 without floating-point noise, and it has three more modes: a power mod n such as the last digit of 7100, a table of remainders for a range, and a divisibility check against a list of divisors.

    Quick start. Choose "a mod b", type 17 and 5, and the answer is 2, because 17 = 5 × 3 + 2. Negative or decimal inputs work the same way; the table under the result shows how each convention treats them.

    What each mode needs from you

    1. What do you want to calculate - a remainder a mod b, a power mod n, a table of remainders, or a divisibility check.
    2. Dividend a and divisor b - any whole numbers or decimals, negative allowed, b not zero. Type digits without thousands separators.
    3. Base, exponent and modulus - for a power mod n. The exponent may have hundreds of digits; the modulus must be 1 or more.
    4. Divisor, first and last number - for the table, up to 200 numbers in one range.
    5. Number to check and a list of divisors - separated by commas or spaces, for example 2, 3, 5, 7, 11.
    6. Read the headline answer, the tiles (quotient, Euclidean remainder, the JavaScript result, the cycle of powers) and the table below it.

    Eight everyday jobs a remainder does

    Example 1: what the clock says after 100 hours

    Situation: it is 9:00 now, what time will it be in 100 hours? (9 + 100) mod 24
    Result: 109 mod 24 = 13, so 13:00, which is 1 p.m., four days later.
    Use 12 instead of 24 for a 12-hour dial, and treat an answer of 0 as 12.

    Example 2: the weekday 45 days from a Monday

    Situation: number the days Monday = 0 to Sunday = 6. 45 mod 7
    Result: 3, so a Thursday. Six full weeks pass and three days are left over.
    For a date in another month, the date calculator counts the days for you first.

    Example 3: seconds into minutes and seconds

    Situation: a timer shows 1000 seconds. 1000 mod 60
    Result: quotient 16, remainder 40: 16 minutes 40 seconds.
    The quotient tile is the "div" half of the same division, so one calculation gives both parts.

    Example 4: the check digit of an ISBN-10

    Situation: the first nine digits are 0-306-40615. Multiply them by 10, 9, ..., 2 and add: 130. 130 mod 11
    Result: the remainder is 9, and the check digit is 11 - 9 = 2, giving 0-306-40615-2.
    A result of 10 is written as X; this is why some older ISBNs end in X.

    Example 5: the last digit of 7 to the 100th power

    Situation: the power mod n mode, base 7, exponent 100, modulus 10. 7^100 mod 10
    Result: 1. Last digits of powers of 7 repeat 7, 9, 3, 1 every four steps, and 100 is a multiple of 4.
    The result lists the cycle, so you can see where any exponent lands.

    Example 6: a power far too big to write out

    Situation: 3200 has 96 digits. 3^200 mod 7
    Result: 2, reached by repeated squaring with every step reduced mod 7.
    This is the same arithmetic that RSA encryption runs on numbers hundreds of digits long.

    Example 7: a negative number in code

    Situation: an array index that moves left past the start. -7 mod 3
    Result: Python and spreadsheets give 2, a valid index; JavaScript, C and Java give -1, which crashes the lookup.
    In JavaScript, ((a % b) + b) % b gives the non-negative answer for a positive b.

    Example 8: a remainder with decimals

    Situation: how much of a 7.5 m board is left after cutting 2 m pieces? 7.5 mod 2
    Result: three pieces and 1.5 m left, exactly. In floating point, 0.3 mod 0.1 comes out as 0.09999999999999998; here it is 0.
    Up to 12 decimal places are handled exactly.

    -7 mod 3 and 7 mod -3 in each language

    The remainder must satisfy a = b × q + r in every convention; they differ only in how the quotient q is rounded, and that decides the sign of r.

    Where -7 mod 3 7 mod -3 Rule
    Python %, Excel and Google Sheets MOD, R %%2-2quotient rounded down, sign of the divisor
    JavaScript, C, C++, Java, C# %-11quotient cut toward zero, sign of the dividend
    Java Math.floorMod2-2the floor rule, added for this exact problem
    Euclidean remainder (number theory)21always from 0 to |b| - 1

    When both numbers are positive all four rows agree, which is why the difference goes unnoticed until the first negative input.

    Last digits of powers repeat

    The power mod n mode finds these cycles on its own; for mod 10 they are the patterns behind "what is the last digit of" questions.

    Base Last digits of base1, base2, ... Cycle length
    22, 4, 8, 64
    33, 9, 7, 14
    44, 62
    77, 9, 3, 14
    88, 4, 2, 64
    99, 12
    5 and 6always 5, always 61

    Modulo questions, answered with numbers

    What does mod mean in math?
    a mod b is the remainder after dividing a by b as whole numbers. 17 mod 5 = 2, because 5 goes into 17 three times with 2 left. Two numbers with the same remainder are called congruent: 17 ≡ 2 (mod 5).
    Why is -7 mod 3 equal to 2 and not -1?
    Both satisfy -7 = 3q + r: with q = -3 the remainder is 2, with q = -2 it is -1. Mathematics and Python pick the remainder that is not negative; C-family languages pick the quotient closer to zero. The calculator shows both.
    What is a mod b when a is smaller than b?
    The number itself, as long as it is not negative: 3 mod 7 = 3, because 7 goes in zero times. That surprises people who expect a decimal.
    Can the modulo of decimals be calculated?
    Yes, with the same rule: 7.5 mod 2 = 1.5, because 2 × 3 = 6 and 1.5 is left. Spreadsheets and Python do the same; C uses a separate fmod function for it.
    How do you find a remainder of a huge power by hand?
    Reduce as you go and look for a cycle. For 7100 mod 10 the last digits cycle every 4, and 100 mod 4 = 0, so the answer is the 4th value of the cycle, 1. The calculator also works without a short cycle, using repeated squaring.
    Is there a quick test for divisibility by 3, 9 or 11?
    A number leaves the same remainder mod 3 and mod 9 as the sum of its digits: 123456789 has digit sum 45, so it is divisible by both. For 11, alternate plus and minus from the rightmost digit. The divisibility mode prints both sums.

    Related tools

    Binomial Expansion Calculator

    Exact binomial coefficients and expansions, including very large C(n, k) - See calculator

    Conditional Probability Calculator

    Two-way tables, Bayes' theorem and test accuracy in exact fractions - See calculator

    GCD & LCM Calculator

    The Euclidean algorithm, which is repeated modulo from start to finish - See calculator

    Prime Factorization Calculator

    Every divisor of a number at once, from its prime factors - See calculator

    Prime Number Calculator

    Whether a number has any divisor besides 1 and itself - See calculator

    Number System Converter

    Binary, octal and hexadecimal, where each digit comes from a repeated remainder - See calculator

    Calculator verified by the LiczGrupa.pl team

    Content, formulas and results have been reviewed for accuracy and relevance by our team of specialists.

    Natalia Skrzek

    Reviewed by: Natalia Skrzek