Talk:Fermat's little theorem

Proof?
I think it should be great to include a proof of the theorem in the article. If it is then sorry. — Preceding unsigned comment added by Santropedro1 (talk • contribs) 04:05, 14 June 2013 (UTC)

Division form section
I want to introduce the usage of $$p^k|(x^p-x)^k$$.Should it belongs to Fermat's little theorem?--Tttfffkkk (talk) 00:13, 22 September 2015 (UTC)

$$p|x^p-x \Rightarrow p^k|(x^p-x)^k$$


 * 1) $$\displaystyle x^{pk} \equiv \sum_{i=1}^k (-1)^{i-1} \binom{k}{i} x^{pk-(p-1)i} \pmod {p^k}$$
 * 2) $$\displaystyle x^{pk+(p-1)n} \equiv \sum_{i=1}^k (-1)^{i-1} \binom{n+i-1}{i-1} \binom{n+k}{k-i} x^{pk-(p-1)i} \pmod {p^k}$$

The related journal is written in Chinese.--Tttfffkkk (talk) 04:30, 23 September 2015 (UTC)


 * What you are describing here are direct computational applications of Fermat's little theorem (the first is no more than an application of the binomial theorem). The other applications mentioned in the article were notable mathematical results and I fail to see how these formulae would be considered notable. References written in other languages are not prohibited, but should be limited to material that is not available in English or of significant notability in its own right (neither of which would be true in this case). Also, this reference is a newly published (2015) primary source and the Wikipedia preference is for reliable secondary sources. I do not see how this addition could be improved to make it a reasonable contribution to this article. Bill Cherowitzo (talk) 19:00, 23 September 2015 (UTC)


 * Thanks for replying.Everyone would prefer using Euler's theorem than copying this long summation. The only advantage of this method is that the degree of divisor pk is lower than $$\varphi(p^k)$$.So that at least you can use this method after using Euler's theorem(If not,this long summation would be totally useless).You can make the degree much more lower by $$x(x+1)...(x+n-1)$$(reach to Kempner function),but the formula of remainder is too big.--Tttfffkkk (talk) 01:16, 24 September 2015 (UTC)

Translation
• Et cette proposition est généralement vraie en toutes progressions et en tous nombres premiers; de quoi je vous envoierois la démonstration, si je n'appréhendois d'être trop long.

• (And this proposition is generally true for all series and for all prime numbers; the proof of which I would send to you, if I did not fear it being too long.)

