Divisible
✖
Divisible
Details

- Divisible is typically used to test whether n is divisible by m.
- n is divisible by m if n is the product of m by an integer.
- Divisible[n,m] is effectively equivalent to Mod[n,m]==0.
- Divisible[n, m] returns False unless n and m are manifestly divisible.
- Divisible[n,m] can be entered as
.
can be entered as \[Divides] or
divides
.

Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (6)Survey of the scope of standard use cases
Divisible works over integers:

https://wolfram.com/xid/0ftvmoi-u0o0br


https://wolfram.com/xid/0ftvmoi-wo26j4


https://wolfram.com/xid/0ftvmoi-trs5xm

Symbolic forms of numeric quantities:

https://wolfram.com/xid/0ftvmoi-xlo


https://wolfram.com/xid/0ftvmoi-byi


https://wolfram.com/xid/0ftvmoi-845fn4

Divisible threads elementwise over lists:

https://wolfram.com/xid/0ftvmoi-eulagn

TraditionalForm formatting:

https://wolfram.com/xid/0ftvmoi-zyj9ik

Applications (8)Sample problems that can be solved with this function
Basic Applications (3)
Highlight numbers divisible by :

https://wolfram.com/xid/0ftvmoi-bfkjsd

Generate random numbers divisible by a given number:

https://wolfram.com/xid/0ftvmoi-ejowp

https://wolfram.com/xid/0ftvmoi-o0h98


https://wolfram.com/xid/0ftvmoi-dda2jk

Visualize when one number divides another:

https://wolfram.com/xid/0ftvmoi-q01

Number Theory (5)
Recognize Wieferich primes, prime numbers p such that divides
:

https://wolfram.com/xid/0ftvmoi-hndplo

https://wolfram.com/xid/0ftvmoi-len25z

There are only two known Wieferich primes:

https://wolfram.com/xid/0ftvmoi-3y6osb

Let be all numbers of the form
:

https://wolfram.com/xid/0ftvmoi-y7zsqg
Check that the product of two numbers is still in :

https://wolfram.com/xid/0ftvmoi-61uqh7

Recognize Hilbert primes, prime numbers that have no divisors in other than
and themself:

https://wolfram.com/xid/0ftvmoi-4pv3e7
Find the first Hilbert primes:

https://wolfram.com/xid/0ftvmoi-2swwye

Find two representations of a number as the sum of two squares:

https://wolfram.com/xid/0ftvmoi-35lz21

Find a divisor of the number by computing the GCD of and the number:

https://wolfram.com/xid/0ftvmoi-bfwucp


https://wolfram.com/xid/0ftvmoi-z6hca8

Find another divisor by computing the GCD of and the number:

https://wolfram.com/xid/0ftvmoi-kdcv52


https://wolfram.com/xid/0ftvmoi-48pcrv

An integer is divisible by if the sum of its digits is divisible by
:

https://wolfram.com/xid/0ftvmoi-k0yuga


https://wolfram.com/xid/0ftvmoi-1ue49

An integer is divisible by if the alternating sum of the digits is divisible by
:

https://wolfram.com/xid/0ftvmoi-onjd


https://wolfram.com/xid/0ftvmoi-w3uct

is divisible by
, where n is an odd integer:

https://wolfram.com/xid/0ftvmoi-gr3yza

Properties & Relations (7)Properties of the function, and connections to other functions
If is an integer, then
is divisible by
:

https://wolfram.com/xid/0ftvmoi-trltzi

If is divisible by
, then the greatest common divisor GCD of them is
:

https://wolfram.com/xid/0ftvmoi-bvhal6


https://wolfram.com/xid/0ftvmoi-cfk519

If and
are relatively prime, then
is not divisible by
:

https://wolfram.com/xid/0ftvmoi-d7b7z


https://wolfram.com/xid/0ftvmoi-cm4xuh

If the prime factorization of an integer has the form , then the number of its divisors is
:

https://wolfram.com/xid/0ftvmoi-fauclh


https://wolfram.com/xid/0ftvmoi-iw4rcj


https://wolfram.com/xid/0ftvmoi-fuq8ma

Use Divisors to find all divisors of an integer:

https://wolfram.com/xid/0ftvmoi-c2t67a


https://wolfram.com/xid/0ftvmoi-nfm7cr

PrimeNu gives the number of distinct prime divisors:

https://wolfram.com/xid/0ftvmoi-r6er5


https://wolfram.com/xid/0ftvmoi-b1wdek


https://wolfram.com/xid/0ftvmoi-jgd1tt

Possible Issues (2)Common pitfalls and unexpected behavior
Interactive Examples (1)Examples with interactive outputs
Neat Examples (3)Surprising or curious use cases
Visualize when is divisible by primes. Each row of dots corresponds to the divisors of
, which are labeled along the horizontal axis:

https://wolfram.com/xid/0ftvmoi-eq61yv

Plot when divides the sum of three squares:

https://wolfram.com/xid/0ftvmoi-l9t

Plot the Ulam spiral of numbers divisible by :

https://wolfram.com/xid/0ftvmoi-l5q7y3

https://wolfram.com/xid/0ftvmoi-vcxncv

Wolfram Research (2007), Divisible, Wolfram Language function, https://reference.wolfram.com/language/ref/Divisible.html.
Text
Wolfram Research (2007), Divisible, Wolfram Language function, https://reference.wolfram.com/language/ref/Divisible.html.
Wolfram Research (2007), Divisible, Wolfram Language function, https://reference.wolfram.com/language/ref/Divisible.html.
CMS
Wolfram Language. 2007. "Divisible." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Divisible.html.
Wolfram Language. 2007. "Divisible." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Divisible.html.
APA
Wolfram Language. (2007). Divisible. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Divisible.html
Wolfram Language. (2007). Divisible. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Divisible.html
BibTeX
@misc{reference.wolfram_2025_divisible, author="Wolfram Research", title="{Divisible}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/Divisible.html}", note=[Accessed: 19-June-2025
]}
BibLaTeX
@online{reference.wolfram_2025_divisible, organization={Wolfram Research}, title={Divisible}, year={2007}, url={https://reference.wolfram.com/language/ref/Divisible.html}, note=[Accessed: 19-June-2025
]}