Jacob
Reputation
Top tag
Next privilege 250 Rep.
 Jul3 awarded Nice Question Jun8 awarded Notable Question Jan28 awarded Popular Question Sep24 awarded Autobiographer Jan15 comment Number of integer solutions of $x^2 + y^2 = k$ @Mariano: My apologies, I thought you edited to remove the word text book, but in fact the only edit you made was to add the last sentence. I've spent entirely too much of my life today commenting on your last sentence. I understand you have a different definition of "why this works" and you probably had best intentions as you've noted in the above comments. Your answer helped me a great deal to determine the offered formula was incorrect. Thanks. Jan15 comment Number of integer solutions of $x^2 + y^2 = k$ @Alex: If you did not think the last sentence was flippant, why did you not just ignore my comment? You must have really wanted to wag your finger at me and further this discussion. Since you've come to this party a little late, the original post has been edited to eliminate the flippant tone and italicized emphasis. But thanks for bringing it back up and trying to take another dig at me. "mindlessly apply a formula"? Really? What has that added to this discussion? Jan14 awarded Scholar Jan14 awarded Supporter Jan14 accepted Number of integer solutions of $x^2 + y^2 = k$ Jan14 comment Number of integer solutions of $x^2 + y^2 = k$ Your answer really is impressive, I wasn't being flippant. It's exactly the kind of thing I was looking for and can hardly understand. I wanted more information about whether I was missing something or the formula really did miss possible combinations. Thanks for the help. Jan14 comment Number of integer solutions of $x^2 + y^2 = k$ I know that this probably answers the question posed by the Title, but how does it relate to whether the proposed formula (in the original Stack Overflow answer) accurately answers the Hacker cup question. For instance, in your impressive explanation here do you cover the fact that the originally proposed formula doesn't count the match of 5^2 + 0^2 for 25? Jan14 comment Number of integer solutions of $x^2 + y^2 = k$ @Mariano: Obviously there is some equivocation on "why" in this context. Let's put it this way, if you took away that last sentence, would it detract from your overall answer? Also, Jacpob is close, but Jacob is better. Jan14 awarded Student Jan14 awarded Editor Jan14 revised Number of integer solutions of $x^2 + y^2 = k$ Updated algorithm walk through to reflect actual result of 8 Jan14 comment Number of integer solutions of $x^2 + y^2 = k$ I also notice that 5^2 + 0^2 isn't represented in the combinations, so even after removing negative combinations and duplicates, this would still appear to need some extra calculation. Jan14 comment Number of integer solutions of $x^2 + y^2 = k$ Aside from your flippant last sentence (you just gave 3 paragraphs of relevant "why this works"), this is very helpful. You've shown that his given algorithm doesn't solve the actual problem. Jan14 asked Number of integer solutions of $x^2 + y^2 = k$