Checking whether a number is prime or not











up vote
3
down vote

favorite
2













Is it true that a natural number $n>1$ is prime if and only if $n|left ( frac{1+sqrt{5}}{2} right )^n+left ( frac{1-sqrt{5}}{2} right )^n-1$?




We know that $11$ is a prime number, but let us assume that we do not know, and let us also assume that the statement is true;



$$left ( frac{1+sqrt{5}}{2} right )^{11}+left ( frac{1-sqrt{5}}{2} right )^{11}-1=198.$$



Clearly, $11|198$. Therefore, as our assumption that the statement is true, the number $11$ is a prime number.










share|cite|improve this question




















  • 1




    But $18|198$ and $18$ is not prime.
    – saulspatz
    23 hours ago










  • en.wikipedia.org/wiki/…
    – lab bhattacharjee
    23 hours ago






  • 1




    @Russ No, $71$ works. Note: it's easy to avoid overflow here, at least for a specific prime. The sequence $L_n$ is defined by $L_0=2,L_1=1, L_n=L_{n-1}+L_{n-2}$. If you are interested in $p=71$ then you can just compute this $pmod {71}$ for which all the numbers are small. We get $L_{71}equiv 1 pmod {71}$. as desired. (the numbers we are checking are $L_n-1$)
    – lulu
    23 hours ago












  • Thanks, @lulu. One important point to the original poster - the "only if" part is not necessarily true; per Robert Z's answer below, 705 passes the test, but is not prime. Otherwise, this would be a deterministic test of primes, right?
    – Russ
    23 hours ago










  • @Russ Yes, that's my understanding.
    – lulu
    23 hours ago















up vote
3
down vote

favorite
2













Is it true that a natural number $n>1$ is prime if and only if $n|left ( frac{1+sqrt{5}}{2} right )^n+left ( frac{1-sqrt{5}}{2} right )^n-1$?




We know that $11$ is a prime number, but let us assume that we do not know, and let us also assume that the statement is true;



$$left ( frac{1+sqrt{5}}{2} right )^{11}+left ( frac{1-sqrt{5}}{2} right )^{11}-1=198.$$



Clearly, $11|198$. Therefore, as our assumption that the statement is true, the number $11$ is a prime number.










share|cite|improve this question




















  • 1




    But $18|198$ and $18$ is not prime.
    – saulspatz
    23 hours ago










  • en.wikipedia.org/wiki/…
    – lab bhattacharjee
    23 hours ago






  • 1




    @Russ No, $71$ works. Note: it's easy to avoid overflow here, at least for a specific prime. The sequence $L_n$ is defined by $L_0=2,L_1=1, L_n=L_{n-1}+L_{n-2}$. If you are interested in $p=71$ then you can just compute this $pmod {71}$ for which all the numbers are small. We get $L_{71}equiv 1 pmod {71}$. as desired. (the numbers we are checking are $L_n-1$)
    – lulu
    23 hours ago












  • Thanks, @lulu. One important point to the original poster - the "only if" part is not necessarily true; per Robert Z's answer below, 705 passes the test, but is not prime. Otherwise, this would be a deterministic test of primes, right?
    – Russ
    23 hours ago










  • @Russ Yes, that's my understanding.
    – lulu
    23 hours ago













up vote
3
down vote

favorite
2









up vote
3
down vote

favorite
2






2






Is it true that a natural number $n>1$ is prime if and only if $n|left ( frac{1+sqrt{5}}{2} right )^n+left ( frac{1-sqrt{5}}{2} right )^n-1$?




We know that $11$ is a prime number, but let us assume that we do not know, and let us also assume that the statement is true;



$$left ( frac{1+sqrt{5}}{2} right )^{11}+left ( frac{1-sqrt{5}}{2} right )^{11}-1=198.$$



Clearly, $11|198$. Therefore, as our assumption that the statement is true, the number $11$ is a prime number.










share|cite|improve this question
















Is it true that a natural number $n>1$ is prime if and only if $n|left ( frac{1+sqrt{5}}{2} right )^n+left ( frac{1-sqrt{5}}{2} right )^n-1$?




We know that $11$ is a prime number, but let us assume that we do not know, and let us also assume that the statement is true;



$$left ( frac{1+sqrt{5}}{2} right )^{11}+left ( frac{1-sqrt{5}}{2} right )^{11}-1=198.$$



Clearly, $11|198$. Therefore, as our assumption that the statement is true, the number $11$ is a prime number.







