Find Order of a Number in Mathematica - Number Theory

  • Context: Mathematica 
  • Thread starter Thread starter axeae
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary

Discussion Overview

The discussion revolves around finding the order of a number in Mathematica, specifically in the context of number theory. Participants explore the appropriate function to use and clarify the terminology related to the concept of order in modular arithmetic.

Discussion Character

  • Technical explanation, Conceptual clarification, Debate/contested

Main Points Raised

  • One participant inquires about how to find the order of a number in Mathematica, initially expressing confusion over search results related to ordering numbers.
  • Another participant asserts that the function MultiplicativeOrder[a,n] is indeed the correct approach, but emphasizes that it finds the order of a number modulo n, not the order of a number in a general sense.
  • A concern is raised regarding the use of the function, noting that if gcd(a,n) is not equal to 1, it may lead to issues.
  • A subsequent reply questions the assertion that the function would crash, suggesting that it should check for coprimality first.
  • One participant clarifies their earlier statement, acknowledging the confusion and confirming that they meant the order of a number modulo n, specifying that 'a' is the number and 'n' is the modulus.

Areas of Agreement / Disagreement

Participants express differing views on the implications of using the MultiplicativeOrder function, particularly regarding its behavior when the inputs are not coprime. There is no consensus on whether the function will crash or simply return no output.

Contextual Notes

There are unresolved assumptions about the behavior of the MultiplicativeOrder function in cases where gcd(a,n) is not equal to 1, and the discussion does not clarify the exact nature of the output in such scenarios.

axeae
Messages
70
Reaction score
0
does anyone know how to find the order of a number in mathematica? all a google search turns up is ordering numbers :smile:

thanks

whoops, this should be in number theory

and for those who were wondering, its MultiplicativeOrder[a,n]
 
Last edited:
Physics news on Phys.org
I don't understand. Isn't MultiplicativeOrder[a,n] precisely the thing you want? And you aren't finding the order of a number. You're finding the order of a number modulo n. A number does not have an order.
 
Just be careful how you use that function. If gcd(a,n)!=1 then it will crash.
 
Why will it crash? Surely it verifies that a and n are coprime first (which is a trivial calculation).
 
yeah sorry for the confusion, I posted this and then realized it was in the wrong section and then finally found the command.

btw if gcd(a,n)!=1, it just returns no output in Mathematica 6

edit: yeah I misspoke, I should have said order of a number mod n, in my example a was the number and n was the mod.
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 20 ·
Replies
20
Views
7K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K