How can I find the number of integral pythagorean triples if the hypotenuse is $2^{4035}$? I want to do this without finding them all and counting them.
We are given with  $$S_n=\{(x,y)|x^2+y^2=n, \text{where }x,y,n \in \mathbb Z\text{ and }n\geq0  \}$$ Now observe that $-\sqrt n\leq x\leq\sqrt n $ and similarily, $-\sqrt n\leq y\leq\sqrt n $. This means that $-\left \lfloor{\sqrt n}\right \rfloor\leq x\leq \left \lfloor{\sqrt n}\right \rfloor$ and  $-\left \lfloor{\sqrt n}\right \rfloor\leq y\leq \left \lfloor{\sqrt n}\right \rfloor$. Through this result one can easily write code and figure out the cardinality of set $S_i$ but I was wondering whether an expression can be found that would allow one to directly compute $|S_i|$.
Lookup Tables Best Practices: DB Tables... or Enumerations If we have to store the available positions at a company (i.e. Manager, Team Lead, ... etc). What are the best practices for storing it? I have two opinions with comments... "sure, welcoming yours"        Storing it as DB table with columns ID and Name, and deal with it using queries and joins.     Storing it as Enum and forget about the DB table.    In my opinion, I will choose the first solution if I have changing items. So that I won't hard code these options as Enum. I may choose the Enum solution, if I have no doubt that data won't change (for example, Gender: Male, Female).  NOTE: I code in English, and the UI Culture may be Arabic. If I will work with the Enum Solution, I will hard code the culture-based strings in the presentation layer, is it okay from the best practices perspective!!!!  I would like to know your opinions and if my thoughts correspond to what is most recommended "Best Practices"?? PC Blue Screens and then instantly reboots. How do I stop this or find the error later? Did I "get" (or "take") my degree "from" (or "in") the University of Somewhere? I would like to know what is the preferred way to indicate that I took a degree in some subject while also naming the place where I obtained the degree from:   I got my master's degree from the University of Somewhere; I got my master's degree in the University of Somewhere; I took my master's degree in the University of Somewhere.   I would say that "in" is more suitable to mention the particular subject (a degree in maths, for instance) than to indicate the place, but I still have doubts.  By the way, is it a "master's degree" or a "Master's degree"? Found a similar question , but with some minor differences. Is it archaic to use have you in sentences such as this:     John : I think we can see it with a specially crafted telescope.   Mary : Have you such a telescope?   instead of     Mary : Do you have such a telescope?   Is it still used in official and casual conversations? I'm using the beamer miniframes theme (with subsection=false) and the compress option. Currently the navigation shows the dots for each subsection side-by-side. I would prefer if there would be a horizontal space (e.g. with the width of a dot) between the dots of each subsection. Is this possible? Right now it looks like:  Section 1 oooooo  And I would prefer it to look like:  Section 1 ooo ooo  MWE: \documentclass[compress]{beamer}   \useoutertheme[subsection=false]{miniframes}   \begin{document}   \section{Sec 1}   \subsection{}   \begin{frame}[t]     hi   \end{frame} \subsection{}   \begin{frame}[t]     hi   \end{frame} \end{document}` How to apply for a UK standard visitor visa as a family? I am an Indian citizen residing in the United States. My wife and I are planning to travel to the UK for a week. We plan to apply for the UK standard visitor visa from the US. I was filling out the application and I have a few questions.   Travel History - The application asks for travel history to the United States, Canada, Australia and New Zealand. Considering that we're resident aliens in the United States, should we consider all the times we've traveled back to the US from India? Travel History - Should we also list out the times we've traveled to India from the US? Cost of the trip - Hypothetically if we plan to spend a total of ~4,000 USD on this trip, should I split up the cost and write down 2,000 USD on my application and 2,000 USD on my wife's application? Income - From what I've read on the forum, my wife must say that "someone else" i.e. me - is paying for her costs and mention my GWF number in the remarks on her application. Would that be sufficient considering that I'll be sending all income documents with my application? Savings - We have joint savings accounts. Should I mention the same amount on both our applications? Posting the documents - Is the up-to-date advice to send all documents in one packet? Or would sending them in separate packets at the same time be better? My thought was to annotate my wife's packet with my GWF number if we were to send them separately. Bank statements - We get e-statements. Would printing those out be enough? PUA.Phishing.Bank Found Partitions for Ubuntu and Windows 7 dual boot on SSD + HDD setup I have purchased a new SSD (120GB) and I had a HDD (1TB) already installed. I will install both Ubuntu and Windows on these drives. As the file space on the SSD is limited and I've read that writing to an SSD drive is discouraged, I would like to store most of the data on the HDD drive. I am aiming at faster system but also keeping the valuable data safe on the more reliable HDD and expanding the life span of the SSD.  I have already set up Windows on these drives (system files and applications on SSD, Users folder and ProgramData on HDD) and now it's time to set up Ubuntu.  So my question is which partitions I should create, on which drive should they be placed and how large they should be.  Based on my experience and articles I've read, I will probably create /swap, /home and / partitions.   Does it seem reasonable to place /swap and /home partitions on the HDD and / on the SSD?  And how large should / partition be?  Also, will the applications be installed in / partition? If so, is it rational to store the applications on separate partitions on the HDD instead of / on the SSD, and what should the size of the / partition be in this case? Everytime I sudo apt-get update it always not complete and will say in the end  E: Read error - read (5: Input/output error) E: The package lists or status file could not be parsed or opened.   Same goes, when I try to install something and do sudo apt-get install &lt;some app&gt;  What should I do ? I admit, that my drive has bad sectors, could that be the reason? Is there anything else I can do? Why is $\pi$ irrational? I've a few questions in mind:   Why is $\pi$ irrational? If it is, then how can 2 rational quantities (circumference, diameter) can produce irrational number? How are we able to determine digits of $\pi$ accurately? Add a confirmation before moving comments to a chat I need to compute the improper integral $$ \int_{-\infty}^{\infty}\frac{x^{2}}{\cosh\left(x\right)}\,{\rm d}x $$ using contour integration and possibly principal values.  Trying to approach this as I would normally approach evaluating an improper integral using contour integration doesn't work here, and doesn't really give me any clues as to how I should do it. This normal approach is namely evaluating the contour integral $$ \oint_{C}{\frac{z^2}{\cosh\left(z\right)}\mathrm{d}z} $$ using a semicircle in the upper-half plane centered at the origin, but the semicircular part of this contour integral does not vanish since $\cosh\left(z\right)$ has period $2\pi\mathrm{i}$ and there are infinitely-many poles of the integrand along the imaginary axis given by $-\pi\mathrm{i}/2 + 2n\pi\mathrm{i}$ and $\pi\mathrm{i}/2 + 2n\pi\mathrm{i}$ for $n \in \mathbb{Z}$. The residues of the integrand at these simple poles are $-\frac{1}{4}\mathrm{i}\pi^{2}\left(1 - 4n\right)^{2}$ and $\frac{1}{4}\mathrm{i}\left(4\pi n + \pi\right)^{2}$, so that even when we add up all of the poles, we have the sum $4\pi^{2}\mathrm{i}\sum_{n = 0}^{\infty}\,n$, which clearly diverges.  Any hints would be greatly appreciated. How can I convert a string to boolean in JavaScript? Can I convert a string representing a boolean value (e.g., 'true', 'false') into a intrinsic type in JavaScript?  I have a hidden form in HTML that is updated based upon a user's selection within a list. This form contains some fields which represent boolean values and are dynamically populated with an intrinsic boolean value. However, once this value is placed into the hidden input field it becomes a string.  The only way I could find to determine the field's boolean value, once it was converted into a string, was to depend upon the literal value of its string representation.  var myValue = document.myForm.IS_TRUE.value; var isTrueSet = myValue == 'true';   Is there a better way to accomplish this? Can Minecraft be played by two players locally on the same account? I just bought Minecraft. Now, my brother wants to play with me but my Mom doesn't want to buy another. We use the same Wifi network. Can we do this? Often while playing Pathfinder, my group will run into problems where rules for 3-dimensional play simply don't exist, so far as we can find. Arguments will come up over things like carrying-capacity, movement speed, area-effects, and a variety of other things.  Simply put, are there rules for 3D play for Pathfinder, and if so where can I find them? Unable to boot into Windows after installing Ubuntu, how to fix? I installed Windows on my computer, followed by an installation of Ubuntu. However, now I'm unable to boot into my Windows install.  What can I do to fix this? Is this mold? Black? White? Why are the IV (constant) values fixed for HMAC/SHA? Why do HMAC/SHA IV's have a fixed value? I refer to the arbitrary H constants which are included in the algorithm prior to any data being fed in.  Why aren't they exposed to the user, so one can decide on an IV and modify it accordingly (for example, in java they are provided at hash function specification, instead of being supplied by the user at init)?  How does modifying these IVs affect the algorithm? I'm trying to identify a science fiction series on UK TV during the 70s, but I can only recall the following:   A party of adults and children. There was a woman with a telepathic bond to her cat: she could look into its eyes to see what it had seen. Time travel was involved. I think it may have been inadvertent or uncontrolled time travel. On one occasion the party encountered an Elizabethan seaman who demanded to know if Elizabeth was still queen. They party replied "err... yes" because they didn't want to have to explain time travel. OS is openSUSE 12.1, PostgreSQL - 9.1, PostGIS - 2.0. Postgre/PostGIS are installed from Application:Geo repository.  After recent updates when I try to connect to my database I get the following error:      ERROR:  could not load library "/usr/lib/postgresql91/lib64/postgis-2.0.so":  /usr/lib/postgresql91/lib64/postgis-2.0.so: undefined symbol: pj_get_spheroid_defn   I searched the web for this error (, ) and seems that it may have something to do with ld.so.config (or ldconfig command). But I can't figure out what I have to do in my case.