User:Wim Coenen/sandbox

= Is A^(p-1)-B^(p-1) divisible by p? = $$A,B,p,q$$ are whole numbers.

$$p$$ is a prime number.

$$A\neq qp$$

You choose a random number $$B$$.

Then there is always a number $$A=B+p$$

$$A=B+p$$

$$\frac{A^{p-1}-B^{p-1}}{p}=\frac{(B+p)^{p-1}-B^{p-1}}{p}$$

$$\frac{A^{p-1}-B^{p-1}}{p}= \frac{\textstyle\sum_{k=0}^{p-1} \displaystyle\tbinom{p-1}{k}{B^{p-1-k}p^k-B^{p-1}}}{p}$$

$$\frac{A^{p-1}-B^{p-1}}{p}= \frac{\textstyle\sum_{k=1}^{p-1} \displaystyle\tbinom{p-1}{k}{B^{p-1-k}p^k+B^{p1}-B^{p-1}}}{p}$$

$$\frac{A^{p-1}-B^{p-1}}{p}= \frac{\textstyle\sum_{k=1}^{p-1} \displaystyle\tbinom{p-1}{k}{B^{p-1-k}p^k}}{p}$$

$$\frac{A^{p-1}-B^{p-1}}{p}= \textstyle\sum_{k=1}^{p-1} \displaystyle\tbinom{p-1}{k}{B^{p-1-k}p^{k-1}}$$

$$A^{P-1}-B^{p-1}$$ is divisible by $$p$$.

= Is A^(p-1)-B^(p-1) divisible by p. A different path. = $$A,B,p,q$$ are whole numbers.

$$p$$ is a prime number.

$$A\neq qp$$

There is a number $$A=p+q$$ and there is a number $$B=p-q$$.

$$A=p+q$$

$$B=p-q$$

$$\frac{A^{p-1}-B^{p-1}}{p}=\frac{(p+q)^{p-1}-(p-q)^{p-1}}{p}$$

$$\frac{A^{p-1}-B^{p-1}}{p}= \frac{\textstyle\sum_{k=0}^{p-1} \displaystyle\tbinom{p-1}{k}{p^kq^{p-1-k}}- {\textstyle\sum_{k=0}^{p-1} \displaystyle\tbinom{p-1}{k}{p^k(-q)^{p-1-k}}} }{p}$$

$$\frac{A^{p-1}-B^{p-1}}{p}= \frac{\textstyle\sum_{k=1}^{p-1} \displaystyle\tbinom{p-1}{k}{p^kq^{p-1-k}}- {\textstyle\sum_{k=1}^{p-1} \displaystyle\tbinom{p-1}{k}{p^k(-q)^{p-1-k}+q^{p-1}-(-q)^{p-1}}} }{p}$$

$$\frac{A^{p-1}-B^{p-1}}{p}= \textstyle\sum_{k=1}^{p-1} \displaystyle\tbinom{p-1}{k}{p^{k-1}q^{p-1-k}}- {\textstyle\sum_{k=1}^{p-1} \displaystyle\tbinom{p-1}{k}{p^{k-1}(-q)^{p-1-k}}}$$

$$A^{P-1}-B^{p-1}$$ is divisible by $$p$$.

= Fermat's little theorem unravelled. =

$$A,B,p,q,r$$ are whole number s.

p is a prime number.

Here is the proof that $$A^{p-1}-1$$ is divisible by $$p$$. $$\frac{A^{p-1}-1}{p}=?$$

$$\frac{A^{p-1}-1^{p-1}}{p}=\frac{A^{p-1}-B^{p-1}}{p}$$

$$\frac{A^{p-1}-B^{p-1}}{p}=\frac{(p+q)^{p-1}-(p+r)^{p-1}}{p}$$

$$\frac{A^{p-1}-1^{p-1}}{p}=\frac{(p+q)^{p-1}-\{p+(-p+1)\}^{p-1}}{p}$$