I believe anyone familiar with Middle French & with English would think that "if I did not fear being too long" would be a better translation than the one proposed. However, the source of the translation offered is given as a reference. I don't know how to approach this from a Wikipedian point of view, and therefore I am reluctant to change it myself, but would still appreciate pointers as to what to do in a case like this. --66.185.60.38 (talk) 21:00, 16 January 2016 (UTC)


 * This is an interesting question! My French is not good enough to have an independent opinion about which of the two English translations is a closer approximation of the French original.  Here are my two cents:
 * I think that "the Wikipedian approach" (or really the approach of an encyclopedia) should be to follow reliable sources. Presumably the Ore book is generally reliable (though, maybe not for the quality of its French translations!) and presumably the quoted translation is actually what appears there (but I don't know, I don't have a copy), and in that case I think that this creates at least a small presumption in favor of following Ore's quote.
 * I think neither what is written already in the article nor the proposed alternative are exactly how I would phrase the given idea (in English); however, the proposed alternative sounds slightly less idiomatic to me. So, on grounds of what sounds good in English, I have a (very slight) preference for what is written.
 * I do not feel strongly about either point, obviously. And of course it would be good to check that we have actually reproduced the quote from Ore correctly.  If you would like other opinions (and if this comment doesn't attract them), possible places to ask would be the math project (which has many active editors) and the France project (which seems less active but is maybe more on point).  --JBL (talk) 15:56, 10 February 2016 (UTC)


 * Just to complicate matters somewhat, the quoted translation is not Ore's but rather the one given by Bergeron & Zhao. Ore's translation is not identical, but doesn't differ in any significant way. It is, "And this proposition is generally true for all series and all prime numbers. I would send you the demonstration, if I did not fear it being too long." This doesn't shed any light on the question at hand (and my French is also not good enough for me to have an opinion on that). However, Ore does supply a translation of another two paragraphs of the letter, and even my untrained eye can tell that he is much closer to the original than Bergeron & Zhao are. This leads me to question the Bergeron & Zhao source, which does not appear to be published. Bill Cherowitzo (talk) 18:06, 10 February 2016 (UTC)


 * A couple of additional thoughts. Ore would be considered a reliable source, but his translation is being questioned. To bring this up in the article would require a reliable source that translated it the other way. This is a well known letter and I am sure that there must be other translations out there somewhere. I would like to get 's take on this, he might find this interesting enough to help locate some. Secondly, I am hesitant to rely on the Bergeron & Zhao cite. This does not strike me as a professional translation. An historian would try to translate into a version of English that is more contemporary with Fermat, or at least recalling the flavor of Middle French, instead of the modernized prose that we find here. Also, having no sources mentioned, it is hard to determine if transcription errors from the handwritten letter occurred or not. My overall feeling is that this may have been a student project. Bill Cherowitzo (talk) 21:06, 10 February 2016 (UTC)


 * There's this translation, which to me is closer to the original, but is unfortunately not sourced: https://en.wikiquote.org/wiki/Pierre_de_Fermat
 * • And this proposition is generally true for all progressions and for all prime numbers; the proof of which I would send to you, if I were not afraid to be too long.    --66.185.60.38 (talk) 21:43, 10 February 2016 (UTC)


 * It actually is pretty identical to the translation offered here: http://www.personal.psu.edu/jxs23/courses/math035/fa11/handouts/24_fermats_little_theorem.pdf . Good enough for the main article? --66.185.60.38 (talk) 21:46, 10 February 2016 (UTC)


 * Course notes wouldn't really work here (course notes from a math history class might) and Sellers hedges by say "One translation could be ...". I have uncovered another wrinkle in this story. In a 2005 article on Fermat, there is a quote from A. Weil's math history book concerning a letter written to Mersenne by Fermat. The verbatim quote is "he would send [the proof] to Frenicle if he did not fear [it] being too long." I interpret this as indicating that Fermat used the same phrase in this letter as he did in the Frenicle letter. That Weil chose to throw in the "it" for clarification may mean that Fermat's use of the phrase could be idiosyncratic and he might not mean exactly what he wrote. Fermat is well known (according to his biographer) for not supplying proofs, especially in number theory, and he might just be using this as a stock phrase to cover his tracks. Only a Fermat scholar would be able able to clarify this. Bill Cherowitzo (talk) 00:23, 11 February 2016 (UTC)


 * Sorry, I am not good for finding sources. However I can explain why the disputed translation is faulty. Firstly, there is no reason for for translating "progressions" by "series": both words exist in French and in English, with the same meaning in both languages. Certainly, the modern meaning of "progression" is not exactly the same as it was at the time of Fermat, but this is not a reason for changing the word. Moreover, "progression" clearly refers to the geometric progression of the powers of a. In other words, the theorem says that the geometric progression of basis a is periodic modulo p, of period p – 1, for all a and all prime p. Thus translating "progression" by "series" is definitively a misinterpretation.
 * The "it" is also a misinterpretation, suggesting that it is the proof that is too long. It is Fermat itself (implicitly its letter) who could be too long. In French (old and new), it is common to say "je suis trop long" (I am too long) for "my speech or my letter is too long". I do not know if "I am too long" is understood in English in the same way. If yes, "if I did not fear being too long" would be a good translation. In the other case, I suggest something like "if I did not fear [my letter] being too long".
 * Also, "appréhendois" is not a past, but a subjunctive. Thus "if I would not fear" is probably a better translation. However, my knowledge of English grammar is not enough to be sure. D.Lazard (talk) 23:35, 10 February 2016 (UTC)


 * Thanks. We had an edit conflict as I was typing my response above. Being "too long" is quite understandable in English as it corresponds to the phrase, "being long-winded" (i.e., saying too much). Your response re-enforces my feeling about the Bergeron & Zhao translation, but still leaves me wondering about Ore's translation (assuming he translated it himself). Bill Cherowitzo (talk) 00:23, 11 February 2016 (UTC)


 * "if I were not afraid to be too long." actually uses the subjunctive form. That's one more thing I liked about the version I proposed a few hours ago, compared to the one currently used. --66.185.60.38 (talk) 23:59, 10 February 2016 (UTC)


 * As an afterthought, if the "[it]" in the quote I gave was put in by the author (Israel Kleiner) and did not appear in A. Weil's book, then I would be inclined to believe that Ore got it wrong. Unfortunately, I don't have access to this book to check ... but if someone does it is, A. Weil, Number Theory: An approach through History, from Hammurapi to Legendre, Birkhauser, 1984, page 56. We would still need a reliable source for the translation. Bill Cherowitzo (talk) 05:05, 11 February 2016 (UTC)


 * I was able to see what Weil wrote, and there is no "[it]" in his statement. Weil can certainly be considered an authority when it comes to Fermat (his criticism of a biography of Fermat is worth reading) and needless to say, his French (and Latin for that matter) are impeccable. I am now pretty sure that Ore's translation is in error, but we still need a reliable secondary source for the correct translation (as some Wikipedians are fond of saying, the truth itself is not sufficient, we need verifiability). Bill Cherowitzo (talk) 19:03, 11 February 2016 (UTC)
 * Weil can also certainly be considered an authority for translating mathematics from French to English, as he was a native French speaker, who spent a large part of his career in USA. D.Lazard (talk) 19:35, 11 February 2016 (UTC)

Around Fermat's citation
The discussion in the preceding section has pointed to me that the sentence before Fermat's citation was wrong. For fixing it, I had to quote original Fermat's statement of the theorem and to provide a translation. This shows undoubtedly that Fermat used "progression" for geometric progression, and thus translating "progression" by "series" is a blatant mistake, probably caused by the ignorance of mathematics by the original translator. Therefore I have replaced "series" by "progression" in Ore translation. Nevertheless I strongly support replacing the whole translation, as suggested in the preceding thread. D.Lazard (talk) 16:57, 20 February 2016 (UTC)


 * I have finally found a reliable secondary source which translates the final phrase as, "...; I would send you a demonstration of it, if I did not fear going on for too long." I will make the change in the article. There is however, one problem. This translation, and every other translation I have seen, uses " ... generally true for all series and for all prime ...". I clearly see that Fermat uses "progression" here, so I agree with you, but am at a loss as to why this appears so uniformly (other uses of "progression" in the letter are translated as "progression", so this seems to be intentional). The author of this translation (Michael Mahoney) was criticized by Weil for making some translation errors in a review of the book, but this does not explain the consistent use of "series" by other translators.Bill Cherowitzo (talk) 19:31, 20 February 2016 (UTC)
 * I cannot answer to your question, but I may guess something: most sentences, where "progression" appear, contain mathematical statements that give hints for the meaning of the word. But here, taking this sentence out of the context, a reader, who is unable to understand that Fermat's little theorem is related with geometric progressions, cannot understand the word, and thus uses the word of the common language that seems (wrongly) to make more sense. I guess that many readers have copied this mistake only because the preceding sentence, that states the theorem, is rarely cited (I agree that it is rather difficult to understand, for a modern mathematician). This leads naturally to the wrong presentation, in the preceding version of the article, of what Fermat did wrote D.Lazard (talk) 19:57, 20 February 2016 (UTC).

Miller-Rabin: k non-conclusive tests
The article claims that since each test would reveal a non-prime with probability 3/4, conducting enough random tests brings the probability of revealing a non-prime arbitrarily close to 1. That logic would be fine if there were infinitely many tests to choose from. But each test starts with choosing a number a between 1 and p, so there are fewer than p tests to choose from. Therefore, the best probability of revealing a non-prime is about 1 - (1/4)^p, not 1 as the article says. Admittedly in practice, we only need to use the primality test on large numbers, so the probability of revealing a non-prime with repeated tests is quite close to 1.

We should edit the incorrect statement. I haven't yet done so because I have yet to find an authoritative source. CautiousTiger (talk) 20:21, 1 January 2018 (UTC)
 * Miller–Rabin primality test says: "It can be shown that for any odd composite n, at least 3/4 of the bases a are witnesses for the compositeness of n". That's the reason for this in Fermat's little theorem: "If $p$ is not prime, the probability that this is proved by the test is higher than 1/4." It means that if you test 1/4 of all a without finding a witness then n is certain to be prime. Making this many tests would be extremely slow compared to other primality proving methods so it's not done in practice. PrimeHunter (talk) 23:25, 1 January 2018 (UTC)
 * Ah, thanks for clearing up my confusion. Should we delete this section of the talk page now? CautiousTiger (talk) 01:48, 2 January 2018 (UTC)
 * no, there is no reason not to leave it as-is. --JBL (talk) 02:16, 2 January 2018 (UTC)

Recent edits
Seems like we've had a misunderstanding about recent edits on this article; what exactly did you feel the need to revert? Armadillopteryxtalk 19:49, 8 March 2018 (UTC)
 * To address at least what was written in your edit summary: Prior to my edits, there were numerous equations, especially in the lede, that were written half in math mode and half in plaintext. Sizes of numbers and variables were different, spacing around operators was inconsistent, and it was overall pretty messy IMHO. I've made the presentation uniform by putting all equations into TeX. Also, I didn't make any modifications to gendered nouns, so I'm not quite sure what you meant by that. Look forward to chatting.

Armadillopteryxtalk 19:56, 8 March 2018 (UTC)
 * For the record, "confidante" can, in English, refer to either gender, while "confidant" is exclusively male. I'm not bothered if you prefer "confidant," though. Armadillopteryxtalk 20:13, 8 March 2018 (UTC)


 * Hi Armadillopteryx,
 * It is a perennial problem on Wikipedia that the math formatting options are not ideal. But this is also true of LaTeX: its font, sizing, and baseline do not typically match surrounding text (depending in part on choice of browser etc.), and it is particularly jarring (as compared with the mvar or math templates, or even just italicization) when single inline variables are placed in  tags.  Hopefully, there will eventually be a long-term solution that can be implemented consistently everywhere; until that time, doing large-scale formatting changes is at best not worth the effort.
 * In addition, you changed the masculine noun "confidant" into the feminine form "confidante" in a situation in which it referred to a man, and many of your other edits (removing the phrase "in modern terminology", including grammatical square brackets into a mathematical formula, replacing "It is called the "little theorem"" with "It is called Fermat's little theorem") strike me as clear dis-improvements. Added after edit conflict: you are obviously mis-reading the Miriam--Webster entry, it says nothing like what you claim.  If anything, you have it completely backwards.
 * On the LaTeX question we could certainly seek additional opinions at e.g. WT:WPM; about the other edits, I would be willing to discuss them one by one if you think I am lumping something good in unfairly.
 * JBL (talk) 20:22, 8 March 2018 (UTC)
 * Hi ,
 * It is also jarring to have equations that include variables and numbers that are inconsistently sized and spaced, and for that reason I find it preferable to put all math characters into TeX; otherwise we have inconsistency not only between lines, but also within equations. When there are already some math characters or equations in math mode in the prose, it is therefore most consistent to keep them all in the same mode so they at least appear the same as one another.
 * If you read the Merriam-Webster definition carefully, it lists confidant as the very definition of confidante, with the added information that it is especially (but not exclusively!) used to refer to a female confidant. But as I said above, since both are acceptable, I'm fine with confidant.
 * Since we're translating dated French into modern English, the qualifier "in modern terminology" is superfluous. It would be relevant if translating, for example, Old English to Modern English or Old French to Modern French.
 * I changed plaintext brackets to math brackets because the first (and last) bracketed characters were in math mode, and as I'm sure you're aware, plaintext brackets are a few font sizes smaller than the math ones and look too small when next to something in math mode.
 * Fermat's little theorem is never referred to as the little theorem. Have you seen that anywhere?
 * Respectfully, I disagree with each point you've said and feel the article is in worse shape now than after my edits, but I am happy to continue this conversation until we reach a solution we both like. Armadillopteryxtalk 20:38, 8 March 2018 (UTC)
 * Since I didn't mention it above, I'll also just clarify that I agree it could be useful to seek additional opinions about the LaTeX questions at WT:WPM, as it could benefit this and numerous other articles. Armadillopteryxtalk 21:47, 8 March 2018 (UTC)
 * I must agree with JBL, I do not find these edits to be an improvement. If this were a true LaTeX implementation, I would agree with the conversions, but as Joel has pointed out the in-line TeX does not really work well with the sans serif typeface of the prose, especially with alignment and font size. Your reaction to the little theorem is clearly over the top. No one, as far as I can tell, has called this the little theorem. The remark was put in to explain where little comes from and not to provide an alternate name.--Bill Cherowitzo (talk) 22:17, 8 March 2018 (UTC)
 * Hi, thanks for your reply. I'm certainly willing to further discuss the LaTeX question, as it does ultimately boil down to preference and doesn't have a strictly right or wrong answer. As far as the changes in prose, I maintain that my edits were improvements for the reasons I've outlined above (with the exception of confidant, which I've also said is fine as is). I know that the intention behind the "little theorem" remark was simply to distinguish it from Fermat's last theorem, but strictly speaking, the sentence as stated now is semantically incorrect, because it does state that the theorem is called "the little theorem." The intention is clear, but especially in a mathematical article I think we ought to be rigorous in what we say and not let things slide because one can see "what was meant." Armadillopteryxtalk 22:24, 8 March 2018 (UTC)
 * When I am writing a mathematical article for a mathematical audience, rigor is paramount, period. However, that is not what we are doing here, we are writing an encyclopedia for a general audience (with, hopefully, a modicum of mathematical sensibility). This requires different priorities, and rigor loses its primary place. The rigor, that we as mathematicians thrive on, is thoroughly off-putting for a general audience; and if you lose your audience, who exactly is it that you are writing for? I am not saying that we toss rigor in this kind of writing–when things get too sloppy I start red-penciling like a crazyman–but it has to be softened and we must let some things slide, especially if they are not crucial and the general meaning is clear.--Bill Cherowitzo (talk) 22:46, 8 March 2018 (UTC)
 * I agree with you that clarity and accessibility to the widest possible audience is paramount on Wikipedia. That is especially true for mathematical articles, to which young students often turn for help understanding what they've learned in class. In the case of this "little theorem" remark, which I'm sure we can all agree is extraordinarily minor in any case, I would still hold that my edit increases clarity, or at very least is neutral with respect to clarity. In cases like this, where there is not a trade-off between rigor and clarity, why let the rigor slip with no real benefit? I'm not going to get hung up on that particular detail of this article, but I responded to it earlier since both you and JBL commented on it.


 * Since we're on the subject of clarity, I would like to note that the mass revert done on my edits also removed several small changes in wording that I made specifically to make the material more readable and easier to grasp for less initiated readers. There were also some stylistic mistakes I fixed, for example one paragraph in French that is not italicized (as it should be per MOS:ITAL and as the other French text in the article already is).


 * I think we all share the desire for the prose to be high-quality and straightforward, and I'm glad we're talking about it here. Armadillopteryxtalk 22:56, 8 March 2018 (UTC)
 * I've put in some corrections in grammar, format and style, with a couple of clarity edits as well. If you would like to continue to discuss LaTeX here (or at WT:WPM, as JBL suggested), I would participate. If consensus on this article is to keep the TeX use to a minimum, though, I can respect that. Armadillopteryxtalk 22:27, 9 March 2018 (UTC)


 * The previous edits made it very difficult to preserve some of the good edits that you made. I am happy with these current edits. While there are a few edits that I don't think are necessary, these are all style issues that can go either way and I do not see anything that needs fixing. The LaTeX issue has been discussed for years and is a sore point shared by all the serious math editors. I'd suggest reading some of the archived discussions at WT:WPM dealing with it before trying to re-open that can of worms. --Bill Cherowitzo (talk) 00:18, 10 March 2018 (UTC)
 * Thanks, Bill. Guess I'll start digging through the archives :-D Armadillopteryxtalk 01:43, 10 March 2018 (UTC)

