Is there a function $f : \mathbb Z \times \mathbb Z \to \mathbb Z$ that is one to one and onto? I know a function like this exists but I'm not able to find it.  It's not the same as g(x,y) = 2^{x-1} (2y-1) which is used to prove the same thing for naturals because here we want x to be a positive or negative integer. So that function can't be used.
The cartesian product $\mathbb{N} \times \mathbb{N}$ is countable I'm examining a proof I have read that claims to show that the Cartesian product $\mathbb{N} \times \mathbb{N}$ is countable, and as part of this proof, I am looking to show that the given map is surjective (indeed bijective), but I'm afraid that I can't see why this is the case. I wonder whether you might be able to point me in the right direction?  Indeed, the proof begins like this:  "For each $n \in \mathbb{N}$, let $k_n, l_n$ be such that $n = 2^{k_n - 1} \left(2l_n - 1 \right)$; that is, $k_n - 1$ is the power of $2$ in the prime factorisation of $n$, and $2 l_n - 1$ is the (necessarily odd) number $\frac{n}{2^{k_n - 1}}$."  It then states that $n \mapsto \left(k_n , l_n \right)$ is a surjection from $\mathbb{N}$ to $\mathbb{N} \times \mathbb{N}$, and so ends the proof.  I can intuitively see why this should be a bijection, I think, but I'm not sure how to make these feelings rigorous?   I suppose I'd say that the map is surjective since given any $\left(k_n , l_n \right) \in \mathbb{N} \times \mathbb{N}$ we can simply take $n$ indeed to be equal to $2^{k_n - 1} \left(2l_n - 1 \right)$ and note that $k_n - 1 \geq 0$ and thus $2^{k_n - 1}$  is both greater or equal to one so is a natural number (making the obvious inductive argument, noting that multiplication on $\mathbb{N}$ is closed), and similarly that $2 l_n - 1 \geq 2\cdot 1 - 1 = 1$ and is also a natural number, and thus the product of these two, $n$ must also be a natural number. Is it just as simple as this?  I suppose my gut feeling in the proving that the map is injective would be to assume that $2^{k_n - 1} \left(2 l_n - 1 \right) = 2^{k_m - 1} \left(2 l_m - 1 \right)$ and then use the Fundamental Theorem of Arithmetic to conclude that $n = m$. Is this going along the right lines? The 'implicit' definition of the mapping has me a little confused about the approach.    On a related, but separate note, I am indeed aware that if $K$ and $L$ are any countable sets, then so is $K \times L$, so trivially, taking the identity mapping we see trivially that this map is bijective and therefore that $\mathbb{N}$ is certainly countable (!), and thus so is $\mathbb{N} \times \mathbb{N}$. Hence, it's not really the statement that I'm interested in, but rather the exciting excursion into number theory that the above alternative proof provides.
Given two ciphertexts $c_1 = enc(p_1)$ and $c_2= enc(p_2)$ using any additive homomorphic encryption scheme (or specifically Paillier).   Can we find out whether the underlying plaintexts $p_1,p_2$ are equal without decrypting $c_1,c_2$ i.e. homomorphically? I am trying to solve the following exercise.      Assume that $m$ and $n$ are co-prime positive integers, and that $k$ is a field. Prove that the ideal generated by $x^{m} - {y^n}$ is a prime ideal in $k[x,y]$.   I tried the following approach : Consider the ring homomorphism ${\varphi}:k[x,y]\rightarrow{k[t]}$ defined by $\varphi(x) = t^n$, and $\varphi(y) = t^m$, and extend $\varphi$ to $k[x,y]$ to ensure that it is a ring homomorphism. Then the ideal $(x^m - y^n)$ is clearly contained in the kernel of $\varphi$. It remains to prove the reverse set inclusion. i.e. to prove that this ideal is exactly equal to the kernel of $\varphi$. I don't know how to go about this! Specifying latest revision of a particular branch with bower LWJGL—How to Animate and Render Characters Using a Sprite Sheet I'm making an RPG similar to Super Nintendo RPGs in the early '90s. I'm handling movement much like Squaresoft's Final Fantasy IV.   Notice that the player never actually changes his x and y positions on screen. What I'm asking, to be precise, is how could I, in LWJGL through user input (say, the arrow keys), take the sprite sheet I have of my character's movement animations and render them in a [partially] fluid animation like above?  I've been perusing the internet for hours, and I've not found a surefire way to do this. I don't have any code as of yet; I'm more or less looking for a guideline or some pointers in the right direction concerning how I might tackle this.  And, to note, this'll be a rather large game, so I want to focus partially on speed and efficiency—that meaning that I don't want to dive into Slick2D and libGDX unless absolutely necessary. Detect init system using the shell Show $100+t$ is reducible in $\mathbb{Z}[[t]]$ $\mathbb{Z}[[t]]$ is the ring of formal power series with integer coefficients, and the problem asks to show that $100+t$ is reducible. This means I need to find two power series, $\sum_{i=0}^\infty a_i t^i$ and $\sum_{j=0}^\infty b_j t^j$ with $a_i,b_j\in\mathbb{Z}$, that when multiplied give $100+t$. Since the integers are an integral domain, I know that neither of these power series may be finite, but I'm having a really hard time figuring out how to come up with two series that will telescope properly. Any suggestions? Counting integer partitions of n into exactly k distinct parts size at most M How can I find the number of partitions of $n$ into exactly $k$ distinct parts, where each part is at most $M$?  The number of partitions $p_k(\leq M,n)$ of $n$ into at most $k$ parts, each of size at most $M$, is given by the generating function: $$  \binom{M+k}{k}_{x} = \prod_{j=1}^{k}\frac{1-x^{M+k-j+1}}{1-x^j}= \sum_{n=0}^{kM} p_{k}(\leq M,n) x^n $$  For the number of the partitions $p_k(\mathcal{D},n)$ of $n$ into at most $k$ parts there is the recurrence relationship: $$   p_{k}(\mathcal{D},n) = p_{k}(\mathcal{D},n-k) + p_{k-1}(\mathcal{D},n) $$  But what, if I want to count only the partitions with distinct parts and restricted number of parts and restricted part size?  Update: Now I know the generating function for the number of distinct restricted partitions $p_k(\leq M, \mathcal{D},n)$ of $n$ into exactly $k$ distinct parts, all at most $M$ is $$    \prod_{j=1}^{M} (1+xq^{j}) = \sum_{k,n=0}^{\infty}p_k(\leq M, \mathcal{D},n)x^{k}q^{n} $$ and there is also a recurrence relation $$    p_k(\leq M, \mathcal{D},n) =         p_{k-1}(\leq M-1, \mathcal{D},n-k) +         p_k(\leq M-1, \mathcal{D},n-k) $$ How can I prove this? Could you recommend a book, where I could read about this? Google Chrome error: Error initializing NSS without a persistent database It was working properly before, suddenly it stopped working. When I tried to open by clicking on its icon, but nothing happens.  As already here are many questions related to this, but none of them are working for me. I already checked  and .  I uninstalled Chrome by following the instructions from .  sudo apt-get purge google-chrome-stable rm ~/.config/google-chrome/ -rf   Again I installed Chrome by:  sudo apt-get install google-chrome-stable   But the problem is still thesame.  When I enter google-chrome in terminal I get following error.  [12289:12323:0723/014456:ERROR:nss_util.cc(744)] Error initializing NSS with a persistent database (sql:/home/maddy/.pki/nssdb): libsoftokn3.so: cannot open shared object file: No such file or directory [12289:12323:0723/014456:ERROR:nss_util.cc(212)] Error initializing NSS without a persistent database: NSS error code: -5925 [12289:12323:0723/014456:FATAL:nss_util.cc(214)] nss_error=-5925, os_error=0 Space between 2 paths in Illustrator How can I align 2 paths perfectly? No matter what I do I get a little space (gap between the 2 paths I create, and they are straight lines not as I saw in other questions with pixel problems)  An example:    Between every triangle is a little space, like in the example. It isn't obvious and it doesn't bother, but if I use the image (as an SVG or something) it is really obvious. I use (and have it much bigger) drive D: to store all my user data and games, but I have installed the Steam client on drive C:. When I was installing a first game (Warhammer 40000), I've chosen to place my library folder on drive D: and the game went there.  But now as I've got installed the second game (Portal), I can see that it was put on drive C: despite to the choice I've done previously. When I open Steam - Settings - Downloads + Cloud - Steam library folders, I can see both installation places in the list. Can I merge them into one?  I would even agree to use the default drive C: library (as I've replaced it with a symlink already). When I press to remove one library it says it can only remove empty ones. How do I create a partially transparent flag? Maximal inequality for a sequence of partial sums of independent random variables Let $X_n$, $n=1,2,3,...$ be a sequence of independent (not necessarily identically distributed) random variables, let $S_n=\sum_{i=1}^nX_i$. Prove the following maximal inequality: For all $t&gt;0$,$$\mathbb{P}\left(\max_{1\leq i\leq n}|S_i|\geq t \right)\leq 3\max_{1\leq i\leq n}\mathbb{P}\left(|S_i|\geq\frac{t}{3} \right)$$ Also how do LEFT JOIN, RIGHT JOIN and FULL JOIN fit in? Efficient online linear regression If a field $F$ is such that $\left|F\right|>n-1$ why is $V$ a vector space over $F$ not equal to the union of $n$ proper subspaces of $V$ Does RSA work for any message M? Add sort by relevance to search jobs In Careers 2.0, individuals can choose "search jobs" and sort by date posted, job title, and company name.  However, Careers 2.0 already knows what tags I'm proficient in, and knows the tags associated with the job postings.  A sort option, relevance, should be added so that jobs matching my skill set, as demonstrated on stack exchange, will float to the top. Evaluate the following integral:  $$\int \frac{\sqrt{\sin ^4x+\cos ^4x}}{\sin ^3x \cos x }dx$$ where $x \in \big(0,\frac{\pi}{2} \big)$  Could some give me hint as how to approach this question?  I tried to use the fact that $\sin ^4x+\cos ^4x=1-\frac{sin^22x}{2}$ but it didn't help. How should I proceed? How to encrypt individual folders? I run into this infinite product today. I don't have that much experience evaluating products therefore I don't have any idea of how to tackle this.   Here is the question. Evaluate (if possible) in a closed form the product:  $$\Pi = \prod_{n=1}^{\infty} \frac{1}{1+\pi^{{\large \frac{1}{2^n}}}}$$  The numerical value seems to be $\Pi= 0.534523$ which is very close to $\frac{\pi}{6}$ taking into account that $\frac{\pi}{6} \approx 0.523598$. In the mean time W|A evaluates it to $0$. I'm lost.   Can the community help?  Edit: Based on the answer we have two products. The product I asked tends to zero and the bonus product provided by @you're in my eye (thanks for that) is $\frac{\ln \pi}{\pi-1}$.   Thanks for the quick response.