From Euler's theorem we know that $a^{\varphi(n)} \equiv 1 \text{ (mod n)} $ and it works when $n$ and $a$ are coprime positive integers. I found following formula which may be useful for me $a^{x} \equiv a^{x \text{ mod } \varphi(n)} \text{ (mod n)}$. Is this formula correct? If yes, can anyone explain why this is true?
I've read about Fermat's little theorem and generally how congruence works. But I can't figure out how to work out these two:   $13^{100} \bmod 7$ $7^{100} \bmod 13$   I've also heard of this formula:  $$a \equiv b\pmod n \Rightarrow a^k \equiv b^k \pmod n $$  But I don't see how exactly to use that here, because from $13^1 \bmod 7$ I get 6, and $13^2 \bmod 7$ is 1. I'm unclear as to which one to raise to the kth power here (I'm assuming k = 100?)  Any hints or pointers in the right direction would be great.
error: file '/grub/i386-pc/normal.mod' not found error: file '/grub/i386-pc/normal.mod' not found. grub rescue&gt;   What can I do? I just sit and stare at it.   I found my old netbook (Dell Inspiron 1010) which I have not used for about four years. I replaced Windows XP with Ubuntu 12.10. I used my bootable USB drive. I installed and rebooted. I got the message that normal.mod is not found.   What should I do? Type exit, reboot, or quit? Should I re-install? How to put a brace on the right, not left, to group cases? How will old M42 lenses work on a Nikon camera? interaction between mathematical structures From a physicist's perspective there are several situations in which somehow arbitrary choices of mathematical structures can be made. One can describe a system from different perspectives, etc. without changing anything in the physical properties. (see gauge invariance, picture changing etc.) In the situation when these choices impose a mathematical structure one has limitations in the subsequent choices (are these limitations physical???). However, there are situations when this prescription does not hold. The best example is in this case the Black-Hole complementarity principle (if it is well defined in the first place). So, the question about how mathematical structures "interact" in a logical way is not a bad one. Again: what is the interaction between, say, locality and Hausdorff-ity in the case of a black hole? Or what is the true relation between metrizability and hausdorff-ity of a space in the context of a black hole? The question about how mathematical structures assigned (innocently) at some point interact in different situations is in my opinion a quite relevant one... When performing machine learning, the performance of the machine learning method is dependent on the original function $f$ that we are trying to learn (let's forget for a moment the non-deterministic error and focus on the properties of $f$).  I have a conceptual question. What would make a function easy to learn? For instance, a linear function can be easily learnt by linear methods such as linear regression and SVM. But in the general case, what would make a function easier to learn for decision trees or a neural network?   I believe feature engineering helps us move to a feature space in which the function we want to approximate is easier to represent. But what properties exactly are we trying to achieve for this function? An analytic function $f$ on $\{z \in\mathbb{C} : |z|>1 \}$ As the title says. I use, among other things, the following in my lstset:  framerule=1pt, frame=tblr   Some places a page break happens in the middle of my \lstlisting. Fine. But sometimes the whole code of the listing appears on one page, but the bottom frame appears on the top of the next page!    I know that I can float a particular listing, but I have a long document with many listings, and I don't want to float all of them; Most of them also need to be exactly where they are declared. That they are broken over a page doesn't bother me that much.  Is there something that can stop this from happening, without me needing to adjust each individual listing?   had the same problem, but fixed it by removing spaces in front of keywords in a custom language definition. I too have a custom language definition, but his solution doesn't help me. I managed to recreate the situation without a custom language.  Edit and MWE  I managed to reproduce it in a minimal working example. 's a pastebin, if that's helpfull.  \documentclass[UKenglish,a4paper,11pt]{report} \usepackage{babel}  %% Adjustments \addtolength{\topmargin}{-1\baselineskip} \addtolength{\textheight}{4\baselineskip} \pretolerance = 2000 \tolerance = 5000   \hbadness = \tolerance  %% Smaller font \usepackage{mathptmx}  %% LISTINGS \usepackage[final]{listings} \lstset{     xleftmargin=1.5em,     framexleftmargin=1em,     framextopmargin=0.5ex, %%  THE FRAME:     framerule=1pt,     frame=tblr }  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  \usepackage{lipsum}     % for demo \begin{document} \subsubsection{Lorem}   % some fiddling to get the "wrong spacing just right": \lipsum[1-3] \subsubsection{Ipsum}  \lipsum[1] and then some text  \begin{lstlisting} Here is a listing with three lines of code; The bottom border is placed on the next page! \end{lstlisting}  Can you believe it..?! \end{document}   This MWE is rather long. My document inputs most of the listings stuff from files written by others, so I'm not sure what all of it does. If anyone sees some lines that they are sure is irrelevant, feel free to take it out of the MWE.  "Fun fact"  An equally silly situation occurs if you remove \usepackage{mathptmx}: The whole code listing will then appear on the new page, except for the top frame which is left on the bottom of the first page! Poll on best VNC / remote desktop software for assisting others on Windows/Mac machines from Ubuntu?    I've heard good things about TeamViewer and Fog Creek Copilot, but I'm wondering if the included GNOME Vinaigre VNC client is good enough for this.  To specify, I'm looking for best option based on:   SIMPLEST ease-of-use for client to download/use on their end. See #1. Works cross-platform I am able to control client's mouse and/or keyboard from remote machine. Lost access to sudo sudo: unable to resolve host   I think I need to edit the /etc/hosts file to make an entry for 127.0.1.1 PC name.  But how can I do that if I can't access sudo? It seems to have gone since I updated to 13.10.  I have tried nano, which still doesn't work. How can I extract a predetermined range of lines from a text file on Unix? I have a ~23000 line SQL dump containing several databases worth of data. I need to extract a certain section of this file (i.e. the data for a single database) and place it in a new file. I know both the start and end line numbers of the data that I want.  Does anyone know a Unix command (or series of commands) to extract all lines from a file between say line 16224 and 16482 and then redirect them into a new file? What do Family Tree Maker users do, now that FTM has been discontinued? I was considering purchasing Family Tree Maker only to find it has been discontinued.    What do they plan for a replacement ? Why aren't the braces showing How to do multiple joins when using groupby in linq How to concatenate a std::string and an int I thought this would be really simple, but it's presenting some difficulties. If I have std::string name = &quot;John&quot;; int age = 21;  How do I combine them to get a single string &quot;John21&quot;? iOS emails stuck in All Inboxes In the iOS Mail app, there are 4 emails in the "All Inboxes" section. Those 4 emails are NOT in the actual inbox on Gmail.  I thought, oh well I don't mind deleting them entirely since they're just newsletters. I deleted them directly on gmail, but they still appeared in iOS. So I tried deleting them via iOS and ... they keep coming back!  Even stranger, the 4 emails ONLY appear in "All Inboxes", they don't appear in any of the sub-account inboxes.  So, I disabled "Mail" in my gmail account. They're still here! I no longer have a "gmail" sub-account, but those 4 emails are still in All Inboxes. I tried to quit the app a few times, restart the phone. Still here...  When I tap on one of those messages, I get a black screen (dark mode), no errors. Construction of uncountably many non-isomorphic linear (total) orderings of natural numbers I would like to find a way to construct uncountably many non-isomorphic linear (total) orderings of natural numbers (as stated in the title).  I've already constructed two non-isomorphic total orderings. They are $$ 1 &lt; 2 &lt; 3 &lt;\ldots\\ 1 &gt; 2 &gt; 3 &gt;\ldots $$ where "$&lt;$" and "$&gt;$" are  strict total ordering relations.  Thanks in advance for your help. How can I verify a Google authentication access token?  I need to somehow query Google and ask: Is [given access token] valid for the [example@example.com] Google account?  Short version: It's clear how an access token supplied through the  can be used to then request data from a range of Google services. It is not clear how to check if a given access token is valid for a given Google account. I'd like to know how.  Long version: I'm developing an API that uses token-based authentication. A token will be returned upon provision of a valid username+password or upon provision of a third-party token from any one of N verifiable services.  One of the third-party services will be Google, allowing a user to authenticate against my service using their Google account. This will later be extended to include Yahoo accounts, trusted OpenID providers and so on.  Schematic example of Google-based access:    The 'API' entity is under my full control. The 'public interface' entity is any web- or desktop-based app. Some public interfaces are under my control, others will not be and others still I may never even know about.  Therefore I cannot trust the token supplied to the API in step 3. This will be supplied along with the corresponding Google account email address.  I need to somehow query Google and ask: Is this access token valid for example@example.com?  In this case, example@example.com is the Google account unique identifier - the email address someone uses to log in to their Google account. This cannot be assumed to be a Gmail address - someone can have a Google account without having a Gmail account.  The Google documentation clearly states how, with an access token, data can be retrieved from a number of Google services. Nothing seems to state how you can check if a given access token is valid in the first place.  Update The token is valid for N Google services. I can't try a token against a Google service as means of verifying it as I won't know which subset of all Google's services a given user actually uses.  Furthermore, I'll never be using the Google authentication access token to access any Google services, merely as a means of verifying a supposed Google user actually is who they say they are. If there is another way of doing this I'm happy to try. reCaptcha v1 is shutting down on March 31, but SEDE still uses it According to this , I thought the new recaptcha API was used network-wide. Though today, when going to  (which for whatever reasons never recognized me automatically), I got this message instead of a usable captcha image.   V1 Unsupported Please direct siteowner to   (Doing a second try doesn't show this message anymore, and the recaptcha v1 works as intended.)  According to , the reCAPTCHA v1 API will stop working on March 31, 2018:  What happens to reCAPTCHA v1? Any calls to the v1 API will not work after March 31, 2018. Starting in November 2017, a percentage of reCAPTCHA v1 traffic will begin to show a notice informing users that the old API will soon be retired. Most websites around the world have already switched to reCAPTCHA v2, where humans pass effortlessly. With our advanced risk analysis engine, reCAPTCHA v2 can effectively separate humans from bots and always stay ahead of the attackers. If your site still uses reCAPTCHA v1, please upgrade to reCAPTCHA v2 immediately. We no longer support reCAPTCHA v1. Any calls to the v1 API will not work after March 31, 2018. Please register a new key and upgrade to v2.  I'm really hoping this will not take  to fix, because we've only got three and a half weeks left! A surjective endomorphism (of a Noetherian ring) is injective. The problem is stated as follows:  "Let $R$ be a Noetherian ring and $\theta$ be a ring homomorphism from $R$ to $R$. Show that if $\theta$ is surjective then it is also injective."  Regardless of the right solution, I don't understand why is the following wrong:     We have $\theta: R\to R$. By the isomorphism theorem $R/\ker\theta\cong\operatorname{Im}\theta$. Since $\operatorname{Im}\theta = R$, it follows $\ker\theta =0$, so it's injective.   Harsh criticism will be appreciated. Thanks. Password Reset for Users on a Multisite Subsite