QuotientRemainder[m,n]
gives a list of the quotient and remainder from division of m by n.
QuotientRemainder
QuotientRemainder[m,n]
gives a list of the quotient and remainder from division of m by n.
Details
- QuotientRemainder is also known as the ratio and quantity "left over" from division of m by n.
- Integer mathematical function, suitable for both symbolic and numerical manipulation.
- QuotientRemainder[m,n] returns the ratio of m,n and the quantity "left over".
Examples
open all close allBasic Examples (2)
Compute the quotient and remainder of two numbers:
QuotientRemainder[7, 2]Plot the sequence of quotients:
DiscretePlot[First[QuotientRemainder[n, 5]], {n, 0, 40}]Plot the sequence of remainders:
DiscretePlot[Last[QuotientRemainder[n, 5]], {n, 0, 40}]Scope (7)
QuotientRemainder works over integers:
QuotientRemainder[19, 5]QuotientRemainder[15 / 4, 2 / 3]QuotientRemainder[5.89, 2.4]QuotientRemainder[E ^ E, Pi]QuotientRemainder[9.4 + 6I, 1. + I]QuotientRemainder[10 ^ 90, NextPrime[10 ^ 80]]QuotientRemainder threads elementwise over lists:
QuotientRemainder[{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, 3]Applications (8)
Basic Applications (3)
Plot the quotient of a number of division by 5:
Plot[First[QuotientRemainder[x, 5]], {x, -10, 10}]Plot the remainder of a number of division by 5:
Plot[Last[QuotientRemainder[x, 5]], {x, -10, 10}]Plot the quotient of two integers:
MatrixPlot[Table[Quotient[a, b], {a, 20}, {b, 20}], PlotLegends -> Automatic]Number Theory (5)
Use NestWhileList to compute the quotient of positive arguments:
myQuotient[m_, n_] := Length[NestWhileList[n + #&, n, # ≤ m&]] - 1;myQuotient[26, 7]QuotientRemainder[26, 7][[1]]Use Floor to compute the quotient for integers:
Floor[83 / 16]QuotientRemainder[83, 16][[1]]Demonstrate how division works:
{q, r} = QuotientRemainder[7, 2];2 q + r == 7Count the number of positive integers less than 1000 divisible by 2 or 3, but not divisible by 6:
With[{n = 1000}, Quotient[n, 2] + Quotient[n, 3] - 2Quotient[n, 6]]Count[Range[1000], n_ /; (Divisible[n, 2] || Divisible[n, 3]) && !Divisible[n, 6]]euclid[a_, b_] := FixedPointList[{#2, If[#2 == 0, 0, # - Quotient[##]#2]}&@@#&, {a, b}][[-3, 1]];euclid[24, 36]GCD[24, 36]Properties & Relations (2)
The first part of QuotientRemainder is the Quotient:
First[QuotientRemainder[11, 2]]Quotient[11, 2]The second part of QuotientRemainder is the Mod:
Last[QuotientRemainder[11, 2]]Mod[11, 2]Neat Examples (2)
Plot the arguments of the Fourier transform of the QuotientRemainder:
ArrayPlot[Arg[Fourier[Table[QuotientRemainder[m, n], {m, 100}, {n, 100}]]]]Plot the Ulam spiral of the QuotientRemainder:
ulam[n_] := Partition[Permute[Range[n ^ 2], Accumulate[Take[Flatten[{{n ^ 2 + 1} / 2, Table
[(-1) ^ j i, {j, n}, {i, {-1, n}}, {j}]}], n ^ 2]]], n];ArrayPlot[QuotientRemainder[ulam[101], 50], ColorFunction -> (Hue[#[[1]] + #[[2]]]&)]Tech Notes
Related Guides
History
Text
Wolfram Research (2007), QuotientRemainder, Wolfram Language function, https://reference.wolfram.com/language/ref/QuotientRemainder.html.
CMS
Wolfram Language. 2007. "QuotientRemainder." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/QuotientRemainder.html.
APA
Wolfram Language. (2007). QuotientRemainder. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/QuotientRemainder.html
BibTeX
@misc{reference.wolfram_2026_quotientremainder, author="Wolfram Research", title="{QuotientRemainder}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/QuotientRemainder.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_quotientremainder, organization={Wolfram Research}, title={QuotientRemainder}, year={2007}, url={https://reference.wolfram.com/language/ref/QuotientRemainder.html}, note=[Accessed: 13-June-2026]}