This is a homework problem so I am not looking for someone to solve it for me. I would like to know how I should approach this problem, or in what direction I should research to figure it out myself.  For $y \in \mathbb N$, $y &gt; 1$, find $x$ for which $f(x) = y$. Given:    $f(0)=1$ $f(1)=1$ $f(2)=2$ $f(2x)=f(x)+f(x+1)+x$ $f(2x+1)=f(x)+f(x−1)+1$
I have the following recurrence that I've been pounding on:  $$ a(0)=1\\ a(1)=1\\ a(2)=2\\ a(2n)=a(n)+a(n+1)+n\ \ \ (\forall n&gt;1)\\ a(2n+1)=a(n)+a(n-1)+1\ \ \ (\forall n\ge 1) $$  I don't have much background in solving these things, so I've been googling around looking for different techniques. Unfortunately, I haven't been able to correctly apply them yet. So far I've tried:   Characteristic equations Generating functions Plugging it into Wolfram Alpha Telescoping Observation   I'm sure that one or more of these is the way to go, but my biggest problem right now is figuring out how to deal with the idea that there are different equations for odd and even values of $n$. I'm not necessarily looking for a solution (though it would be gratefully accepted), but any nudges in the right direction would be much appreciated.    To follow up, it turned out that the speed problem described in my comment, below was related to the Decimal implementation in Python 2.7. Switching to Python 3.3 (and Java) made everything many orders of magnitude better.
Difference between ulimit, lsof, cat /proc/sys/fs/file-max I've been getting java.io.IOException: Too many open files while running a Kafka instance and using one topic with 1000 partitions so I started investigating the file descriptors limits in my ec2 vm. I cannot understand which is exactly the limit for open files on a Centos 7 machine since all the following commands produce different results. The commands are:   ulimit -a: open files 1024 lsof | wc -l: 298280 cat /proc/sys/fs/file-max: 758881 (which is consistent with /proc/sys/fs/file-nr)   If the actual limit is the one the last command produces then I am well below it (lsof | wc -l: 298280). But if this is the case, the output of the ulimit command is quite unclear to me since I am well above the 1024 open files.   but are there all these seemingly "inconsistencies" between these commands? This image is what's supposed to look like in Edit Mode/Object Mode(although I still can make these screenshots even after the update by pressing F12 which is rendering) but the following is what my donut looks like now in Blender.  It shows no shadows and colors. The only thing I did is updating blender to 2.81 from 2.80. And I don't know what but something seems off with blender. Sometimes I can't click any objects so I just pressed tab and then now it's all clickable. Seems like I was in edit mode, but to me, it looked exactly like object mode. I don't know what is wrong with it. How do I make my colors show up again? How can editors and reviewers detect data manipulation? How do I efficiently iterate over each entry in a Java Map? Can't access global variable inside function A shell tool to "tablify" input data A long time ago I remember using a command that makes its input into a nicely formatted table.  For example, for this input,  apple 1 100 orange 20 19 pineapple 1000 87 avocado 4 30   The output will be similar to this:  apple     1    100 orange    20   19 pineapple 1000 87 avocado   4    30   I'd like to know the name of this tool. How does IPv4 Subnetting Work? There are 11 letters in the word.   M - 1 I - 4 S - 4 P - 2  so the number of different permutations is $\dfrac{11!}{1! 4 !4!2!}$  Is this correct solution? How to prove floor identities? Let $a\ge 2$ be an integer. Show that for positive integers $m,n$, we have $a^n - 1$ divides $a^m - 1$ if and only if $n$ divides $m$.   I am having trouble showing this. I've seen a similar problem on here but it only shows one direction for the proof. I would like to see both directions.  This is what I have so far: Let $m = nq + r$, then $a^m - 1 = a^{nq + r}- 1 = a^{nq}a^r - 1 = a^{nq}a^r - a^r + a^r - 1 = a^r(a^{nq} - 1) + a^r - 1$. Since $0\le r\lt n$, $r = 0$ then $a^m - 1$ = $a^{nq} - 1$ so $a^m$ = $a^{nq}$ . Thus $m = nq$ hence $n\mid m$. Is the product of symmetric positive semidefinite matrices positive definite? I see on Wikipedia that the product of two commuting symmetric positive definite matrices is also positive definite. Does the same result hold for the product of two positive semidefinite matrices?  My proof of the positive definite case falls apart for the semidefinite case because of the possibility of division by zero... How to reduce space between image and its caption? What is the sum of the power series: $\sum_{k=2}^\infty\frac{x^k}{k(k-1)}$? What is the function represented by the power series $$ \sum_{k=2}^\infty\frac{x^k}{k(k-1)}\quad? $$  It looks like $\dfrac1{1-x}$ but I don't know. Why does ice melting not change the water level in a container? I have read the explanation for this in several textbooks, but I am struggling to understand it via Archimedes' principle. If someone can clarify with a diagram or something so I can understand or a clear equation explanation that would be great. Cannot access to (or find out) main Settings program Say I have two normal distributions A and B with means $\mu_A$ and $\mu_B$ and variances $\sigma_A$ and $\sigma_B$. I want to take a weighted mixture of these two distributions using weights $p$ and $q$ where $0\le p \le 1$ and $q = 1-p$. I know that the mean of this mixture would be $\mu_{AB} = (p\times\mu_A) + (q\times\mu_B)$.  What would the variance be?    A concrete example would be if I knew the parameters for the distribution of male and female height. If I had a room of people that was 60% male, I could produce the expected mean height for the whole room, but what about the variance? How can I make environment variables "exported" in a shell script stick around? I have multiple Amazon EC2 accounts and want to quickly be able to switch variables, such as $EC2_HOME, using a script.  I have have a shell script set up like this:  #!/bin/sh export EC2_HOME=/home/me/.ec2 echo $EC2_HOME   When I run the script I know that EC2_HOME is set, but I thought that using export would make the variable stick around after the script completed. It does not, as running echo $EC_HOME does not show anything.  I know this must be very rudimentary Linux scripting knowledge, but I don't know it. I tried looking for related questions without luck - so my apologies if this is a duplicate. Alternate exits in Bit Trip Runner 2 Is there any point in taking the alternate exits in Bit Trip Runner 2?  I can't see any benefit to doing so in terms of unlocking a different path in the overworld, so is it just for your own benefit? Combinatorial argument to prove the recurrence relation for number of derangements Give a combinatorial argument to prove that the number of derangements satisfies the following relation: $$d_n = (n − 1)(d_{n−1} + d_{n−2})$$ for $n \geq 2$.  I am able to prove this algebraically but not able to see the combinatorial example. Is there any intuition or meaning regarding Cauchy-Riemann equations? Holomorphic functions are one of the most beautiful objects in mathematics. However, Cauchy-Riemann equations are a little bit of a mystery for me. What does that mean intuitively when a function satisfyes those equations?