Given a board of size $1 \times n$,in how many this board can be colored with the colors white,yellow and blue assuming the number of blue cells is an even number.  My try: Given a board of size $1 \times n$,then there are two possibilities for the color of the first cell:  If the first cell is blue then the it's needed to find another cell to color it with the blue color ,this can be done in $n-1$ ways and for each one of these choices there are $b_{n-2}$ ways to color the remaining $1 \times (n-2)$ board with the colors yellow,white and blue assuming the number of blue cells is an even number.  If the first cell is yellow or white then the remaining $1 \times (n-1)$ board can be colored in $b_{n-1}$ ways assuming the restriction on the number of blue cells is satisfied.   Gathering these cases follows: $$b_n=(n-1)b_{n-2}+2b_{n-1}$$ With $b_0=1$ and $b_1=2$ as initial conditions. Calling $G(x)=\sum_{k\ge 0}^{} b_k x^k$,omitting some elementary calculations follows: \begin{align*} G(x)&amp;=\frac{-1}{\left(n+1\right)^{2}x^{2}+2x-1}\\ &amp;=\frac{-1}{\left(n+1\right)^{2}}\frac{1}{(x-a)(x-b)}\\ &amp;=\frac{1}{\left(n+1\right)^{2}(a-b)}\left(\frac{1}{a-x}-\frac{1}{b-x}\right)\\ &amp;=\frac{1}{\left(n+1\right)^{2}(a-b)}\left(\frac{1}{a}\frac{1}{1-\frac{x}{a}}-\frac{1}{b}\frac{1}{1-\frac{x}{b}}\right)\\ &amp; \end{align*} From which we conclude: \begin{align*} b_n=\left[x^{n}\right]G\left(x\right) &amp;=\frac{1}{\left(n+1\right)^{2}(a-b)}\left(\left(\frac{1}{a}\right)^{n+1}-\left(\frac{1}{b}\right)^{n+1}\right)\\ \end{align*} Where $$a=\frac{-1+\sqrt{n+2}}{n+1},b=\frac{-1-\sqrt{n+2}}{n+1}$$ But the closed form does not coincide with the recurrence that I've found.(I only want the question to be solved using recurrence relations.)
a) Determine the number of ways to colour a 1 by n grid using the colours red and white if an even number of squares are to be coloured red.   Note that n is greater than or equal to 1 and the number of red squares could be 0.  I know I must consider the cases of n being even and odd, and determine the sum, from zero to n of the squares being red, where the number of red squares is even. But I just want to make sure I haven’t missed any arrangements by saying a) is $2^{n-1}$ when n is even and $2^{n-1}-1$ when n is odd.  b) Determine the number of ways to colour the squares using red, white and blue if an even number of squares are to be coloured red.  For this case, I can have arrangements including red only, white only, blue only, white and blue only, red and white only, red and blue only, and finally all three colours.  Thank you for any help provided.
Changing permissions on serial port How can I prevent iPhoto from opening everytime I plug my iPad/iPhone? How can I prevent iPhoto/Photos/Image Capture from launching everytime I plug in my iPad/iPhone? If $a_0\in R$ is a unit, then  $\sum_{k=0}^{\infty}a_k x^k$ is a unit in $R[[x]]$ addplot3[surf] creates lines instead of a surface I have been trying to create a surface plot but I am unable to get it to work. Any help would be greatly appreciated. I've tried using surf which only produces lines instead of a surface (Fig. 1). Note: Although I was originally able to produce output, thesurf plot no longer compiles: "Package tikz Error". I've tried compiling with both pdflatex and lualatex with -shell-escape flag.    Figure 1  I also tried to use the patch style plot. This produces gibberish (Fig. 2)    Figure 2  MWE:  \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{external} \usepgfplotslibrary{patchplots} \tikzexternalize  \begin{document} \begin{figure}[t]   \centering    \tikzsetnextfilename{surface_plot}   \begin{tikzpicture}     \begin{axis} [       height=12cm,       width=15cm,       grid=major,       grid style={dotted},       colormap/jet,       mesh/ordering=x varies     ]       %\addplot3[patch,patch type=biquadratic,shader=faceted interp,patch refines=3] coordinates {       \addplot3[surf] coordinates {  (-6,-6,446.788)  (-5,-6,423.361)  (-4,-6,413.264)  (-3,-6,402.349)  (-2,-6,388.948)  (-1,-6,391.747)  (0,-6,386.874)  (1,-6,423.778)  (2,-6, 439.19)  (3,-6,449.074)  (4,-6,462.155)  (5,-6,484.399)  (6,-6,505.412) (-6,-5, 423.48)  (-5,-5,392.382)  (-4,-5,406.696)  (-3,-5,392.592)  (-2,-5,371.158)  (-1,-5,384.142)  (0,-5,394.666)  (1,-5,408.105)  (2,-5, 422.51)  (3,-5,420.173)  (4,-5,445.816)  (5,-5,464.731)  (6,-5,485.349) (-6,-4,402.646)  (-5,-4,371.879)  (-4,-4,376.239)  (-3,-4,396.874)  (-2,-4,382.761)  (-1,-4,386.665)  (0,-4,397.148)  (1,-4,410.875)  (2,-4,425.998)  (3,-4,385.143)  (4,-4,420.458)  (5,-4,438.432)  (6,-4,    458) (-6,-3,423.219)  (-5,-3,370.582)  (-4,-3,464.786)  (-3,-3,443.921)  (-2,-3,425.196)  (-1,-3,427.138)  (0,-3,438.002)  (1,-3, 453.97)  (2,-3,473.021)  (3,-3,418.583)  (4,-3,435.887)  (5,-3,414.993)  (6,-3,475.148) (-6,-2,401.995)  (-5,-2,385.612)  (-4,-2,438.956)  (-3,-2,418.583)  (-2,-2,400.093)  (-1,-2,400.773)  (0,-2, 410.58)  (1,-2,426.024)  (2,-2, 444.92)  (3,-2,397.131)  (4,-2,413.739)  (5,-2,431.741)  (6,-2,451.267) (-6,-1,382.978)  (-5,-1,335.274)  (-4,-1,416.598)  (-3,-1,396.718)  (-2,-1,378.348)  (-1,-1,377.455)  (0,-1,32.0089)  (1,-1,400.683)  (2,-1,419.918)  (3,-1,377.371)  (4,-1,393.286)  (5,-1,374.648)  (6,-1,429.077) (-6, 0,365.902)  (-5, 0,350.965)  (-4, 0,397.527)  (-3, 0, 378.36)  (-2, 0,360.454)  (-1, 0,358.447)  (0, 0,    363)  (1, 0,381.147)  (2, 0,401.177)  (3, 0,362.155)  (4, 0,378.174)  (5, 0,395.513)  (6, 0, 414.34) (-6, 1,372.511)  (-5, 1,326.945)  (-4, 1,407.215)  (-3, 1,388.646)  (-2, 1,371.945)  (-1, 1,371.003)  (0, 1,380.027)  (1, 1,396.414)  (2, 1,416.602)  (3, 1,374.897)  (4, 1,391.276)  (5, 1, 373.32)  (6, 1,428.284) (-6, 2,391.149)  (-5, 2,376.191)  (-4, 2,406.941)  (-3, 2,369.633)  (-2, 2,393.583)  (-1, 2,394.184)  (0, 2,404.263)  (1, 2,420.588)  (2, 2,  440.5)  (3, 2,416.631)  (4, 2,374.948)  (5, 2,391.855)  (6, 2,418.511) (-6, 3,375.967)  (-5, 3,361.698)  (-4, 3,357.421)  (-3, 3,368.273)  (-2, 3,377.106)  (-1, 3,378.664)  (0, 3,369.175)  (1, 3, 382.42)  (2, 3,397.821)  (3, 3,377.942)  (4, 3,384.944)  (5, 3,387.862)  (6, 3,424.429) (-6, 4,396.478)  (-5, 4,381.554)  (-4, 4,376.162)  (-3, 4,388.843)  (-2, 4,375.881)  (-1, 4,378.384)  (0, 4, 355.14)  (1, 4,403.654)  (2, 4,419.779)  (3, 4,398.599)  (4, 4,407.113)  (5, 4,426.715)  (6, 4,448.245) (-6, 5,409.364)  (-5, 5,380.492)  (-4, 5,387.843)  (-3, 5,360.034)  (-2, 5, 362.23)  (-1, 5,364.909)  (0, 5,358.321)  (1, 5,363.226)  (2, 5,379.325)  (3, 5,397.152)  (4, 5,410.086)  (5, 5,433.909)  (6, 5,460.548) (-6, 6, 423.99)  (-5, 6,408.967)  (-4, 6,400.475)  (-3, 6,372.922)  (-2, 6,371.116)  (-1, 6, 373.92)  (0, 6,384.778)  (1, 6,  398.8)  (2, 6, 415.62)  (3, 6,420.127)  (4, 6,436.064)  (5, 6,461.957)  (6, 6,491.123)        };     \end{axis}   \end{tikzpicture}      \end{figure} \end{document}   Thank you so much. When/Why Did Love Escape Voldemort? We know that Voldemort does not love. He does not understand it, nor (generally) the magic that it possesses. He knows  of the sort.  [...] &quot;you possess in such quantities and which Voldemort has not at all.&quot; [...] &quot;because he could not bear to reside in a body so full of the force he detests. In the end, it mattered not that you could not close your mind. It was your heart that saved you.&quot; (Harry Potter and the Order of the Phoenix, page 1075)  The above confirms it (although I believe there is a better quote), though  reinforces it. The fact that he hugs so awkwardly shows that he does not really know how, due to his lack of love. I realize that Voldemort's appearance started to change after he started to create Horcruxes, but surely he had an ounce of love when he was a child? The hugging scene perhaps shows that he never once loved his whole life (possibly due to the love potion with his parents?). If so, when did Voldemort begin to have no love at all, and why? I'm having some trouble updating a row in a MySQL database. Here is the code I'm trying to run:  import MySQLdb  conn=MySQLdb.connect(host="localhost", user="root", passwd="pass", db="dbname") cursor=conn.cursor()  cursor.execute("UPDATE compinfo SET Co_num=4 WHERE ID=100") cursor.execute("SELECT Co_num FROM compinfo WHERE ID=100") results = cursor.fetchall()  for row in results:     print row[0]  print "Number of rows updated: %d" % cursor.rowcount  cursor.close() conn.close()   The output I get when I run this program is:     4Number of rows updated: 1   It seems like it's working but if I query the database from the MySQL command line interface (CLI) I find that it was not updated at all. However, if from the CLI I enter UPDATE compinfo SET Co_num=4 WHERE ID=100; the database is updated as expected.  What is my problem? I'm running Python 2.5.2 with MySQL 5.1.30 on a Windows box. Setting up a download page requiring a user to fill a form before downloading anything In the Drupal site I'm setting up, there's a Download page containing several links to download softwares.   What is the best way to "bind" the softwares to the page, put them anywhere online and place a direct link in the page?   Does anyone know a module that would show a contact form when a user clicks one of the "Download" buttons, preventing him from downloading unless he properly completes the form?  Our goal is to receive the contact information of any person downloading our software. How loud/obvious is a wizard casting a spell? Some spells have somatic and vocal components, that's well known.  How loud must a wizard talk? How obvious/wide should his gestures be?  Some spells that would be awesome would be fairly limited if you need to shout them (ex: mage hand, range 30ft). How can I correct this code to get an answer? Mixing tenses in past tense fiction "need not to be neither atomic nor ordered" Is this double/triple negative grammatically sound?  Ordered operations require that space on disk is allocated sequentially, so spatial ordering corresponds to chronology of operations, but actual disk writes need not to be neither atomic nor ordered.   Explanation:   Words neither and nor emphasize on the fact that both conditions are (independently) allowed to remain unsatisfied, that both are optional. To be more formal, "need not be atomic and need not be ordered". But then again, it becomes a concoction of two negations joined by a conjunction. Making a log4j console appender use different colors for different threads I can describe "IMHO" as an acronym for "in my humble opinion."  How can I describe the reverse processes of translating the acronym into the actual phrase?  That is to say, if "IMHO" is the acronym, what do we call "in my humble opinion"? File Upload using Selenium WebDriver and Java Robot Class Using induction to prove that $\sum_{r=1}^n r\cdot r! =(n+1)! -1$ Use induction to prove that    $\displaystyle\sum_{r=1}^n r\cdot r! =(n+1)! -1$   I first showed that the formula holds true for $n=1$.  Then I put n as $k$ and got an expression for the sum in terms of $k$.  I then found the sum till the $(k+1)$th term by adding the $(k+1)$th term to both sides of the equation and compared it to the sum expression I get by plugging $k+1$ into the sum expression given in the question - they don't match. Why is FIFA against adding instant replay to the game? Is there any evidence or reason why FIFA is so against adding instant replay to soccer? I find myself seeing many unlucky or just plain wrong decisions made by refs that could be corrected with instant replay. set fontsize for TikZ figure Which are safe and unsafe regions in Iran? Now there's a lot of propaganda in the west that leads us to believe Iran is dangerous and travellers shouldn't go there.  Obviously there are major political disagreements between several governments and the Iranian government and this should be taken into account.  But at a human level I have met many Iranians travelling elsewhere in the world and have found them to be friendly, charming, and hospitable. I have also met several western travellers who spent time in Iran, including hitchhiking around the country, who only have wonderful things to say about the country and its people.  As a traveller I've learned to trust the most what I hear from other travellers about a destination, especially ones which prefer similar ways of travel to myself. I've also learned to trust the opinions of inhabitants of countries bordering on the destination country the least.  Yet some people still insist that Iran is not safe for a traveller, or that .  I can look up for myself the general travel advisories issued by governments and disclaimers in WikiVoyage. So please don't regurgitate those an answers.  I want to know from travellers who've been there, from Iranians, or from references to specific incidents targeting foreigners/westers about which parts of Iran are no problem, and which parts should be avoided, even by experienced intrepid travellers.  (I realize any advice won't apply to Israeli citizens unfortunately. I'm Australian.) Connecting two relative clauses in one sentence I would like to write an essay which gives information about the charts but because I am not native English speaker, when I started to write down my essay I came across the similar problems that I do sometimes.  Here my sentence:  Figure 1 and figure 2 show the percentage of people, WHOSE age is between 25-44 and over 65, WHO purchased concert, cinema and theater tickets online over the first three months of 2006 in three countries, WHICH are Australia, the UK, Malaysia.  Here is my questions:  1.How can I give the information of age and of what do people buy in one sentence?  2.Such vital and important information on the figures can be used as indefinite relative clause? Let $(a_n)$ be a sequence of positive terms and suppose that $\sum_\limits{n=0}^{\infty} a_n$ converges. Show that $\sum_\limits{n=0}^{\infty} a_n^2$ converges.   This is in the section on the Comparison Test so that must be what I'm supposed to use.  But I don't see how.  $(a_n)^2$ might be smaller or larger than $a_n$ depending on $a_n$.  And I can't use the Comparison Test with some other series because there's no info here about how fast $\sum a_n$ converges.  Hmm.  Any hints?