Prove that there are at least $2005$ pairs of $(x, y)$ of non negative integers x and y that satisfy $x^2+y^2 = N,$ for some positive integer $N$. Prove that there exists a positive integer $N$ such that there are at least $2005$ ordered pairs $(x,y),$ of non-negative integers $x$ and $y,$ satisfying $x^2 + y^2 = N.$  I have that the $sqrt(N)$ would be the lcm of the hypotenuses of the first $2005$ Pythagorean triples. Since there are infinite amounts Pythagorean triples, there would be $2005$ pairs of $(x, y).$ But, I don't know if this proves what the question asks for completely.
Number of integer solutions of $x^2 + y^2 = k$ 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$
Java equivalent to PHP's preg_replace_callback How to float until on left (or right) page? I updated a virtual machine running Ubuntu server 15.04 to the just released new stable 15.10.  There were no apparent problems, but after reboot the machine lost its network connection. lspci showed the correct card and lsmod proved that the driver had been loaded.  Hints about editing or removing /etc/udev/rules.d/70-persistent-net.rules did not succeed (still no network, no new file), the famous /lib/udev/write_net_rules did not even exist.  I don't have much clue regarding udev and systemd, so it took me some time to find in /sys/class/net that the network interface name changed. It became ens32, which was renamed from eth0. After I changed /etc/network/interfaces network communication was enabled again.  But - why does this happen at all? And if it happens, shouldn't the interfaces file be updated automatically?  Now that I deleted the virtual network card and created another one, eth0 becomes eno16777728, which is not so, uhm, nice.  Should this behaviour (at least that of the upgrade procedure) be reported as a bug?  Furthermore, is /etc/udev/rules.d/70-persistent-net.rules obsolete now? And (although only partly related) what about /etc/udev/rules.d/70-persistent-cd.rules?)  Edit - additional question (after accepted answer) The dependency of /etc/network/interfaces from the actual interface name bothered me. I tried a new installation of *ubuntu in another virtual machine. To my surprise, /etc/network/interfaces contained a reference to the loopback device only. However, with my original VM this change prevented the network to come up. So what else do I need to change?  Edit Well, from another test I found that a new Ubuntu Server has the network interface card in /etc/network/interfaces, while XUbuntu has not. Maybe it is using network-manager or something else. Updating .class file in jar I've just been searching around the net for version control that has some support for graphic/Photoshop files. We're currently using BitBucket which is free and unlimited when it comes to file size but doesn't have any design review tools.  Here's what I've found. Does anyone else have any recommendations?  Pixelapse – Free/Beta, works well. Now has layer comp support.   Shipment – Private Beta (waiting for an invite)   LayerVault (out of business) – Windows/Mac, has layer comp support   PixelNovel – SVN Version control for Photoshop   CAD only?! But looks really good.   FileTrek – Very enterprise. No price or demo.   Kaleidoscopeapp – GIT with image compare   Apps that copy files with an incremented version Hide textfield blinking cursor Improving your own suggested edit makes you leave the First Posts review queue When reviewing the First Posts (and Late Answers) review queue, after you suggest an edit, you're back in the review queue and the I'm Done button is activated. So far, so good, but when I realize I want to edit something else as well (I often forget the tags), I can click the 'edit' link again. When I'm done improving my suggested edit, I'm suddenly outside the review queue.    This does not happen if you have enough reputation (2k) to edit posts straight away; then you always stay in the review queue. Finding the maximum likelihood estimator Find the MLE of the unknown parameter $\theta$ when $X_1,X_2,...,X_n$ is a sample from the distribution whose density function is: $$f_X(x) = \frac12e^{-|x-\theta|}, -\infty&lt;x&lt;\infty$$ What I did so far: $$\text{maximize }(\frac12)^ne^{-|x_1-\theta|-|x_2-\theta|-...-|x_n-\theta|} \\ \text{thus we want to minimize }|x_1-\theta|+|x_2-\theta|+...+|x_n-\theta|$$ Since $|x_i-\theta|$ is positive for all $i$, we want to solve for $\theta$ so: $$|x_1-\theta|+|x_2-\theta|+...+|x_n-\theta|=0$$ What do I do from here? Encouraging users to create an account (and keep it) I know SO's policy is &quot;you don't have to register to ask questions,&quot; but there are so many new members and so many hit-and-runs... The majority of the questions I see now are coming from new users (i.e., it's their first question). Although unregistered users should still be able to ask questions, I think we should encourage users to create an account. Here is a couple of ways we could do that:  Explicitly encourage people to get an account: there's currently nothing telling people to do that. Maybe tell people something like &quot;Get an account, it's easy!&quot; and maybe show some of the perks of having an account (and having rep).  Maybe give a few bonus points for registering; and have that enable a basic privilege. It could be taken from one of the , for example.   Of course getting people to register is just half of the battle. I don't know what the stats are on this, but I think there's a number of users who create multiple accounts anyways. We could curb that by:  Having smart(er)? duplicate account detection systems, alerting someone who is about to create a new account and possibly has an account already. Give them a message like &quot;Hey, it looks like you already have  account, are you sure you want to create a new one?&quot;  Create a new privilege (10k? 20k?) that gives users tools to detect possible duplicate accounts, eg: &quot;List users with the same e-mail,&quot; &quot;List users with the same IP addresses,&quot;  etc. (without revealing said emails and IPs). Then the 10k/20k can look at other stuff (e.g.: posts) and refer the new user to a moderator for a possible merge. Command/macro name cannot include numbers and symbols I would like put picture into table, and my idea is define new command as below>   \newcommand{\EJ471}{\includegraphics[scale=0.150]{EJ_471.jpg}}   But compiler reports an error. If I use the command name for example \EJa, everything is all right. I've read similar questions as      But still I don't understand why it does not work. chown -R root.root / So I was working and there was a directory that I was periodically changing to my user in  a root terminal so that I could open the files in text editors, but I accidentally pressed / instead of . and this was the command I put out:  chown -R emil.emil /   Then immediately panicked ^C and put in another command, as I thought I could always change back the files I needed to access:  chown -R root.root /   So now I can't do su from emil to even try to fix this, as I'm getting permission denied error. I'm on Ubuntu could someone tell me if there is a way I could fix this, without absolutely reinstalling the whole thing.  TIP  If you are trying to get root access, and are getting this permission denied error when using su try this command:  gksu gnome-terminal   It will prompt you for the root password and open a new root terminal for some reason this works and gives me root access, when su doesn't. How do I create an Ubuntu live USB using a Mac? Why is plain-hash-then-encrypt not a secure MAC? I have a python script that checks file path names for corresponding files in a drive location. All of the inputs were originally hard coded, and it works well enough:      import arcpy     import os     shp = r"C:\Users\dotwell\Desktop\Locations.shp"     fields = ["ZdriveLoc"]     f = open (r"C:\Users\dotwell\Desktop\ValMapsTest.txt", "w")     cursor = arcpy.da.SearchCursor (shp, fields)         for row in cursor:             Roll=str(row[0])             if not os.path.exists(Roll):             f.write(Roll + os.linesep)       f.close()   I'm trying to create an ArcGIS script tool from this, and I've only had partial success. I can use   shp = arcpy.GetParameterAsText(0)   to allow the user to select the shapefile. I'd like to then have a drop down list of the fields in that shapefile for the user to select the field that contains the path names, but I can't get it to work. Can someone show me how to generate the drop down? Here's my latest try. It works, but requires the user to type in the field name. It would also be nice for the user to designate the output text file name and location.   import arcpy import os shapefile = arcpy.GetParameterAsText(0) field = arcpy.GetParameterAsText(1) f = open (r"C:\Users\dotwell\Desktop\ValMapsTemp.txt", "w") cursor = arcpy.da.SearchCursor (shapefile, field) for row in cursor:     Roll=str(row[0])     if not os.path.exists(Roll):         f.write(Roll + os.linesep)   f.close()   Here are the parameters in my ArcGIS script tool: How to avoid duplicating assigned materials when duplicating a mesh? how can I prevent Blender 2.8 from duplicating materials every time (?) I duplicate a mesh. can't read from SQlite database Iterating through a Collection, avoiding ConcurrentModificationException when removing objects in a loop How to implement dual-classing in a non-levelled RPG game? I'm working on an alternate ruleset for a tabletop pen-and-paper RPG (like D&amp;D). Recently I've been toying the idea of abolishing a level system. However, I don't want to remove the ability for a player to multi-class. Are there any games which don't have a levelling system, yet allow multi-classing? How do they do it successfully? How to roll back Ubuntu to a previous version? Book series about preparation for a war at the Singularity I am looking for a book series (almost certainly a trilogy) that starts with some humans in a space station being abducted by a small funny-looking alien and taken to a prison planet. They find out that the way space travel works is by creating copies of the passengers, and the originals remained on the space station. This is actually good for the aliens since they believe every sentient being will resurrect at the Singularity and will be forced to fight a battle, so the more the merrier.  The one other detail I remember is that the world economy has a rampant inflation, so people take any cash they have at the end of the day and buy 20th-century memorabilia that doesn't devalue as much.