number-theory elementary-number-theory prime-numbers






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited 23 hours ago









Robert Z

89.8k1056128




89.8k1056128










asked 23 hours ago









Hussain-Alqatari

1826




1826








  • 1




    But $18|198$ and $18$ is not prime.
    – saulspatz
    23 hours ago










  • en.wikipedia.org/wiki/…
    – lab bhattacharjee
    23 hours ago






  • 1




    @Russ No, $71$ works. Note: it's easy to avoid overflow here, at least for a specific prime. The sequence $L_n$ is defined by $L_0=2,L_1=1, L_n=L_{n-1}+L_{n-2}$. If you are interested in $p=71$ then you can just compute this $pmod {71}$ for which all the numbers are small. We get $L_{71}equiv 1 pmod {71}$. as desired. (the numbers we are checking are $L_n-1$)
    – lulu
    23 hours ago












  • Thanks, @lulu. One important point to the original poster - the "only if" part is not necessarily true; per Robert Z's answer below, 705 passes the test, but is not prime. Otherwise, this would be a deterministic test of primes, right?
    – Russ
    23 hours ago










  • @Russ Yes, that's my understanding.
    – lulu
    23 hours ago














  • 1




    But $18|198$ and $18$ is not prime.
    – saulspatz
    23 hours ago










  • en.wikipedia.org/wiki/…
    – lab bhattacharjee
    23 hours ago






  • 1




    @Russ No, $71$ works. Note: it's easy to avoid overflow here, at least for a specific prime. The sequence $L_n$ is defined by $L_0=2,L_1=1, L_n=L_{n-1}+L_{n-2}$. If you are interested in $p=71$ then you can just compute this $pmod {71}$ for which all the numbers are small. We get $L_{71}equiv 1 pmod {71}$. as desired. (the numbers we are checking are $L_n-1$)
    – lulu
    23 hours ago












  • Thanks, @lulu. One important point to the original poster - the "only if" part is not necessarily true; per Robert Z's answer below, 705 passes the test, but is not prime. Otherwise, this would be a deterministic test of primes, right?
    – Russ
    23 hours ago










  • @Russ Yes, that's my understanding.
    – lulu
    23 hours ago








1




1




But $18|198$ and $18$ is not prime.
– saulspatz
23 hours ago




But $18|198$ and $18$ is not prime.
– saulspatz
23 hours ago












en.wikipedia.org/wiki/…
– lab bhattacharjee
23 hours ago




en.wikipedia.org/wiki/…
– lab bhattacharjee
23 hours ago




1




1




@Russ No, $71$ works. Note: it's easy to avoid overflow here, at least for a specific prime. The sequence $L_n$ is defined by $L_0=2,L_1=1, L_n=L_{n-1}+L_{n-2}$. If you are interested in $p=71$ then you can just compute this $pmod {71}$ for which all the numbers are small. We get $L_{71}equiv 1 pmod {71}$. as desired. (the numbers we are checking are $L_n-1$)
– lulu
23 hours ago






@Russ No, $71$ works. Note: it's easy to avoid overflow here, at least for a specific prime. The sequence $L_n$ is defined by $L_0=2,L_1=1, L_n=L_{n-1}+L_{n-2}$. If you are interested in $p=71$ then you can just compute this $pmod {71}$ for which all the numbers are small. We get $L_{71}equiv 1 pmod {71}$. as desired. (the numbers we are checking are $L_n-1$)
– lulu
23 hours ago














Thanks, @lulu. One important point to the original poster - the "only if" part is not necessarily true; per Robert Z's answer below, 705 passes the test, but is not prime. Otherwise, this would be a deterministic test of primes, right?
– Russ
23 hours ago




Thanks, @lulu. One important point to the original poster - the "only if" part is not necessarily true; per Robert Z's answer below, 705 passes the test, but is not prime. Otherwise, this would be a deterministic test of primes, right?
– Russ
23 hours ago












@Russ Yes, that's my understanding.
– lulu
23 hours ago




@Russ Yes, that's my understanding.
– lulu
23 hours ago










1 Answer
1






active

oldest

votes

















up vote
4
down vote













Note that $left ( frac{1+sqrt{5}}{2} right )^n+left ( frac{1-sqrt{5}}{2} right )^n$ is the $n$-th Lucas number.



It is true that if $p$ is a prime then $L_p-1$ is divisible by $p$: $2$ divides $L_2-1=2$ and for any prime $p>2$,
$$L_p-1=frac{1}{2^{p-1}}sum_{k=1}^{(p-1)/2}binom{p}{2k}5^k=0pmod{p}$$
because $p$ divides each $binom{p}{2k}$.



