Can a square number be split as the sum of two other squares in two different ways? The Pythagorean numbers help us to identify numbers which can be split as sum of two squares. Is this unique?
I'm looking for some help disproving an answer provided on a  I posted about computing the number of double square combinations for a given integer.    The original question is from the Facebook Hacker Cup       Source: Facebook Hacker Cup   Qualification Round 2011      A double-square number is an integer $X$   which can be expressed as the sum of   two perfect squares. For example, 10   is a double-square because $10 = 3^2 + 1^2$.   Given $X$, how can we determine the   number of ways in which it can be   written as the sum of two squares? For   example, $10$ can only be written as $3^2 + 1^2$   (we don't count $1^2 + 3^2$ as being different). On the other hand,   $25$ can be written as $5^2 + 0^2$ or as   $4^2 + 3^2$.      You need to solve this problem for $0 \leq X \leq 2,147,483,647$.      Examples:      $10 \Rightarrow 1$      $25 \Rightarrow 2$      $3 \Rightarrow 0$      $0 \Rightarrow 1$      $1 \Rightarrow 1$   In response to my original question about optimizing this for F#, I got the following response which I'm unable to confirm solves the given problem correctly.       Source:       Again, the number of integer solutions   of $x^2 + y^2 = k$ is four times the   number of prime divisors of $k$ which   are equal to $1 \bmod 4$.      Knowing this, writing a program which   gives the number of solutions is easy:   compute prime numbers up to $46341$ once   and for all.      Given $k$, compute the prime divisors of   $k$ by using the above list (test up to   $\sqrt{k}$). Count the ones which are   equal to $1 \bmod 4$, and sum. Multiply   answer by $4$.   When I go through this algorithm for $25$, I get $8$ which is not correct.          For each prime factor (pf) of $25$ ($5$, $5$ are prime factors of $25$)         if pf % $4$ = $1$ (true for both $5$'s), add $1$ to count      return $4$ * count (count would be $2$ here).          So for $25$, this would be $8$
Given $A$ and $B$ positive-definite matrices and $Q$ unitary matrix, prove that if $A = BQ$, then $A=B$. $Q$ is unitary, so $QQ^*=I$ If $A$ and $B$ are positive-definite, than $A=A^*$ and $B=B^*$. $A^*=(BQ)^*=Q^*B^*$ $A^2=AA=AA^*=(BQ)(Q^*B^*)=B(QQ^*)B^*=BIB^*=B^2$ $A^2=B^2$. I don't know how to use the fact that $A$ and $B$ are positive-definite to finish the proof. I can't run this latex script How to get my hover-menu back? Is there a word to describe indecisiveness between two things? Possible Duplicate:          Is there a word to describe indecisiveness, specifically between two things? I tried online dictionaries, but did not find anything. Parenthesize what I have highlighted Opacity problem over white object in Illustrator I have a problem. I'm working with an object at 50% opacity. When it's over the artboard itself the color looks great, but when I put a white object behind it I get this weird color that doesn't look accurate.  This happens with every object and only in CMYK. I'm pretty sure this never happened to me before so maybe I changed something in the settings or I don't know.  Does anyone have any idea? Number of pairs of strings satisfying the given condition We are provided with a string A (may contain repeated characters as well ). One needs to make all possible permutations of A , and find out how many pairs of strings chosen from these permutations are not similar.  Two strings are similar if we can make both of them exactly same by carrying out at most 1 swap in each of them .  Example :- if we are provided with string abcd  , then for permutation abcd , the permutations which are not similar to it are bcda , bdac , cadb , cdba , dabc , dcab . Similar is the case for other permuations as well. So overall number of desired pairs are 24*6=144 .  I tried solving it for each possible pair by approach mentioned here     But as the permutations can be large enough , I need a better approach of solving this. Can I revert to the Mountain Lion style labels instead of Mavericks tags? How? 'pyrcc5' is not recognized as an internal or external command How to partially hide content in beamer latex? How do I delete a file whose name begins with "-" (hyphen a.k.a. dash or minus)? How do you remove a file whose filename begins with a dash (hyphen or minus) -?  I'm ssh'd into a remote OSX server and I have this file in my directory:  tohru:~ $ ls -l total 8 -rw-r--r--    1 me  staff  1352 Aug 18 14:33 --help ...   How in the world can I delete --help from a CLI?  This issue is something that I come across in different forms on occasion, these files are easy to create, but hard to get rid of.  I have tried using backslash  rm \-\-help   I have tried quotes  rm "--help"   How do I prevent the minus (dash or hyphen) character to be interpreted as an option? What is the best way to handle a lot of misused tags? So today I noticed a question that had the  tag. As the question was not about JSFiddle, and only included a link to the site, I thought somebody has just created this for the sake of it. So I decided the best action would be to remove it, and try to stop it from getting out of control.  But then I searched (clicked the tag) for other questions that used it and I was amayonaised to see over 500 questions had the very same tag! Most of which were incorrectly tagged. So I cleaned up a couple and then quickly got bored.  So I am wondering, aside from going through them all by myself, is there a more efficient way?  I think it would be a great idea if there was some feature (probably an admin feature) that allowed a new tag queue to be added to the review list. I think this could work well as follows:   Somebody brings up the problematic tag in question (e.g. Me on here) An admin reviews my concern, and decides that the tag is very misused That admin adds the tag for review in a (temporary) new review queue. All users that can review can then go through existing tags, and vote for "No action" or "Remove tag" The world becomes a slightly better place   ...or not?    By the way, I tried to add some new tags to this post but I don't have the rep. So if someone could create them for me that would be swell: "musefan", "today", "sunny-spells", "pointless-tags" How can I easily share links or text between my Android phone and my laptop? How to reduce the spacing in chemical symbols? Currently, if want to write a chemical symbol, for example, ${}^{239}Np$, this is what I type in: {}^{239}Np. The result:    But it looks bad, I feel as if the "N" and "p" should be closer, or a different font should have been used.  How could I make better looking chemical symbols? Currently I am using mainly the MathJax of the SE, but sometimes I use other TeX as well. tag:* links incorrectly when using Save And Copy Profile To All Stack Exchange Accounts The  tag in my Stack Exchange profile links to different sites depending on where it's being viewed:  Profile on StackOverflow:  [tag:CSS] =&gt; https://stackoverflow.com/questions/tagged/css   Profile on StackExchange:  [tag:CSS] =&gt; https://stackexchange.com/questions/tagged/css   Profile on CodeReview:  [tag:CSS] =&gt; http://codereview.stackexchange.com/questions/tagged/css    I'd like to have these all link to https://stackoverflow.com/questions/tagged/css. You can ; why not add the ability to specify the site with tags? &lt;!-- tag: stackoverflow --&gt;[tag:css] &lt;!--tag: meta --&gt;[tag:feature-request]  The current behavior also cause a bug on my :    All tags send me to find a Panda aka 404 Page Not Found. ibus Avro in Ubuntu 14.04 LTS I used the instructions given  to install ibus Avro in my ubuntu 14.04 LTS (64 bit) but ibus avro was not installed. Can anyone help me to solve this case? After giving the commands in terminal nothing happens. How to find the reduced density matrix of a four-qubit system? I have the state vector $|p\rangle$ made up of 4 qubits. Say system A is made up of the first and second qubits while system B is made up of qubits 3 and 4. I want to find the reduced density matrix of system A.   I know I could separately extract qubits 1,2 and 3,4 into their own state vectors then find their density matrices and compute the reduced density matrix for system A.  I want to figure out how to do this without having to extract and separate the systems. First I would find the density matrix of $|p\rangle$ and then do a partial trace with respect to system B. I am not sure how to do the partial trace of system B since the system contains 2 qubits.  Can anyone help me figure this out? I am using Python and NumPy for reference. I have an array of Foo objects. How do I remove the second element of the array?  I need something similar to RemoveAt() but for a regular array. Why do electrons move towards anode in the Photoelectric effect experiment? Consider a Photoelectric effect experiment apparatus as shown in Figure 11.1    The variation of photocurrent with the voltage applied across $\mathrm{A}$ and $\mathrm{C}$ is as shown in Figure 11.3.    My question –     Why is the current non-zero even if the voltage is zero?    Consider a situation in which the voltage across the plates is zero. Photons of sufficient frequency strike the outermost surface of the cathode, emitter plate $\mathrm{C}$. Electrons become free from the attraction of nucleus as their net energy becomes positive.  Why I think that there should be no net current?  As soon as photons strike the outermost surface of the cathode(assumed to be $1$ to $10$ atomic diameters thick), electrons become free. Now, as the electrons have kinetic energy, they'll come out of that outermost surface. Now, the electrons(with kinetic energy) should have an equal probability of going in every direction of the surface. So, around half of the electrons should go in the right direction towards the anode and strike it and half should go to the left, trying to penetrate the inner surfaces of the cathode plate.   Now, the electrons which will go to the right will face some field due to the space charge present in the tube but nevertheless, some electrons will definitely reach the anode plate. After they strike with the anode plate, they'll face some resistance but still, some electrons will reach the low resistance copper wires connected to the anode plate and milliammeter.  Now, consider the electrons which go towards left. They'll definitely face resistance from cathode plate but some will still reach the copper wire.  Now, as there is no potential difference applied between $\mathrm{A}$ and $\mathrm{C}$, there is no need of commutator and voltmeter. So, the ammeter is connected in series with the anode plates and cathode plates with copper wires.  Now, if there is steady state current in the circuit, electrons emitted to any one of the sides should dominate over the other. But the number of electrons emitted on both the sides is same, and all the electrons should face the same resistance as the current(electrons) should flow in a closed loop. But if the number and velocity of electrons coming from both the sides are same, there should be no net current. But there is. Why?  Edit –  From the answers of anna v and mmainville, it can be seen that the emission of electrons is dependent on the angle of emission of light.  But still, the question remains. If the electrons emitted towards anode have enough energy to complete the circuit and again reach the holes in cathode despite the resistance in between, the electrons emitted to the left should have enough energy to come to anode plate via copper wires and again get ejected through anode plate by the virtue of their kinetic energy and reach the cathode plate. In this case too, the current should be zero which is not true. Why? Is being good at mathematic contests necessary to pursue a career in mathematics or physics? I am extremely poor in solving a problem quickly, which leaves me doing badly in olympiads and other contests. But, if I just don’t give up on a problem, no matter how much time it takes, I usually end up solving it. To have a future in mathematics or physics, is it necessary for me to excel at contests, because these days children excelling at contests have an advantage over those who don’t (not complete advantage, but advantage nonetheless)?