(ec) Ok, spring break has started; here is a complete list of the things I disagree with as between the current version and the one I last reverted to.
 * 1) I object to removing "in modern terminology": this phrase is important and should be restored.  The translated text is not simply a translation of Fermat from 17th century French to modern English; it is also (separately) translated from archaic mathematical terminology into modern mathematical terminology and notation.
 * 2) I object to most of the edits to said translation: the comma after "that is" and the replacement of "multiple" with "multiples" are improvements; the others change notation and punctuation that Fermat used and that are understandable and unobjectionable, which makes it harder to compare the original and the translation for no benefit.
 * 3) I don't care about "entitled" versus "titled", but the added comma in that sentence breaks the flow unnecessarily.
 * 4) You have changed one instance of "Theorem" to "theorem" inside a quote; that should be restored.
 * 5) In general it is not necessary to add "it" in a construction of the following form: "A is B, and [it] is also C", and in both cases you have done so I think it reads more poorly afterwards.

Two additional notes: about "the 'little theorem'" (which you have not changed after I objected even though I didn't explain; thank you): I agree with Bill that this phrasing emphasizes the key point being made in the sentence (why the adjective little is used) while the alternative obscures it. I also personally don't like using capital letters after colons, but I don't care so much that I have tried to find out if WP:MOS has a preference for one option over the other.

Finally, obviously this is not every change you made. Some of the remainder I am indifferent about, and some are clear improvements, and obviously I have not bothered to point out the good ones, leaving this comment with an overall negative tone. So, my apologies for that, and also for blanket-reverting earlier when I did not have the time to be more careful. --JBL (talk) 00:35, 10 March 2018 (UTC)
 * Thanks for your comment, and no worries about the tone. I'll respond to your points in order:


 * 1) I don't have a strong preference about this one. I think that even when referring to dated mathematical terminology, since that terminology is in a foreign language in this article, the "in modern terminology" comment won't help most readers (who probably don't speak French). But it also doesn't hurt (apart from making the sentence longer), so if you prefer to add it back, I'm okay with that.
 * 2) I changed "–1" to "minus one" because I feel it could be confusing to some readers that the entity being described (a power minus one) is half in prose and half in numerals. Especially since this isn't an official translation and we have included the original text for comparison (and since most readers of the English article will probably skip the French text), I think this edit improves clarity. But here as well, my preference is not strong, and if you want to restore the numerals, I won't complain. As for the "[divides $p – 1$]; and after ... " part, I broke this into two sentences since it isn't grammatical for the "and after ... " portion to follow a semicolon in English. I don't think it makes a tangible difference in the ease of comparing the two texts, either. Therefore, I would prefer to keep this as a new sentence in the translation.
 * 3) I think the comma improved the flow of the sentence, but as the sentence is grammatical both with and without it, my preference is again small.
 * 4) "Theorem" was capitalized in the original German because all nouns are capitalized in German, but that convention is not normally preserved when translating non-proper nouns into English. Note that in the same sentence, "group" and "part" were also capitalized in the original but are not capitalized in the translation.
 * 5) In sentences of the "A is B, and [it] is also C" form, the "it" and the comma go hand in hand. So both of the following are correct:
 * 6) "A is B, and it is also C."
 * 7) "A is B and is also C."
 * But the following (the way it was) is not correct: "A is B, and is also C."
 * If you don't like the flow of the sentences in this article with the added "it," how about the comma-free alternatives?
 * Indeed, the "if" part is true and is a special case of Fermat's little theorem.
 * However, a slightly stronger form of the theorem is true and is known as Lehmer's theorem.
 * I'm equally happy with these and the "comma–it" versions.
 * As for capital letters after colons, that's also a matter of preference. When a dependent clause is introduced after a colon, it must begin with a lowercase letter. However, when the clause after the colon is independent, either a capital or lowercase letter may be used, so I'm also fine with either option here.
 * How does this all sound to you? Armadillopteryxtalk 01:24, 10 March 2018 (UTC)

Caceres conjecture
I removed the conjecture, dated this month, as we can find a contradiction in Carmichael number. — Arthur Rubin (talk) 04:32, 15 May 2019 (UTC)


 * Thank you! I was in the process of removing it when you just barely beat me to it.  All the edits to insert it had no edit summary and the conjecture appears to be recent original research. — Anita5192 (talk) 04:47, 15 May 2019 (UTC)

Fermat's little theorem unravelled.
$$A,B,p,q,r$$ are whole number s.

p is a prime number.

Is $$A^{p-1}-1$$ 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 $$.

Wim Coenen (talk) 18:03, 7 January 2023 (UTC)

Adding to Fermat's little theorem unravelled.
$$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$$.

Wim Coenen (talk) 19:36, 7 January 2023 (UTC)