On the contrary $705$ is not a prime but it divides $L_{705}-1$.



See Bruckman-Lucas_pseudoprimes and compare with the Wall-Sun-Sun prime.






share|cite|improve this answer























  • "... is divisible by $p^2$" by $p^2$ or by $p$? Note that $198$ is not divisible by $11^2=121$
    – Hussain-Alqatari
    23 hours ago










  • @Hussain-Alqatari Sorry, you are right!
    – Robert Z
    23 hours ago










  • @Hussain-Alqatari I edited my answer with the proof of the implication that holds..
    – Robert Z
    23 hours ago












  • Nice. Also note that the Bruckman definition for Lucas pseudoprimes is not used outside of his paper (Baillie and Wagstaff defined them over a decade earlier). Bruckman's pseudoprimes overlap substantially with strong pseudoprimes, so are not very useful for primality testing, unlike the earlier definition which is used in the very common BPSW primality test.
    – DanaJ
    14 hours ago











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3004854%2fchecking-whether-a-number-is-prime-or-not%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
4
down vote













Note that $left ( frac{1+sqrt{5}}{2} right )^n+left ( frac{1-sqrt{5}}{2} right )^n$ is the $n$-th Lucas number.



It is true that if $p$ is a prime then $L_p-1$ is divisible by $p$: $2$ divides $L_2-1=2$ and for any prime $p>2$,
$$L_p-1=frac{1}{2^{p-1}}sum_{k=1}^{(p-1)/2}binom{p}{2k}5^k=0pmod{p}$$
because $p$ divides each $binom{p}{2k}$.



On the contrary $705$ is not a prime but it divides $L_{705}-1$.



See Bruckman-Lucas_pseudoprimes and compare with the Wall-Sun-Sun prime.






share|cite|improve this answer























  • "... is divisible by $p^2$" by $p^2$ or by $p$? Note that $198$ is not divisible by $11^2=121$
    – Hussain-Alqatari
    23 hours ago










  • @Hussain-Alqatari Sorry, you are right!
    – Robert Z
    23 hours ago










  • @Hussain-Alqatari I edited my answer with the proof of the implication that holds..
    – Robert Z
    23 hours ago












  • Nice. Also note that the Bruckman definition for Lucas pseudoprimes is not used outside of his paper (Baillie and Wagstaff defined them over a decade earlier). Bruckman's pseudoprimes overlap substantially with strong pseudoprimes, so are not very useful for primality testing, unlike the earlier definition which is used in the very common BPSW primality test.
    – DanaJ
    14 hours ago















up vote
4
down vote













Note that $left ( frac{1+sqrt{5}}{2} right )^n+left ( frac{1-sqrt{5}}{2} right )^n$ is the $n$-th Lucas number.



It is true that if $p$ is a prime then $L_p-1$ is divisible by $p$: $2$ divides $L_2-1=2$ and for any prime $p>2$,
$$L_p-1=frac{1}{2^{p-1}}sum_{k=1}^{(p-1)/2}binom{p}{2k}5^k=0pmod{p}$$
because $p$ divides each $binom{p}{2k}$.



On the contrary $705$ is not a prime but it divides $L_{705}-1$.



See Bruckman-Lucas_pseudoprimes and compare with the Wall-Sun-Sun prime.






share|cite|improve this answer























  • "... is divisible by $p^2$" by $p^2$ or by $p$? Note that $198$ is not divisible by $11^2=121$
    – Hussain-Alqatari
    23 hours ago










  • @Hussain-Alqatari Sorry, you are right!
    – Robert Z
    23 hours ago










  • @Hussain-Alqatari I edited my answer with the proof of the implication that holds..
    – Robert Z
    23 hours ago












  • Nice. Also note that the Bruckman definition for Lucas pseudoprimes is not used outside of his paper (Baillie and Wagstaff defined them over a decade earlier). Bruckman's pseudoprimes overlap substantially with strong pseudoprimes, so are not very useful for primality testing, unlike the earlier definition which is used in the very common BPSW primality test.
    – DanaJ
    14 hours ago













up vote
4
down vote










up vote
4
down vote









Note that $left ( frac{1+sqrt{5}}{2} right )^n+left ( frac{1-sqrt{5}}{2} right )^n$ is the $n$-th Lucas number.



