My friend gave me a question. The question states:  There a $100$ people named $(1,2,3,.....,100)$ and there are $100$ doors named $(1,2,3,...,100)$ .Assume all doors are closed. The first named $1$ person comes and opens the doors which are multiples of $1$. The only functions that a person can do is open a door which is already closed or closed a door which is already open. Now the person named $2$ comes and does this function(of opening or closing) on all the doors which are multiples of 2. This process similarly takes place for $3,4,.....100$ . At the end when this completed how many doors will be left which will be open and not closed.  My thoughts in this question were that I was thinking the only doors which will be open will be the squares because:  $$\begin{array}{|c|c|}   N&amp;\text{factors}\\   4&amp;1,2,4\text(factors)\\   9&amp;1,3,9\text(factors)\\   16&amp;1,2,8,4,16\text(factors)\\   25&amp;1,5,25\text(factors)\\   36&amp;1,3,6,18,2,12,36,4,9\text(factors)\\   49&amp;1,7,49\text(factors)\\   64&amp;1,2,4,8,16,32,64\text(factors)\\   81&amp;1,3,9,27,81\text(factors)\\   100&amp;1,2,5,4,10,25,20,50,100\text(factors)\\   \end{array}$$  So as we can see when each of these numbered people will go the doors will open and be closed respectively which will end up all of the squares being open. But how do I show that these are the only numbers?  Also this seems to be a tedious way to do it and doesn't seem like this will be this tedious. So is there any way which is better than this.
I have a problem called "The Prison Problem" that I need to explain to my 9-year-old cousin. I would think that he has just started learning about divisors and perfect squares, and as such, I have a proposed solution. Any input from you guys would be welcome, as to what is the best way to go about this.  Problem:  There was a jail with 100 cells in it, all in a long row. The warden was feeling very jolly one night and told his assistant that he wanted to give all the prisoners a wonderful surprise. While they were sleeping, he wanted the assistant to unlock all the cells. This should be done, he told the assistant, by putting the key in each lock, turning it once. The assistant did this, then came back to report that the job was done. Meanwhile, however, the warden has second thoughts. "Maybe I shouldn't let all the prisoners free," he said. "Go back and leave the first cell open, but lock the second one (by putting the key in and turning it once). Then leave the third open, but lock the fourth, and continue in this way for the entire row." The assistant wasn't very surprised at this request as the warden often changed his mind. After finishing this task, the assistant returned, and again the warden had other thoughts. "Here's what I really want you to do," he said. "Go back down the row. Leave the first two cells as they are, and put your key in the third cell and turn it once. Then leave the fourth and fifth cells and turn the key in the sixth. Continue down the row this way." The assistant again did as instructed. Fortunately, the prisoners were still asleep. As a matter of fact, the assistant was getting pretty sleepy, but there was no chance for rest yet. The warden changed his mind again, and the assistant had to go back again and turn the lock in the fourth cell and in every fourth cell down the row. This continued all through the night, next turning the lock in every fifth cell, and then in every sixth, and on and on, until on the last trip, the assistant just had to turn the key in the hundredth cell. When the prisoners finally woke up, which ones could walk out of their cells?  Proposed solution:  Ten cells are left open after this process. Every cell that is a perfect square will remain open (1, 4, 9, 16, 25, 36, 49, 64, 81, and 100). If a number is not a perfect square, then it has an even number of divisors, therefore it will be "toggled" an even number of times and end up where it started (closed). Perfect squares have an odd number of divisors, so they will end up the opposite of where they started (open).
How does the unit circle work for trigonometric ratios of obtuse angles? I know that the x coordinate is $cos (\theta )$ and the y coordinate is $sin (\theta )$. But I understand these in context of only acute angles? I don't understand why the unit circle definition works for other than acute angles? Somebody please provide me some good intuition. I want to dynamically create a sequence of strings by manipulate an array of elements and create some arithmetic procedure.  for name in FIRST SECOND THIRD FOURTH FIFTH; do     $name = $(( $6 + 1 ))     $name = "${$name}q;d"     echo "${$name}"; printf "\n" done   The desire outcome would be the below for $6 equals 0.  1q;d 2q;d 3q;d 4q;d 5q;d   But I get this error  reel_first_part.sh: line 18: FIRST: command not found reel_first_part.sh: line 19: ${$name}q;d: bad substitution reel_first_part.sh: line 18: FIRST: command not found reel_first_part.sh: line 19: ${$name}q;d: bad substitution reel_first_part.sh: line 18: FIRST: command not found reel_first_part.sh: line 19: ${$name}q;d: bad substitution   I guess it's something simple. It used to work when I did something like   FIRST=$(( $6 + 1 )) FIRST="${FIRST}q;d" References in externalized pgfplots I was writing on an document with a lot of pgfplots in it. Because of the memory limitation in LaTeX and in order to save some compiling time I tried out the externalize command. With most of the plots it perfectly worked out. But when I use the \ref command, namely \ref{&lt;legendname&gt;} the legend gets lost and instead there is a ??.  I think this question in a way is similar to  and . But no answer to these questions could solve my problem. Even the use of xr and zref packages showed no effect.  Am I just missing something?    MWE of the maindocument:  \documentclass{article} \usepackage{zref-user} \usepackage{xr-hyper} \usepackage{pgfplots} \usetikzlibrary{pgfplots.groupplots} \usepgfplotslibrary{external}  \tikzexternalize \externaldocument{part1}  \begin{document} \input{part1} \end{document}     With part1.tex looking like this:  \begin{tikzpicture}     \begin{groupplot}[       group style= {  columns=3,xlabels at=edge bottom,                 y descriptions at=edge left,                 horizontal sep=2cm,group name=plots},     width=0.4\textwidth,     xtick=data,     legend columns=3]     \nextgroupplot[xlabel=site 1,legend to name=grouplegend]     \addplot coordinates {(1,20)(2,23)(3,24.5)};     \addlegendentry {AaAaA,BbBbB,CcCcC}%     \nextgroupplot[xlabel=site 2]     \addplot coordinates {(1,14)(2,16)(3,17)};     \nextgroupplot[xlabel=site 3]     \addplot coordinates {(1,10)(2,11.5)(3,12.25)};     \end{groupplot}   % Legend     \node at (plots c2r1.north) [anchor=south] {\ref{grouplegend}}; \end{tikzpicture}     I'm writing with MikTeX 2.9 and the latest updates of the packages used. For compiling I used the command pdflatex -enable-write18 &lt;file name&gt;.  I hope the MWE is short enough ;) and some knows how to solve this problem. Prove that for any prime p, there is a complete set of mod p residues {q1, . . . , qp}, where each qi is prime. I used the theorem {a, a+n, a+ 2n, . . .} contains infinitely many primes if gcd(a, n) = 1 but haven't got much progress. Any comment will be helpful! Opening the menu and selecting an item from the "Favorite Sites" menu allows us to see a feed for a specific site. In the top right corner of this page is a drop-down which allows us to select the "sort order" for the posts. The default is "Active" with other options like "Newest", "Hot", etc.  The problem is that when I select "Newest" or any other option. This preference is not remembered when I change between a different "Favorite Site".  So I am requesting that the selection is persisted when changing between site feeds. I have no preference whether this is implemented per site (to allow a different default for each site) or just one single preferred default that works on all sites (last option selected). I just want it to remember that I have selected "Newest" when I am flicking though the sites. How do I call one constructor from another in Java? How can the speed of sound increase with an increase in temperature? A particular big Delta I would like to insert the below mathematical symbol, it looks like a big Delta but different. Is there command to obtain a similar shape? How can I stop being prompted to unlock the 'default' keyring on boot? Whenever Ubuntu boots up, a dialogue pops up asking me to unlock my default keyring. Is there some way this can unlock automatically through PAM or some other magical way? How to install pip for python 3 in ubuntu 12.04 LTS How to delete directories with path/names too long for normal delete Windows seems to have a length limit on file names when trying to delete, though it won't prevent those files from being created.  Our build process creates a number of temporary files (many build off of a WSDL) that run afoul of this limit.  Our ant script is somehow able to delete them when doing a clean, but sometimes I need to delete the workarea directory (where all the temp files go) without actually doing a full clean from ant.  This is the same errors , but the answers there don't really work for me as I'm dealing with a directory, not a file, and I don't always know what specific files or subdirectories are causing the problem.  And I'm trying to avoid any manual process (other than triggering a single command) to actually delete them.  If I try deleting the directory from Explorer I get the error   Cannot delete [file name]: The file name you specified is not valid or too long.   Specify a different file name   Trying Remove-Item in powershell gives the following error:  Remove-Item : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. At line:1 char:12 + Remove-Item  &lt;&lt;&lt;&lt; -force -Recurse &lt;directory&gt;   Does anyone know of any tools or easy ways to get around this delete error without having to manually find the problem files and move/rename them? Do lightsabers have safety settings? While rewatching Star Wars my skin was crawling while watching Luke practice saber technique against a remote on the Falcon.  There's no way I'd want to be in the same room with a beginner waving a lightsaber around, let alone a beginner with his eyes covered.  Samurai apparently practiced with  to reduce training injuries.  Do lightsabers have lower power settings so that a wrong move while practicing doesn't sever a limb or chop through the hull into vacuum? Showing that a sequence is monotone and thus convergent Here's the original question:     Let $(a_n)$ be bounded. Assume that $a_{n+1} \ge a_{n} - 2^{-n}$. Show   that $(a_n)$ is convergent.   Okay, I know that if I can show that if the sequence is monotone, I can conclude that it is convergent. But I am not sure how to show that it is monotone.  I know that  $$a_n \le a_{n+1} + \frac{1}{2^n} &lt; a_{n+1} + \frac{1}{n}$$  It looks to me as if it is monotonically increasing but I'm quite not sure how to prove my claim. Any hints would be appreciated. Clicking on a spoiler tag to reveal the text shouldn't navigate you to another page This is an issue I noticed when reading . On multiple occasions I ended up inadvertently clicking a link that I could not see when I was just trying to reveal the spoiler text.         Can links be deactivated in spoilers until the text is revealed?  (Edit: this issue seems particularly to apply to those using touch screen devices with the "full site" theme) How to limit Docker total resources? I'm trying to limit the total resources accessible from docker (for example only 90% of the RAM and 1500% of the CPU). I cannot use CPU and RAM limit when I'm launching my containers, that's why I need to limit the total resources available for docker containers.  I have around 20 containers which can consume the maximum CPU and memory but not at the same time, so I cannot set the CPU and RAM limit, that's why I need to limit the total resource used by docker  First of all I've created a slice: I tried the instruction above, but impossible to limit both the RAM and the CPU usage  # /etc/systemd/system/docker_limit.slice [Unit] Description=Slice that limits docker resources Before=slices.target  [Slice] CPUAccounting=true CPUQuota=700% #Memory Management MemoryAccounting=true MemoryHigh=20G MemoryMax=25G MemoryMaxSwap=10G   And my daemon.json  {   "insecure-registries" : [ "url1", "url2"],   "cgroup-parent": "docker_limit.slice" }   But when I try from a container:  stress --vm-bytes $(awk '/MemAvailable/{printf "%d\n", $2 * 0.9;}' &lt; /proc/meminfo)k --vm-keep -m 1   I can see from docker stats it's using 111Go of Ram (full capacity of my server)  stress --cpu 16   I can see from docker stats it's using near 1600 % (full capacity of my server)  I think I've missed something but I don't know what Why do the directories /home, /usr, /var, etc. all have the same inode number (2)? What's a concise way to check that environment variables are set in a Unix shell script? I've got a few Unix shell scripts where I need to check that certain environment variables are set before I start doing stuff, so I do this sort of thing:  if [ -z "$STATE" ]; then     echo "Need to set STATE"     exit 1 fi    if [ -z "$DEST" ]; then     echo "Need to set DEST"     exit 1 fi   which is a lot of typing. Is there a more elegant idiom for checking that a set of environment variables is set?  EDIT: I should mention that these variables have no meaningful default value - the script should error out if any are unset. I am coding a small Python module composed of two parts:   some functions defining a public interface, an implementation class used by the above functions, but which is not meaningful outside the module.   At first, I decided to "hide" this implementation class by defining it inside the function using it, but this hampers readability and cannot be used if multiple functions reuse the same class.  So, in addition to comments and docstrings, is there a mechanism to mark a class as "private" or "internal"? I am aware of the underscore mechanism, but as I understand it it only applies to variables, function and methods name. What Does it Really Mean to Have Different Kinds of Infinities? A logic puzzle involving a balance. Possible Duplicate:          You have 12 balls and you know that they all weigh the same except for 1 which is heavier or lighter than all the others (you don't know which though). How can you make sure you know which ball is the heaviest/lightest in only 3 weighings?  The way I approached it was to split up the 12 balls into three sets of 4 and weigh two of the sets. If the sets balanced the scale, then I know the ball I am looking for must be in the set of 4 balls not weighed, else, I disregard said set and arbitrarily choose the heaviest set of 4 (as opposed to choosing the lightest set). I split the heaviest set of 4 balls into 2 and weigh that... etc.  Repeating this process until all 3 tries have been "used up", even if everything just so happened to be in your favor (the arbitrary choice you have in choosing the heaviest or lightest set happens to be the correct choice) in the end you still end up having to choose between 2 balls. A 50% chance is good, but I am wondering, is there a way to make sure 100%?