## Friday, January 30, 2009

### Fellow blogger.com mathematicians...

If you stumble upon this page in the hopes of finding a way to add LaTeX capabilities to your blogger/blogspot posts, today is your lucky day. Well, your lucky day could have been back in March 2007 when wolverineX02 wrote his "LaTeX for blogger" script, but I have added the ability to UNDO the translated LaTeX code. Now if you wish to revise a formula, you don't have to wade through a lot of URL translation codes/rewrite your whole formula.

This script requires Firefox and the greasemonkey extension, both of which I highly recommend. http://userscripts.org/scripts/show/41481
The only thing different from normal is that math must be enclosed in two dollars signs on each side instead of the one you're used to in your TeX compilers. \$\$\LaTeX\$\$ becomes $\LaTeX$ :)

### Interesting occurrence with 7th root of unity

PDF of this post
I've come across a property of $i\sqrt{7}$ that is rather interesting. Letting $\omega = e^{\frac{2\pi i}{7}}$, we let $\eta = \omega + \omega^2 + \omega^4$, we will see that $\eta - \overline{\eta} = i\sqrt{7}$.

Instead of working directly with this difference, we square the expression for something more easily manipulated. $(\eta - \overline{\eta})^2 = \eta^2 - \eta\overline{\eta} + \overline{\eta}^2 = (\omega^2 + 2 \omega^3 + \omega^4 + 2 \omega^5 + 2 \omega^6 + \omega^8) + (\omega^{-2} + 2 \omega^{-3} + \omega^{-4} + 2 \omega^{-5} + 2 \omega^{-6} + \omega^{-8}) - 2(\omega \omega^{-1} + \omega^2 \omega^{-1} + \omega^4 \omega^{-1} + \omega \omega^{-2} + \omega^2 \omega^{-2} + \omega^4 \omega^{-2} + \omega \omega^{-4} + \omega^2 \omega^{-4} + \omega^4 \omega^{-4})$. Using the equalities $\omega^{-1} = \omega^6$, $\omega^{-2} = \omega^5$ etc., we can simplify this down to $\omega + \omega^2 + \omega^3 + \omega^4 + \omega^5 + \omega^6 - 6$. Since the sum of the 7th roots of unity equals 0 and the sum only neglects the root $\omega^7 = 1$, we see that $(\eta - \overline{\eta})^2 = -7$. Thus $\eta - \overline{\eta} = i\sqrt{7}$. Amazing stuff, right?

## Thursday, January 8, 2009

### A bash script I wrote and love

I, like many Linux geeks before me, love to use the terminal for just about everything. However when I need to use programs with GUIs (Firefox, amarok, okular, etc), I wanted to execute them silently and to get them to return focus to the terminal. Normally if you type
``\$ firefox``

You get a bunch of X and Gtk warnings during execution of Firefox, and you can't use that shell anymore. You have to open another tab in konsole. So, this script I wrote is called "sex" for "silent execute." Mainly for the brevity and the humor of having
``\$ sex dolphin``

be a valid command. This script also allows parameters to be sent correctly to an executable, so
``\$ sex okular A\ document\ with\ spaces.pdf``

opens "A document with spaces.pdf" in okular correctly.
``#!/bin/shCONCAT="\${1}"; shiftfor ARG in "\$@"; do  CONCAT="\${CONCAT} \"\${ARG}\""doneeval "\$CONCAT >> /dev/null 2>&1 &"``

Simply put this in /usr/bin/sex (need root) and do a chmod +x /usr/bin/sex. I recommend adding
``alias ff='sex firefox'``