It is true that if $p$ is a prime then $L_p-1$ is divisible by $p$: $2$ divides $L_2-1=2$ and for any prime $p>2$,
$$L_p-1=frac{1}{2^{p-1}}sum_{k=1}^{(p-1)/2}binom{p}{2k}5^k=0pmod{p}$$
because $p$ divides each $binom{p}{2k}$.



On the contrary $705$ is not a prime but it divides $L_{705}-1$.



See Bruckman-Lucas_pseudoprimes and compare with the Wall-Sun-Sun prime.






share|cite|improve this answer














Note that $left ( frac{1+sqrt{5}}{2} right )^n+left ( frac{1-sqrt{5}}{2} right )^n$ is the $n$-th Lucas number.



It is true that if $p$ is a prime then $L_p-1$ is divisible by $p$: $2$ divides $L_2-1=2$ and for any prime $p>2$,
$$L_p-1=frac{1}{2^{p-1}}sum_{k=1}^{(p-1)/2}binom{p}{2k}5^k=0pmod{p}$$
because $p$ divides each $binom{p}{2k}$.



On the contrary $705$ is not a prime but it divides $L_{705}-1$.



See Bruckman-Lucas_pseudoprimes and compare with the Wall-Sun-Sun prime.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited 23 hours ago

























answered 23 hours ago









Robert Z

89.8k1056128




89.8k1056128












  • "... is divisible by $p^2$" by $p^2$ or by $p$? Note that $198$ is not divisible by $11^2=121$
    – Hussain-Alqatari
    23 hours ago










  • @Hussain-Alqatari Sorry, you are right!
    – Robert Z
    23 hours ago










  • @Hussain-Alqatari I edited my answer with the proof of the implication that holds..
    – Robert Z
    23 hours ago












  • Nice. Also note that the Bruckman definition for Lucas pseudoprimes is not used outside of his paper (Baillie and Wagstaff defined them over a decade earlier). Bruckman's pseudoprimes overlap substantially with strong pseudoprimes, so are not very useful for primality testing, unlike the earlier definition which is used in the very common BPSW primality test.
    – DanaJ
    14 hours ago


















  • "... is divisible by $p^2$" by $p^2$ or by $p$? Note that $198$ is not divisible by $11^2=121$
    – Hussain-Alqatari
    23 hours ago










  • @Hussain-Alqatari Sorry, you are right!
    – Robert Z
    23 hours ago










  • @Hussain-Alqatari I edited my answer with the proof of the implication that holds..
    – Robert Z
    23 hours ago












  • Nice. Also note that the Bruckman definition for Lucas pseudoprimes is not used outside of his paper (Baillie and Wagstaff defined them over a decade earlier). Bruckman's pseudoprimes overlap substantially with strong pseudoprimes, so are not very useful for primality testing, unlike the earlier definition which is used in the very common BPSW primality test.
    – DanaJ
    14 hours ago
















"... is divisible by $p^2$" by $p^2$ or by $p$? Note that $198$ is not divisible by $11^2=121$
– Hussain-Alqatari
23 hours ago




"... is divisible by $p^2$" by $p^2$ or by $p$? Note that $198$ is not divisible by $11^2=121$
– Hussain-Alqatari
23 hours ago












@Hussain-Alqatari Sorry, you are right!
– Robert Z
23 hours ago




@Hussain-Alqatari Sorry, you are right!
– Robert Z
23 hours ago












@Hussain-Alqatari I edited my answer with the proof of the implication that holds..
– Robert Z
23 hours ago






@Hussain-Alqatari I edited my answer with the proof of the implication that holds..
– Robert Z
23 hours ago














Nice. Also note that the Bruckman definition for Lucas pseudoprimes is not used outside of his paper (Baillie and Wagstaff defined them over a decade earlier). Bruckman's pseudoprimes overlap substantially with strong pseudoprimes, so are not very useful for primality testing, unlike the earlier definition which is used in the very common BPSW primality test.
– DanaJ
14 hours ago




Nice. Also note that the Bruckman definition for Lucas pseudoprimes is not used outside of his paper (Baillie and Wagstaff defined them over a decade earlier). Bruckman's pseudoprimes overlap substantially with strong pseudoprimes, so are not very useful for primality testing, unlike the earlier definition which is used in the very common BPSW primality test.
– DanaJ
14 hours ago


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3004854%2fchecking-whether-a-number-is-prime-or-not%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

SQL update select statement

'app-layout' is not a known element: how to share Component with different Modules