The following is a Combinatorial proof of Fermat's Little Theorem from Arthur Engel's book:Problem Solving Strategies.  We have pearls with $a$ colors. From these we make necklaces with exactly $p$ pearls. First, we make a string of pearls. There are $a^p$ different strings. If we throw away the a one-colored strings $a^p − a$ strings will remain. We connect the ends of each string to get necklaces. We find that two strings that differ only by a cyclic permutation of its pearls result in indistinguishable necklaces. But there are $p$ cyclic permutations of p pearls on a string. Hence the number of distinct necklaces is $(a^p − a)/p$. Because of its interpretation this is an integer. So $$p | (a^p − a)$$.  I can't figure out how the primality of $p$ is utilised in this proof. Please Explain.
I came across a combinatorial proof of the Fermat's Little Theorem which states that    If $p$ is a prime number then the number ($a$$p$-$a$) is a multiple of $p$ for any natural number $a$.  Let me write down the proof.    PROOF  We have pearls of $a$ colours . From these we make necklaces of exactly $p$ pearls .   First,we make a string of pearls . There are $a$$p$ different strings.If we throw away  the $a$ one one -coloured pearls  ($a$$p$-$a$) strings will remain.We connect the ends of each string to get necklaces.We find that two strings that differ only by a cyclic permutation of its pearls result in indistinguishable necklaces.But there are $p$ cyclic permutations of $p$ pearls on a string . Hence the number of distinct necklaces is    [($a$$p$-$a$)/$p$].  Because of this interpretation this is an integer.Thus ($a$$p$-$a$) is a multiple of $p$ for any natural number $a$. [HENCE PROVED]     MY CONFUSIONS    What is the use of the fact that $p$ is a prime in this proof?  If this proof is true then why is this not true for every positve integer $p$?
How do I prove that $m(TE)=\left|\det(T)\right|m(E)$? Let $m$ be the $n$-dimensional Lebesgue measure and $T$ be a linear operator on $\mathbb{R}^n$. Let $\Sigma$ be the sigma-algebra of Lebesgue measurable sets. How do prove that (1) $\forall E\in\Sigma, T(E)\in \Sigma$ and $m(T(E))=\left|\det(T)\right|m(E)|$? Since the $\sigma$-algebra of Lebesgue measurable sets is strictly larger than the borel algebra, I think it cannot be proven by showing that $T$ is continuous. How do I prove this formally? I have a script from UC Davis and every thing is proven precisely here, except for one lemma which is critical for rest proofs in the script. That is,  Define $\mathbb{B}=\big\{\prod_{i=1}^n [a_i,b_i) : a_i,b_i\in\mathbb{R}\big\}$. Let $T$ be a unitary operator on $\mathbb{R}^n$. Let $A\in \mathbb{B}$ and $\{A_k\}_{1≦k≦m}$ be a finite disjoint sequence such that $\bigcup_{1≦k≦m} A_k \subset T(A)$. Then $\sum_{1≦k≦m} m(A_k) ≦ m(A)$.  It's written in the script: &quot;This result is geometrically obvious, but a formal proof seems to require a fuller discussion of the volume function on elementary geometrical sets, which is included in the theory of valuation in convex geometry. We omit the details&quot; It's okay to me to go through full discussion of volume function if that is precise. If it cannot be proven another easier way(so I can prove it in a day), please recommend me a &quot;convex geometry&quot; text which explains this. Does $\sum_{m=1}^{\infty}\sum_{n=1}^{\infty}a_{mn}^3=\sum_{n=1}^{\infty}\sum_{m=1}^{\infty}a_{mn}^3$ occur here? Let $\{a_{mn}\},~m,n \in \Bbb{N}$, be an arbitrary double sequence of real numbers then does the following equality occur always?   $$\sum_{m=1}^{\infty}\sum_{n=1}^{\infty}a_{mn}^3=\sum_{n=1}^{\infty}\sum_{m=1}^{\infty}a_{mn}^3$$   I think there is no reason for the equality of this iterated series in general but I cannot figure out how to construct a counter example. Can anyone please help me how to create a example of $\{a_{mn}\}$ such that the given equality does not hold...!! See question when answering In the middle of touching up a new texture, I pressed save and suddenly my textures all turned black on the model and UV texture - just vanished.  I tried reopening the file in another instance of Blender, I tried to CtrlZ too and it just did this weird patchy thing on my texture.   How do I recover it and what did I do wrong? HDMI to VGA convert I just bought a new HP Pavilion dv7t Quad Edition laptop that has HDMI out. I already have a couple of monitors that are VGA and I'd like to hook up one of these to dual monitors.  I've read some sketchy reviews of products that try to convert directly from HDMI (digital) to  VGA (analog), so I was wondering if someone has a good recommendation on how to hook these two together. How to make a jquery click event fire only on first click I only read part of the second book in this series years ago, and am unsure of how many books were in it. It was about a teenage or young adult boy, who was part of the ruling class of this fantasy world. He was gay, and his lover was the heir to the throne. The antagonist of the first book - I haven't read it, but I got the gist from comments in the second - was the current queen, who tricked the boy and his lover into leaving the kingdom for remote outer regions, thus enabling her son to take the throne. She then married her own son to keep herself in power.  The second book had the boy and his lover slowly becoming enemies, as the lover began to corrupt the simple tribesmen they were sheltering with in his quest to regain his throne. He wanted to build an empire in the hinterland and use the army to attack his homeland, killing the queen in the process, and didn't care about the long-term effects his actions were having on the culture or environment of his new followers.   The lover defeats a tribesman by breaking his neck in unarmed combat, then later takes a young boy as his "willing catamite." He also leads raids on neighbouring tribes, establishes alliances with other neighbouring tribes and organises daring and successful raids on the eggs of dinosaurs living in the middle of a swamp. He enslaves the first tribe to turn against him, and gives their children to slavers from the empire in place of those of allied tribes, thus weakening his enemies while ensuring the loyalty of his allies.  The series involved dinosaurs living among humans, being both domesticated and wild, used as livestock, for hunting and as transport. The boy and his lover were much taller than the average humans who were forced to pay tribute to this pseudo-magical empire they came from; all the humans from the empire were much larger than their subjects. The tribesmen have a tradition about not touching the ground with bare feet, as it is an insult to nature, or their god. The boy and his lover both ignore this superstition, but the catamite also begins to ignore it, despite looking ashamed as he does so.  I have absolutely no idea when this series was written, what it is called or who wrote it. All I know is that I read it in 2005-06, though it probably wasn't new. I'm hoping the long description I've given will help someone work it out. Indentation of continued lines in algorithmicx Trying to get the indentation right within the algorithmic environment I run into trouble, and all the solutions posted so far have not been able to solve my problem as I'd like to see it solved.  I want continued lines to have an indentation w.r.t the initial line (new to this forum and yet unable to post images).  However, the best I get with what I've found on this forum is either a fixed indentation for all continued lines (i.e., no difference if the initial line was indented or not), or the same indentation as the initial line (see MWE below).  Anybody has an answer to this?  \documentclass[10pt, A4]{report} \usepackage{algorithm} \usepackage{algpseudocode}  \begin{document}  \begin{algorithmic}\raggedright  \State Define N\_crf as the number of points on the circumference of the hyperstreamline, which will define its cross-sectional area at each r  \For {n = 1 : number of tracts}  \State \parbox[t]{\dimexpr\linewidth-\algorithmicindent\relax}{define N\_crf points creating a unit circle around r(n,i), in the plane perpendicular to t(n,i).}\strut  \EndFor  \end{algorithmic}  \end{document} Where is the default folder for Apps? I am relatively new to the linux world. I use OSX at home and Windows at work. In those worlds, there is a default folder for applications (C:\Program Files, /Applications). Is there any such directory in Ubuntu?   I understand that this is not very important and any location in the file system should be ok, but was just wondering whether there are such standard locations (I think there would be one). For instance where is Firefox or Libre Office (that are installed by default)?  Got this question when I was trying to install eclipse. Downloaded the zip, and was wondering... How can I get distribution name and version number in a simple shell script? I'm working on a simple bash script that should be able to run on Ubuntu and CentOS distributions (support for Debian and Fedora/RHEL would be a plus) and I need to know the name and version of the distribution the script is running (in order to trigger specific actions, for instance the creation of repositories). So far what I've got is this:  OS=$(awk '/DISTRIB_ID=/' /etc/*-release | sed 's/DISTRIB_ID=//' | tr '[:upper:]' '[:lower:]') ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/') VERSION=$(awk '/DISTRIB_RELEASE=/' /etc/*-release | sed 's/DISTRIB_RELEASE=//' | sed 's/[.]0/./')  if [ -z "$OS" ]; then     OS=$(awk '{print $1}' /etc/*-release | tr '[:upper:]' '[:lower:]') fi  if [ -z "$VERSION" ]; then     VERSION=$(awk '{print $3}' /etc/*-release) fi  echo $OS echo $ARCH echo $VERSION   This seems to work, returning ubuntu or centos (I haven't tried others) as the release name. However, I have a feeling that there must be an easier, more reliable way of finding this out -- is that true?  It doesn't work for RedHat. /etc/redhat-release contains : Redhat Linux Entreprise release 5.5  So, the version is not the third word, you'd better use :  OS_MAJOR_VERSION=`sed -rn 's/.*([0-9])\.[0-9].*/\1/p' /etc/redhat-release` OS_MINOR_VERSION=`sed -rn 's/.*[0-9].([0-9]).*/\1/p' /etc/redhat-release` echo "RedHat/CentOS $OS_MAJOR_VERSION.$OS_MINOR_VERSION" Is there any gold standard for modeling irregularly spaced time series? Suppose I installed ubuntu with the user usr1 then I added usr2. I then create a group grp1 where this 2 users are added. A folder is owned by usr1 and has group grp1. But when I login as usr2 I cannot write. The folder has permissions 755...  usr2@kmserver:/media/data/www$ groups usr1 usr1 : grp1 ... usr2@kmserver:/media/data/www$ groups usr2 usr2 : grp1 ... usr2@kmserver:/media/data$ ls -l total 20 drwx------ 2 root root 16384 2011-05-12 10:53 lost+found drwxrwxr-x 2 grp1   grp1    4096 2011-05-12 15:15 www   Whats wrong? Footnote to a footnote How can I make a footnote to a footnote? E.g.,  Playfair's axiom\footnote{so called in honor of mathematician John Playfair, etc, etc., but was actually discovered by Proclus\footnote{Greek mathematician, etc, etc.}} PHP/MYSQL login error? I'm developing a site using Drupal 8 beta-14. I've created a view block of different terms and now I want to display it using code. How can I display it programatically?  I used to do it in Drupal 7 using this code but I'm confused about Drupal 8.  $block = module_invoke('block', 'block_view', '4'); $text_block = render($block['content']); Every time I read the tips for installing an SDK, IDE, some extension and so on, it says, that I should unpack them in /opt folder. Why do I need to do that?   When I was installing Ubuntu, I read that I should set only 10-20 GiB for the / file system and remaining space set for /home. So should I extend the space for root folder, or leave all stuff at /home? Is there any difference? This option, which was present in the "Mouse and Touchpad" settings panel in previous versions, is for some reason absent in 16.04 LTS. Does anyone know why this is, and/or how to fix it? Thanks. Different ways to prove there are infinitely many primes? This is just a curiosity. I have come across multiple proofs of the fact that there are infinitely many primes, some of them were quite trivial, but some others were really, really fancy. I'll show you what proofs I have and I'd like to know more because I think it's cool to see that something can be proved in so many different ways.  Proof 1 : Euclid's. If there are finitely many primes then $p_1 p_2 ... p_n + 1$ is coprime to all of these guys. This is the basic idea in most proofs : generate a number coprime to all previous primes.  Proof 2 : Consider the sequence $a_n = 2^{2^n} + 1$. We have that  $$ 2^{2^n}-1 = (2^{2^1} - 1) \prod_{m=1}^{n-1} (2^{2^m}+1), $$  so that for $m &lt; n$, $(2^{2^m} + 1, 2^{2^n} + 1) \, | \, (2^{2^n}-1, 2^{2^n} +1) = 1$. Since we have an infinite sequence of numbers coprime in pairs, at least one prime number must divide each one of them and they are all distinct primes, thus giving an infinity of them.  Proof 3 : (Note : I particularly like this one.) Define a topology on $\mathbb Z$ in the following way : a set $\mathscr N$ of integers is said to be open if for every $n \in \mathscr N$ there is an arithmetic progression $\mathscr A$ such that $n \in \mathscr A \subseteq \mathscr N$. This can easily be proven to define a topology on $\mathbb Z$. Note that under this topology arithmetic progressions are open and closed. Supposing there are finitely many primes, notice that this means that the set $$ \mathscr U \,\,\,\, \overset{def}{=} \,\,\, \bigcup_{p} \,\, p \mathbb Z $$ should be open and closed, but by the fundamental theorem of arithmetic, its complement in $\mathbb Z$ is the set $\{ -1, 1 \}$, which is not open, thus giving a contradiction.   Proof 4 : Let $a,b$ be coprime integers and $c &gt; 0$. There exists $x$ such that $(a+bx, c) = 1$. To see this, choose $x$ such that $a+bx \not\equiv 0 \, \mathrm{mod}$ $p_i$ for all primes $p_i$ dividing $c$. If $a \equiv 0 \, \mathrm{mod}$ $p_i$, since $a$ and $b$ are coprime, $b$ has an inverse mod $p_i$, call it $\overline{b}$. Choosing $x \equiv \overline{b} \, \mathrm{mod}$ $p_i$, you are done. If $a \not\equiv 0 \, \mathrm{mod}$ $p_i$, then choosing $x \equiv 0 \, \mathrm{mod}$ $p_i$ works fine. Find $x$ using the Chinese Remainder Theorem.   Now assuming there are finitely many primes, let $c$ be the product of all of them. Our construction generates an integer coprime to $c$, giving a contradiction to the fundamental theorem of arithmetic.  Proof 5 : Dirichlet's theorem on arithmetic progressions (just so that you not bring it up as an example...)  Do you have any other nice proofs? How can I get another application's installation path programmatically? 'help' link is located lower than the other items It shows like this on Firefox 25 and Internet Explorer 11 (minus the red line of course):    Chrome seems to be fine.