Using modular arithmetic to find the remainder of $12^{157}$ when divided by $10$ So, I've figured out that: $12 \equiv 2 \mod 10$ And hence, $$ 12^{157} \equiv 2^{157}  \mod 10$$ I thought of expanding out $2^{157} = 2^{156} \cdot 2 = 4^{78} \cdot 2 = 16^{39}   \cdot 2$, then I could write: $$ 12^{157} \equiv 2^{157} \equiv 16^{39} \cdot 2 \equiv  6^{39} \cdot 2 \equiv 36^{19}\cdot 12\equiv 6^{19} \cdot 2  \equiv 36^9 \cdot 12 \equiv 6^9 \cdot 2 \equiv 36^4 \cdot 12 \equiv 6^4 \cdot 2  \equiv 72 \cdot 36 \equiv 2 \cdot 6 \equiv 2 $$ This is quite a long process. I found that you could use fermats little theorem to speed up the case when the number we taking mod with is prime, however are there any theorems/methods which can be used to speed up calculations when we take a composite numbers?
Evaluate $6^{433} \pmod {21}$ and a proving question Question 1: Denote $a \mod b$ as $a \% b$, where $a$ and $b$ are some integers  Evaluate 12^32475 % 21    The following is what I tried:    12^32475 % 21 = (12^3 % 21)^10825 % 21 = 6^10825 % 21 = ... = 6^433 % 21   But how to continue ?  Question 2:  I don't understand this: n-1= -1 mod n. Where is this from? And does this line become the next line?    Context: my class is discrete math for computer science. So far for related topics, it covers modular inverse, (extended) GCD algorithm, Fermat's Little Theorem and Chinese Remainder Theorem (CRT).
Seasonal Loan Amortization Hi I can compute a Basic Loan Amortization Schedule, But now I'm trying to Calculate a Seasonal Loan Amortization Schedule . So for example A loan starts at January And Will go on for 3 years, with Monthly Payments. Interest is at 3% Annually and is compounded Annually. During the months of September, October, November, December It'll only accumulate Interest But no payments and principal. Principal is 100000. How Do I calculate Payments and interest. A Polygon is inscribed in a circle $\Gamma$ A regular polygon P is inscribed in a circle $\Gamma$. Let A, B, and C, be three consecutive vertices on the polygon P, and let M be a point on the arc AC of $\Gamma$ that does not contain B. Prove that  $MA\cdot MC=MB^2-AB^2$  I inscribed the polygon P in the unit circle and let B=1. Past this, I'm not really sure how to proceed. It might be helpful to have M at 1 as well but given that the polygon would have the n-th roots of unity in it B seemed like a good choice. What would be a good way to proceed from here? How to run find -exec? I'd like to find the files in the current directory that contain the text "chrome".  $ find . -exec grep chrome find: missing argument to `-exec'   What am I doing wrong? Compile error with \href ToC and \apacite I would like to edit my document but I have a compile error somewhere between the \href and the apacite but can't locate it. I've tried blocking out code and taking out references, with varying results.  \documentclass[a4paper,12pt]{article} \usepackage[english]{babel} \usepackage[utf8]{inputenc}  % TOC, Citations, Refereneces, and Appendicies \usepackage{apacite} % \cite{ref1,ref2} %Warning - unsupported tocstyle code \usepackage[tocindentauto]{tocstyle}     \renewcommand{\thesection}{\Roman{section}}      \renewcommand{\thesubsection}{\arabic{subsection}.}     \renewcommand{\thesubsubsection}{\roman{subsubsection}.} %\usepackage{hyperref} %\urlstyle{same} %\hypersetup{ %   colorlinks=true, %   urlcolor=cyan, %   linkcolor=blue, %   citecolor=green, %   filecolor=magenta, %   pdftitle={Sharelatex Example}, %   pdfpagemode=FullScreen, %} \usepackage[toc,page]{appendix}  \begin{document}    ...to be installed \cite{church13,hershkowits97}. \bibliographystyle{apacite} \bibliography{bibliography} \end{document}   Here are the bibliography.bib entries then  @ARTICLE{church13,    author       = {K.H. Church and H. Tsang and R. Rodrigiguez and P. Defembaugh and R. Rumpf},    year         = 2013,    title        = {Printed circuit structures, the evolution of printed circuit boards},    journal      = {Circuit Insight},    volume       = {},    number       = {},    pages        = {},    howpublished = {},     url          = {http://www.808multimedia.com/winnt/kernel.htm}, }  @ARTICLE{hershkowits97,    author       = {N. Hershkowits and R.A. Breun},    year         = {1997},    title        = {Diagnostics for plasma processing (etch plasmas) (invited)},    journal      = {Review of Scientific Instrumentation},    volume       = {68},    number       = {1},    pages        = {880--885},    howpublished = {}, } When a vehicle makes a turn, the two front wheels trace out two arcs as shown in the figure below. The wheel facing towards the inside of the turn has a steering angle that is greater than that of the outer wheel. This is necessary to ensure that both front wheels smoothly trace out two arcs, which have the same center, otherwise the front wheels will skid on the ground during the turn.   During a turn, do the rear wheels necessarily trace out the same arcs as the front wheels? Using Vim I often want to replace a block of code with a block that I just yanked.  But when I delete the block of code that is to be replaced, that block itself goes into the register which erases the block I just yanked. So I've got in the habit of yanking, then inserting, then deleting what I didn't want, but with large blocks of code this gets messy trying to keep the inserted block and the block to delete separate.  So what is the slickest and quickest way to replace text in Vim?   is there a way to delete text without putting it into the register? is there a way to say e.g. "replace next word" or "replace up to next paragraph" or is the best way to somehow use the multi-register feature? You "show" someone a picture. You "---" someone a song? In , we have a verb meaning &quot;to show&quot; corresponding to &quot;to see/to look&quot;, and we have a different verb corresponding to &quot;to hear/to listen&quot;:  inti tara stampa (you look at a picture.) ---- jiena nurilek stampa (I show you a picture) inti tisma' diska (you listen to a song.) ----- jiena nsemmagħlek diska (I 'show' you a song)  In English, do you &quot;show someone a song&quot; (sounds weird to me) or is there a verb that corresponds more directly to the Maltese insemmgħek? More than one private key for RSA In an RSA-encryption scenario, Bob's public key pair $(n, e)$ is $(143, 43)$. An attacker Mallory tries brute-force and comes to $d = 7$ as the private key. The value of $φ(143) = 120$ is not known to Mallory. However from $43 \cdot d \equiv 1 \bmod 120)$, one can calculate the first positive element $d = 67$ from multiplicative group $d = 120 + 67n$ and $n \in \mathbb{Z}$ $d = 7$ clearly doesn't fit in that multiplicative group, so how come it can successfully decrypt the encryption? H2G2 — Teleportation Also Results in Time Travel? I need to define a new command to create a squiggle arrow with some text on it. Something similar to what \xrightarrow command produces but with wiggly arrows as in \rightsquigarrow. The length of the arrow should automatically be adjusted to fit the text above it and I do not know how to handle this part in TikZ. Any ideas would be much appreciated. How can I lock a folder so that it CANNOT be erased? On my computer running Windows XP Pro SP3 I have a folder on my desktop that is very important. How can I lock it so that I can alter anything in it, but the folder itself cannot be removed without resetting a (lock/unlock?) switch? Where to find the Mac OS X Lion security configuration guide? In the course of creating the content for a site, we've ended up with orphaned content nodes that are not linked to from anywhere. I'd like to find and examine these. Surprisingly, I can't find a module for this.  Tiny hypothetical example: I'm building a brochureware site. Someone wrote a "Contact" page, someone else wrote an "About Us", and someone else wrote "Directions". The person writing "Directions" forgot to put it in a menu link or add a link from "About Us" to "Directions". So "Directions" is orphaned: there are no links to it. I'd like to find all such nodes so I can figure out what to do with them. Viruses at this period of time do not fit the current definition of life.   Much of the reasoning behind this is that we currently believe that all life must be made up of cells.  Also, many biologist/scientists say that viruses are not living because all they are is just chemicals carrying out their predefined chemistry.   Has anyone every considered the fact that cells, the supposed building blocks of life, themselves simply only carry out predefined chemical actions? All actions cells carry out are chemically driven, not consciously or spiritually driven. Cells do not make choices, they follow chemical directions present in their DNA and RNA. Viruses act very similarly, following the action transcribed in their DNA or RNA.   How can we really even draw a defined line of what life is? What is the significance of a mostly blank user card? How do I get a block with data to place myself? I'm trying to use the \citep command in Latex and my document class is elsarticle. The problem is that it displays numbers not authoryear citations in the text which is what I'm looking for. Here are related parts of my code:      \documentclass[preprint,11pt]{elsarticle}      \usepackage{natbib}   ...      \bibliographystyle{plainnat}      \bibliography{ML}   And I'm obviously using the \citep command like this:      I once read \citep{edelman1993magnetic}   And my .bib file looks like this:  @article{wolf2009regional, title={Regional brain activation changes and abnormal functional connectivity of the         ventrolateral prefrontal cortex during working memory processing in adults with attention-deficit/hyperactivity disorder}, author={Wolf, Robert C and Plichta, Michael M and Sambataro, Fabio and Fallgatter,     Andreas J and Jacob, Christian and Lesch, Klaus-Peter and Herrmann, Martin J and     Sch{\"o}nfeldt-Lecuona, Carlos and Connemann, Bernhard J and Gr{\"o}n, Georg and others}, journal={Human brain mapping}, volume={30}, number={7}, pages={2252--2266}, year={2009}, publisher={Wiley Online Library} }   The result looks like:  I once read[1]   I'm looking for a result like this:  I once read(wolf., 2009)   Elsevier is actually looking for:  Text: All citations in the text should refer to:    Single author: the author's name (without initials, unless there is ambiguity) and the year of publication;  Two authors: both authors' names and the year of publication;  Three or more authors: first author's name followed by 'et al.' and the year of publication.    Thanks in advance Work the Spring There's a book that I read several years ago that I'd like to find.  However, I cannot remember enough about it to find it myself.  Neither the title nor author remain in my mind, nor any keyword or phrase that's unique enough for the Grand Google to nail for me.  Hence my desperate plea here.  In the book, there is an interstellar civilization composed of several power blocks.  The entire civilization did not fill the galaxy, but it did span several stellar systems.  Maybe 10s or 100s.  I seem to remember that one of the civilizations was a decentralized group referred to as the Brotherhood and they seemed to have been keen on preserving old learning and political ideals.  A derelict alien spacecraft from outside all of this had been discovered and at least two of the power blocks sent ships to recover it.  I don't recall if they knew at the time about the power the alien ship had, but they must have had some clue since there was some urgency in capturing this ship.  One of the ships sent to capture the Alien craft was commanded by somebody who was rather shaken up, to say the least.  He had had some big trauma in his past (like... the last ship he captained was annihilated with all hands.) so he was kinda bummed out about things and wasn't really putting his heart into getting this done.  He was assisted by the ship's AI who had a lot of soul-to-soul chats with the captain, and at one point almost relieved him of command because he was just not getting the job done.  I think the ship's name was Boaz.  These were the "good guys".  There was at least one other ship sent from the "bad guys."  The alien craft had some remarkable powers.  The interior volume was apparently infinite and the operators could see and manipulate anything in the universe.  There might have been some example given where all the rats somewhere were found and disposed of.  Whoever had control was tempted by the ole absolute power corrupts absolutely problem, but nobody but nobody could stop them because of their power.  They could eat and multiply within the ship and become real bad-asses.  But alas... (or hurray, depending upon which side you're one) everything fails eventually, and whoever controlled the ship would eventually succumb to some horrible end.  Whereupon the ship became derelict again until some other lucky race found it and repeated the cycle.  The ship had an AI that was real interested in taking the power for itself, but there was some mechanical, spring-loaded, mechanism outside of its control that needed to be worked in order to execute power.  The AI apparently never figured out how to "work the spring" and this made him crazy angry.  The ending is equally foggy for me.  I'm pretty sure the good guys got the ship.  They agonized over what to do with it.  Apparently it was indestructable and nobody wanted to taste the temptation of all that power.  In the end they dumped it on the surface of a neutron star.  There it sat forever more, probably with the crazy AI really pissed off about being there.  If you've read this book, you'll recognize it immediately from these clues.  I'm looking forward to finding out the name of this book.  Thanks! Is "po-TAH-to" an acceptable pronunciation for "potato"? Immortalized in the George and Ira Gershwin song "Let's Call the Whole Thing Off" is the nitpicking of pronunciation differences:      You like potato and I like potahto,   You like tomato and I like tomahto,   Potato, potahto, tomato, tomahto!   According to  and other sources, the English do pronounce tomato as tə-MAH-toh rather than tə-MAY-toh. But this doesn't seem to be the case when it comes to potato.     (From the O.E.D.)           –  Pronunciation: /təˈmɑːtəʊ/     –  Pronunciation: /pəˈteɪtəʊ/   Is "potahto" actually an acceptable way to pronounce potato? Or is the song just wrong? Find duplicate records in MySQL