$$\frac{A^{p-1}-1}{p}=\frac{\sum_{k=0}^{p-1}\binom{p-1}{k}p^{p-1-k}q^k-\sum_{k=0}^{p-1}\binom{p-1}{k}p^{p-1-k}(-p+1)^k}{p}$$

$$\frac{A^{p-1}-1}{p}=\sum_{k=0}^{p-1}\binom{p-1}{k}p^{p-2-k}q^k-\sum_{k=0}^{p-1}\binom{p-1}{k}p^{p-2-k}(-p+1)^k$$

$$\frac{A^{p-1}-1}{p}=\sum_{k=0}^{p-1}\binom{p-1}{k}p^{p-2-k}\{q^k-(-p+1)^k\}$$

The following is worth mentioning..

$$\binom{p-1}{p-1}p^{p-2-(p-1)}\{q^{p-1}-(-p+1)^{p-1}\}= \frac{\binom{p-1}{p-1}\{q^{p-1}-(-p+1)^{p-1}\}}{p} $$

$$\{q^{p-1}-(-p+1)^{p-1}\} $$ is divisible by $$p $$

= Analytical proof: Binomial development = $$(a+b)^n=\textstyle \sum_{k=0}^{n}\displaystyle\binom{n}{k}a^{n-k}b^k$$

$$(a+b)^{n+1}= (a+b)(a+b)^n= (a+b)\textstyle \sum_{k=0}^{n}\displaystyle\binom{n}{k}a^{n-k}b^k$$

$$(a+b)^{n+1}= a\textstyle \sum_{k=0}^{n}\displaystyle\binom{n}{k}a^{n-k}b^k+ b\textstyle \sum_{k=0}^{n}\displaystyle\binom{n}{k}a^{n-k}b^k$$

$$(a+b)^{n+1}= \textstyle \sum_{k=0}^{n}\displaystyle\binom{n}{k}a^{n+1-k}b^k+ \textstyle \sum_{k=0}^{n}\displaystyle\binom{n}{k}a^{n-k}b^{k+1}$$

$$\textstyle \sum_{k=0}^{n}\displaystyle\binom{n}{k}a^{n-k}b^{k+1}= \textstyle \sum_{k=1}^{n+1}\displaystyle\binom{n}{k-1}a^{n+1-k}b^{k}$$

$$(a+b)^{n+1}= a^{n+1}+\textstyle \sum_{k=1}^{n}\displaystyle\binom{n}{k}a^{n+1-k}b^k+ \textstyle \sum_{k=1}^{n}\displaystyle\binom{n}{k-1}a^{n+1-k}b^{k}+b^{n+1}$$

$$(a+b)^{n+1}= a^{n+1}+\textstyle \sum_{k=1}^{n}\biggl(\displaystyle\binom{n}{k}+ \binom{n}{k-1}\biggr)a^{n+1-k}b^k+b^{n+1}$$

$$\binom{n}{k}+\binom{n}{k-1}=\frac{n!}{(n-k)!k!}+\frac{n!}{(n-k+1)!(k-1)!}$$ $$\binom{n}{k}+\binom{n}{k-1}=\frac{n!(n-k+1)}{(n-k)!k!(n-k+1)}+\frac{n!k}{(n-k+1)!(k-1)!k}$$ $$\binom{n}{k}+\binom{n}{k-1}=\frac{{(n+1)}!}{(n+1-k)!k!}=\binom{n+1}{k}$$

$$(a+b)^{n+1}= a^{n+1}+\textstyle \sum_{k=1}^{n}\displaystyle\binom{n+1}{k}a^{n+1-k}b^k+b^{n+1}$$

$$(a+b)^{n+1}= \binom{n+1}{0}a^{n+1}b^0+\textstyle \sum_{k=1}^{n}\displaystyle \binom{n+1}{k}a^{n+1-k}b^k+\binom{n+1}{n+1}a^{n+1-(n+1)}b^{n+1}$$

$$(a+b)^{n+1}= \textstyle \sum_{k=0}^{n+1}\displaystyle\binom{n+1}{k}a^{n+1-k}b^k$$