I could use that $17^{2} \equiv 10 (\mod 31)$ and express $17^{23}$ as $17^{16}.17^{4}.17^{3} = (((17^2)^2)^2)^2.(17^2)^2.17^2.17$ and take advantage of the fact that I can more easily work with powers of ten ($17^2 \equiv 10 (\mod 31), (17^2)^2 \equiv 100 (\mod 31) \equiv 7 (\mod 31)$, etc.). While this makes the computation easier, I'm thinking there might be a better way to do this.
Welcome to Mathematics Stack Exchange

We're a little bit different from other sites. Here's how:
Ask questions, get answers, no distractions
This site is all about getting answers. It's not a discussion forum. There's no chit-chat.
Just questions...
...and answers.
Good answers are voted up and rise to the top.
The best answers show up first so that they are always easy to find.
The person who asked can mark one answer as "accepted".
Accepting doesn't mean it's the best answer, it just means that it worked for the person who asked.
How to efficiently compute $17^{23} (\mod 31)$ by hand?
2 Answers
$17^2\equiv10\pmod{31}$
$17^4 \equiv 7\pmod{31}$
$17^3 \equiv 170\pmod{31}\equiv15\pmod{31}$
$17^7=17^3\times17^4\equiv15\times7\pmod{31}\equiv12\pmod{31}$
${(17^7)}^3=17^{21}\equiv23\pmod{31}$
$17^{23}=17^{21}\times17^2\equiv230\pmod{31}\equiv13\pmod{31}$
Note that $17\equiv 3/2 \pmod {31}$. We can then calculate this.
$2^5 = 1$, so $2^{23}=8$.
$3^3 = -4$, so $3^6 = 16$. We then have $3^{24} = 16^4 = 2$, and dividing through by $8$, we get $8$. Divide this by $3$ to get $31+8 = 39$, divide by 3 to get $13$.
Get answers to practical, detailed questions
Focus on questions about an actual problem you have faced. Include details about what you have tried and exactly what you are trying to do.
Ask about...
- Understanding mathematical concepts and theorems
- Hints on mathematical problems (but please read our FAQ about homework questions)
- History and development of mathematics
- Solving mathematical puzzles
- Software that mathematicians use
Not all questions work well in our format. Avoid questions that are primarily opinion-based, or that are likely to generate discussion rather than answers.
Questions that need improvement may be closed until someone fixes them.
Don't ask about...
- Anything not directly related to math
- Questions that are primarily opinion-based
- Questions with too many possible answers or that would require an extremely long answer
- Physics, engineering and financial questions.
- Questions about typesetting equations
- Numerology questions
- Questions about the site itself — please ask on meta instead
You earn reputation when people vote on your posts
Your reputation score goes up when others vote up your questions, answers and edits.
As you earn reputation, you'll unlock new privileges like the ability to vote, comment, and even edit other people's posts.
Reputation | Privilege |
---|---|
15 | Vote up |
50 | Leave comments |
125 | Vote down (costs 1 rep on answers) |
At the highest levels, you'll have access to special moderation tools. You'll be able to work alongside our community moderators to keep the site focused and helpful.
2000 | Edit other people's posts |
---|---|
3000 | Vote to close, reopen, or migrate questions |
10000 | Access to moderation tools |
Improve posts by editing or commenting
Our goal is to have the best answers to every question, so if you see questions or answers that can be improved, you can edit them.
Use edits to fix mistakes, improve formatting, or clarify the meaning of a post.
$17^2\equiv10\pmod{31}$
$17^4 \equiv 7\pmod{31}$
$17^3 \equiv 170\pmod{31}\equiv15\pmod{31}$
$17^7=17^3\times17^4\equiv15\times7\pmod{31}\equiv12\pmod{31}$
${(17^7)}^3=17^{21}\equiv23\pmod{31}$
$17^{23}=17^{21}\times17^2\equiv230\pmod{31}\equiv13\pmod{31}$
Unlock badges for special achievements
Badges are special achievements you earn for participating on the site. They come in three levels: bronze, silver, and gold.
Student | Asked first question with score of 1 or more |
Editor | First edit |
Good Answer | Answer score of 25 or more |
Civic Duty | Voted 300 or more times |
Famous Question | Asked a question with 10,000 views |
Find a question to answer, or ask your own
Mathematics Stack Exchange is part of the Stack Exchange network
Like this site? Stack Exchange is a network of 110 Q&A sites just like it. Check out the full list of sites.
Use comments to ask for more information or clarify a question or answer.
You can always comment on your own questions and answers. Once you earn 50 reputation, you can comment on anybody's post.
Remember: we're all here to learn, so be friendly and helpful!