# all prime numbers have irrational square roots [duplicate]

How can I prove that all prime numbers have irrational square roots?

My work so far: suppose that a prime p = a*a then p is divisible by a. Contradiction. Did I begin correctly? How to continue?

-

## marked as duplicate by 23rd, user1337, Daniel Rust, egreg, TZakrevskiyDec 5 '13 at 19:17

The work so far is not correct. You need to suppose that $p=\left(\frac{a}{b}\right)^2$, where $a$ and $b$ are integers (with naturally $b\ne 0$). Probably you will also want to say that without loss of generality $a$ and $b$ have no common factor greater than $1$. –  André Nicolas Dec 5 '13 at 18:04

The standard proof for $p=2$ works for any prime number.

-
How (I see that it does, but why formally does that work?) –  Alec Teal Dec 5 '13 at 18:01
@AlecTeal Because $p\mid a^2\implies p\mid a$ for $p$ a prime. –  Pedro Tamaroff Dec 5 '13 at 18:02
Sure, just so simply write up infinitely many proofs.... –  Adam Dec 5 '13 at 18:04
@Adam What...? ${}{}{}$ –  Pedro Tamaroff Dec 5 '13 at 18:09
@PedroTamaroff I think Adam should write up infinitely many proofs -- he might learn something. –  Igor Rivin Dec 5 '13 at 18:10

Note that this answer is included only so it is clear what Igor Rivin meant by standard proof:

$$\sqrt p = \frac a b$$ where $a$ and $b$ are co-prime (the fraction is reduced) and $p$ is prime. $$b^2 p = a^2$$ as $a^2$ must disible by $p$ means $a$ must be divisible by $p$ $$b^2 = p c^2$$ where $c=\frac p a$

This will result in the fact that $b$ must also be divisble by $p$ which is a contraction of the fact that $a$ and $b$ are co-prime.

Please try this with $p = 4$ and see where is breaks down.

-
We assumed what? –  Adam Dec 5 '13 at 18:13
@kaine I misread something. I apologize. =) –  Pedro Tamaroff Dec 5 '13 at 18:15
Adam, the assumptions are that p is prime and the $\frac a b$ is in it's simplist form, aka it cannot be $\frac 4 2$ as that would reduce to $\frac 2 1$. –  kaine Dec 5 '13 at 18:16
I think Kaine's proof is correct. –  Adam Dec 5 '13 at 18:20
@Adam you should probably accept Mr. Rivin answer then, my answer is just clarification of his in case it was not clear what he meant. –  kaine Dec 5 '13 at 18:23

$p=a^2/b^2\implies a^2=pb^2$. The number of prime factors of $a^2$ is even whereas the numbers of prime factors of $pb^2$ is odd.

-

Your attempt only shows that the square root of a prime is not an integer.

-
I am aware of the fact. –  Adam Dec 5 '13 at 18:04