A friend asks me to find the number of digits of $2^{1000}$. I tried to look for a pattern by calculating the first powers of $2$ but I didn't find it. How should I proceed? Thanks.
I tried this way, I only need to know if this is correct or if there are better ways to solve this:  $2^{1000}$ does not have a factor of $5$ obviously therefore we can assume  $$ 10^{m} &lt; 2^{1000} &lt; 10^{m+1}$$ for some  $m$   Assume $ k = 2^{1000}$, then take log on both sides $\log k = 1000  \log 2 \approx 301.02999 &gt; 301$  Therefore $2^{1000}$ has $302$ digits.
I deleted the "/etc/passwd" file and cannot log in I was trying to change my username and also my home directory (/home/username) and my system started to crash. I deleted the passwd file but I had a backup named passwd_bkp. I tried to rename this passwd_bkp as passwd and it did not work. No commands were being executed... I was in a terminal window.   I restarted my system and now I cannot log in. GRUB gives two options: Linux and recovery mode.   I tried to open a sessions as root but it says the filesystem is corrupted. I cannot access my files.  Did I lose all my files? My (very simple) question to a friend was how do I prove the following using basic trig principles:  $\tan75^\circ = 2 + \sqrt{3}$  He gave this proof (via a text message!)  $1. \tan75^\circ$   $2. = \tan(60^\circ + (30/2)^\circ)$  $3. = (\tan60^\circ + \tan(30/2)^\circ) / (1 - \tan60^\circ \tan(30/2)^\circ) $  $4. \tan (30/2)^\circ = \dfrac{(1 - \cos30^\circ)}{ \sin30^\circ}$    Can this be explained more succinctly as I'm new to trigonometry and a little lost after (2.) ?    EDIT  Using the answers given I'm almost there:   $\tan75^\circ$    $\tan(45^\circ + 30^\circ)$   $\sin(45^\circ + 30^\circ) / \cos(45^\circ + 30^\circ)$   $(\sin30^\circ.\cos45^\circ + \sin45^\circ.\cos30^\circ) / (\cos30^\circ.\cos45^\circ - \sin45^\circ.\sin30^\circ)$    $\dfrac{(1/2\sqrt{2}) + (3/2\sqrt{2})}{(3/2\sqrt{2}) - (1/2\sqrt{2})}$   $\dfrac{(1 + \sqrt{3})}{(\sqrt{3}) - 1}$   multiply throughout by $(\sqrt{3}) + 1)$   Another alternative approach:   $\tan75^\circ$    $\tan(45^\circ + 30^\circ)$   $\dfrac{\tan45^\circ + \tan30^\circ}{1-\tan45^\circ.\tan30^\circ}$   $\dfrac{1 + 1/\sqrt{3}}{1-1/\sqrt{3}}$   at point 6 in above alternative Calculate the limit including binomial coefficients I try to write a simple Markdown parser in JavaScript. Therefore I want to check for the [link content][link id] syntax. I use the following code:  data = data.replace( /\[(.*?)\][ ]*\[([0-9]+)\]/g, '&lt;a href="$2"&gt;$1&lt;/a&gt;' );   It works well, but now I want to do this with a RegExp object. So I set up the following bit of code:  var r = new RegExp( '\[(.*?)\][ ]*\[([0-9]+)\]', 'g' ); data = data.replace( r, '&lt;a href="$2"&gt;$1&lt;/a&gt;' );   But it doesn't work. It even says that my regular expression (which works since the first example does a good job) is invalid:     unmatched ) in regular expression   I think it must have to do with some RegExp-object peculiarities I am not aware of. What am I doing wrong and how can the problem be solved? Stopping Dwarf Fortress from auto-pausing Is it possible to prevent DF from pausing every time something comes up (liking hitting gold or whatever). The reason is that I am doing extensive mining and I want to leave the process unattended till it is over. Delete specific line number(s) from a text file using sed? Best way to make a shutdown hook? Since Ubuntu relies on upstart for some time now, I would like to use an upstart job to gracefully shutdown certain applications on system shutdown or reboot. It is essential that the system's shutdown or reboot is stalled until these applications are shut down.  The applications will be started manually on occasion, and on system shutdown should automatically be ended by a script (which I already have). Since the applications can't be ended reliably without (nearly all) other services running, ending the applications has to be done before the rest of the shutdown begins.  I think I can solve this by an upstart job which will be triggered on shutdown, but I am unsure which events I should use in which manner. So far, I have read the following (partly contradicting) statements:   There is no general shutdown event in upstart Use a stanza like start on starting shutdown in the job definition Use a stanza like start on runlevel [06S] in the job definition Use a stanza like start on starting runlevel [06S] in the job definition Use a stanza like start on stopping runlevel [!06S] in the job definition   From these recommendations, the following questions arise:   Is there or is there not a general shutdown event in Ubuntu's upstart? What is the recommended way to implement a "shutdown hook"? When are the events runlevel [x] triggered; is this when having entered the runlevel or when entering the runlevel? Can we use something like start on starting runlevel [x] or start on stopping runlevel [x]? What would be the best solution for my problem?   Thank you very much mysql select distinct rows into a comma delimited list column Does a critical hit from an expanded crit range always hit regardless of AC? This question is in respect to the Champion's increased critical hit range.  On a roll of 18 or 19 (when this class feature becomes available), is the attack automatically a hit as it would be with a 20? Maintaining the final state at end of a CSS3 animation I was using , implemented in scikit-learn, for my research work. But I have no good understanding of this.   Can anyone please give a simple, good explanation of one class SVM? Let $R$ be a Artinian commutative ring with $1 \neq 0$. If $I$ is prime, then $I$ is maximal. Prove: Let $R$ a Artinian commutative ring with $1 \neq 0$. If $I$ is prime, then $I$ is maximal.     I got stuck on this. I understand that every ideal is generated by finitely many elements. Here is my approach:  It's enough to prove the following implication: $$ R/I \ \text{is a domain} \quad \Rightarrow \quad R/I \ \text{is a field}$$ Then only finding an inverse is left. So let $x \in R$ in arbitrary. We have to find an inverse element of $x+I \in R/I$, that as an element y so that $x \cdot y \in I+1$. We denote $I = (x_1, x_2, \cdots, x_n)$.  Now I have to find y so that $xy -1 = r_1 x_1+ r_2 x_2 + \cdots + r_n x_n$. This is where I no more knew what to do.   Your advise will be appreciated. SharePoint Migration 2007 to 2013 Attribution alignment and order should be consistent with the website I need to add a specific column if it does not exist. I have something like the following, but it always returns false:  IF EXISTS(SELECT *           FROM   INFORMATION_SCHEMA.COLUMNS           WHERE  TABLE_NAME = 'myTableName'                  AND COLUMN_NAME = 'myColumnName')    How can I check if a column exists in a table of the SQL Server database? I'm really new to Mac OSX and UNIX based systems. I wanted to run a few Windows games on my Mac Mini so I started installing Wine and MacPorts. I think the installs are correct, but when I type sudo port install wine I see a not found error in my terminal. I tried other basic commands like say and clear and all of them return the same not found error. My research shows that my PATH might be incorrectly set, but it lacks steps I can implement. Specifically, I ran this command: echo $PATH and it returned:  /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin  I'm a complete newbie to mac and have no idea where .bash_profile or any of those files are. My skills let me install Xcode and the Command Line tools for Xcode and I sense I need to level up on path management. At this point I need help managing my dot files and changing my path to fix these specific errors on Mountain Lion. What are my next steps? 'const int' vs. 'int const' as function parameters in C++ and C Consider:  int testfunc1 (const int a) {   return a; }  int testfunc2 (int const a) {   return a; }   Are these two functions the same in every aspect or is there a difference?  I'm interested in an answer for the C language, but if there is something interesting in the C++ language, I'd like to know as well. Alternative ways to say "if and only if"? There are some scenarios about which I would like to get some confirmation:   when defining a concept A,      We call A, if ... [definition of   concept A]   Does "if" here mean equivalence instead of just sufficiency? Is it incorrect to replace "if" with "if and only if"?    For precisely what condition is    B satisfied?   Does "precisely" mean asking for necessary and sufficient condition for B? Some other ways to say "if and only if" / "necessary and sufficient"?   Some references that summarize some standard terminologies in Mathematics  such as this one?  Thanks and regards! Proving that a normal, abelian subgroup of G is in the center of G if |G/N| and |Aut(N)| are relatively prime. How to associate multimedia keys to Foobar2000?