In how many ways can $145^2$ be expressed as sum of two squares?    I tried solving it by finding out the Pythagoren triplets. $145= m^2+n^2 = 12^2+1^2$ &amp; $9^2+8^2$ so triplet is $(145, m^2-n^2 , 2mn) = (145,143,24)=29*(5,4,3)$ &amp; $(145,17,144)$ &amp; one will come from $29$.. i.e $5*(29,21,20)$ total triplets 4. $(145,143,24)$ , $(145,17,144)$ , $(145,116,87)$ &amp; $(145 , 105,100)$. Is there any easier way of doing this?
60400
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$
4489
Expanding the equation out gives  $(3^{2n}\times3)+(2^n\times2^2) \equiv 0\pmod{7}$   Is this correct? I'm a little hazy on my index laws.  Not sure if this is what I need to do? Am I on the right track?
81866
Since last week I have been working on a way, how to sum $1$ and $2$ to have $133$.  So for instance we can have $133$ $1s$ or $61$ $s$2 and one and so on. Looking back to the example: if we sum: $1 + 1... + 1 = 133$ there is only one way. But for the second one there will be $131$ possible ways. And I have to do this for every possible combination. I am stuck with it and I have no idea whatsoever on how to begin.  Any ideas or methods I could use guys?
39289
can anybody help me out to find all  Pythagorean triplet when Hypotenuse is given? for example 10 is given i need (10,6,8)  ,and not needed such triplet (10,24,26) as 10 is not Hypotenuse for this triplet!
9253
The question states:    I'm not sure what to do here. I used the geometric sum to do $2^{-n}$, but I can't think of a way to sum $\sin(n\theta)$ to get the required RHS.    Further working     Apologies for maybe being slow or missing something obvious here... I don't know how to get it into required form.
14282
I was presented with the following problem:      Prove that there exist solutions to $x^2+y^2=z^n$ for all $n$, with $x,y,z, n \in \mathbb{N}$   I showed that by taking any Pythagorean triple $x^2+y^2=z^2$ and multiplying by $z^{2(n-1)}$ we get $(z^{n-1}x)^2+(z^{n-1}y)^2=(z^2)^n$, which allows me to generate solutions easily for any value of $n$. I managed to find several similar questions on this site, such as  concerning the specific case $n=3$. I notice that all of these questions take a similar approach and start with a Pythagorean triple and use it to generate general solutions.  Is there a way to prove the statement (or better yet provide solutions to the equation) without first relying on Pythagoras?
89094
There exists a well-known result concerning a number of representations of $n$ as a sum of two squares. Is there anything similar for a number of representations of $n$ as a difference of two squares? Thank you.
17521
Examining the Tartaglia's triangle, I have observed that all the squares were the trivial cases, that is, $\binom{n^2}1$ or $\binom{n^2}{n^2-1}$.  More formally:  Conjecture: If $\binom nm=k^2$ then $n=k^2$.  Is it known to be true?  I have tried to use the formula  $$\nu_p\left(m!\right)=\sum_{k=1}^\infty\left\lfloor \frac m{p^\alpha}\right\rfloor$$  to prove that the exponents of the factorization of the binomial coefficients are odd, but I realized that this cannot be proved, because the binomial coefficients needn't be square-free: $\binom 63=20$, for example.  Any ideas?
82160
If we reverse the digits of $12$ we will get $21$. $12^{2}=144$. If we reverse its digits we will get $441$ which is $21^{2}$.  Here is the puzzle. How many such two digit numbers are there? Digits must be different.  We got an algebraic method to solve it if the square is a three digit number.It given here :  Let $a&gt;b$  $(10a+b)^{2}=100x+10y+z$ and $(10b+a)^{2}=100z+10y+x$  Difference between these two equations will lead to $a^{2}-b^{2}=x-z$  $x-z \leq 8$.Then  $a^{2}-b^{2} \leq 8$.  Since squares are of three digits $a &lt;4$.But since $a&gt;b ,a \neq 1$.  $b=1 \Longrightarrow a^{2} \leq 9$.Then $a=1,2,3$ but only possibilities are $2 $ and $3$.  $b=2 \Longrightarrow a^{2} \leq 12 \Longrightarrow a= 1,2,3$. But possibility is $a=3$. So next such pair will be $13,31$.  Higher values of $b$ will not work since $a$ cannot exceed 3. This is an explanation we obtained from a mathematics group.It works well if the square is a three digit number.What will happen if square is a 4 digit number... Or if we try to extend this problem for numbers having more than two digits ?
21165
How to simplify this best  $(a_1 + a_2 +a_3+... +a_n)^m$ for  $m=n, m&lt;n, m&gt;n$  I could only get  $\sum_{i=0}^{m}\binom{m}{i}a_i^i\sum_{j=0}^{m-i}\binom{m-i}{j}a_j ... $
57367
I know the following theorems:   A number can be represented as a sum of two squares precisely when $N$ is of the form $n^2 \prod p_i$ where each $p_i$ is a prime congruent to 1 mod 4 If the equation $a^2 + 1 \equiv a (\text {mod} p)$ is solvable for some $a$, then $p$ can be represented as a sum of two squares.  A positive integer $n$ is the sum of two squares iff each prime factor $p$ of $n$ such that $ p \equiv 3 (\text{mod} 4)$ occurs to an even power in the prime factorization of $n$   My problem is often which one to use and exactly how to use it.  Here is an example of a question:  Determine whether the following integers can be written as the sum of two squares. a) 363 b) 700 c) 34300 d) 325  For example, I figures 363 can not be written as a sum of two squares as it is of the form $4k +3$ where $k = 90$  For 700, which is not in the above stated form, I found $ 700 =2^2 \cdot 5^2 \cdot 7$ and 7 is the only factor $ p \equiv 3 mod 4$ and it is definitely not to an even power. Does this mean I'm done showing it is not the sum of two squares?  c) $34300 = 7^3 \cdot 5^2 \cdot 2^2$; again the power of 7 is not even.  d) Then I have $325 = 13 \cdot 5^2$ which has no prime factors congruent to 3 modulo 4. BUT $325 = 5^2(13)$ where $13 \equiv 1 mod 4$ and 5 is the $n$ mentioned in the first theorem. Is this enough to conclude that 325 is a sum of two squares?
65880
I just started to read "Friendly Introduction to Number Theory" but I am getting stuck in the first exercises.     1.1. The first two numbers that are both squares and triangles are 1 and 36. Find the next one and, if possible, the one after that. Can   you figure out an efficient way to find triangular–square numbers? Do   you think that there are infinitely many?     I found how to find out the number which is both square and triangle. (don't know if this is effective way)    However how can I answer "Do you think that there are infinitely many?"? I think I need to find the formula but no idea yet. Can you please help me?
57457
I'm reading "A friendly introduction to number theory" and I'm stuck in this exercise, I'm mentioning this because what I need is a basic answer, all I know about primitive pythagorean triplets is they satisfy $a^2 + b^2 = c^2$ and a, b and c has no common factors.  Now.. my approach (probably kind of silly) was to "classify" the odd numbers (not divisible by 3) as $6k+1$, $6k+2$ and $6k+5$, and the even numbers with $6k+2$ and $6k+4$, then, trying different combinations of that, I could probe all the cases when I assume c is not 3 divisible, but I still have to probe that c cannot be 3 divisible and I don't know how to do it.  Anyway, probably there is a better simpler solution.  (Sorry, if this is a stupid question, I'm trying to teach myself number theory without much math background)
115222
For example $151x - 294\equiv 44\pmod 7 $. How would I go about solving that?  The answer says to simplify it into the $ax\equiv b\pmod c $ form first, but I have no clue on how to get rid of the $294$... help?
14153
I want to know the general formula for $\sum_{n=0}^{m}nr^n$ for some constant r and how it is derived.  For example, when r = 2, the formula is given by: $\sum_{n=0}^{m}n2^n = 2(m2^m - 2^m +1)$ according to   Thanks!
122267
I still haven't quite realized how to solve binomial coefficient problems like this, can someone show me an elaborated way of solving this?  I need to write this expression in a more simplified way: $\sum_{k=0}^{10} k \pmatrix{10 \\ k}\pmatrix{20 \\ 10-k}$  I'm aware of the binomial identity $\sum_{k=i}^{n-j}\binom{k}{i}\binom{n-k}{j}=\binom{n+1}{j+1}$  Just can't seem to see how to use it.  Many thanks.
114686
How to deal with $m+\frac{4}{m^2}\geq3$ for every $m &gt; 0$ ? I multiplied both sides by $m^2$ and got $m^3+4-3m^2\geq0$ and have no idea how to continue with this