How to test if $n!+1$ is prime or not?











up vote
3
down vote

favorite












For $n=0,1,2,3,11,27,37,41,73,77,116,154,320,340,399,427,872,1477,6380,26951,...,$
$n!+1$ is prime. But how can you prove that this is always the case? Especially for the larger ones.



For example $1477!+1$ this number has several hundert digits, I know we can apply stochastic factor or prime algorithms, but how can you do the final proof without testing all factors?










share|cite|improve this question
























  • $n!+1$ isn't prime always. So what are you trying to prove? Or are you asking for some way to check whether for a particular $n$, $n!+1$ is prime?
    – Aritra Das
    Jul 13 '16 at 8:28










  • So basically you're asking how people test for primality. Well, if you want to be sure, you need to use a deterministic primality test. Checking all the factors is such a test, but it is very slow. You can read here for more information on some other tests, but they can be very difficult. en.wikipedia.org/wiki/Primality_test
    – Mathematician 42
    Jul 13 '16 at 8:31






  • 2




    Let $m=n!+1.$ Since you have the complete prime factorization of $m-1$ you can use Theorem 1 (improved Lucas test) from primes.utm.edu/prove/prove3_1.html to computionally test the primality.
    – gammatester
    Jul 13 '16 at 8:32












  • Actually both, how can you prove $n!+1$ is prime or how can you prove $n!+1$ isn't prime, without stochastic tests such as PollardRho etc.
    – user160069
    Jul 13 '16 at 8:32















up vote
3
down vote

favorite












For $n=0,1,2,3,11,27,37,41,73,77,116,154,320,340,399,427,872,1477,6380,26951,...,$
$n!+1$ is prime. But how can you prove that this is always the case? Especially for the larger ones.



For example $1477!+1$ this number has several hundert digits, I know we can apply stochastic factor or prime algorithms, but how can you do the final proof without testing all factors?










share|cite|improve this question
























  • $n!+1$ isn't prime always. So what are you trying to prove? Or are you asking for some way to check whether for a particular $n$, $n!+1$ is prime?
    – Aritra Das
    Jul 13 '16 at 8:28










  • So basically you're asking how people test for primality. Well, if you want to be sure, you need to use a deterministic primality test. Checking all the factors is such a test, but it is very slow. You can read here for more information on some other tests, but they can be very difficult. en.wikipedia.org/wiki/Primality_test
    – Mathematician 42
    Jul 13 '16 at 8:31






  • 2




    Let $m=n!+1.$ Since you have the complete prime factorization of $m-1$ you can use Theorem 1 (improved Lucas test) from primes.utm.edu/prove/prove3_1.html to computionally test the primality.
    – gammatester
    Jul 13 '16 at 8:32












  • Actually both, how can you prove $n!+1$ is prime or how can you prove $n!+1$ isn't prime, without stochastic tests such as PollardRho etc.
    – user160069
    Jul 13 '16 at 8:32













up vote
3
down vote

favorite









up vote
3
down vote

favorite











For $n=0,1,2,3,11,27,37,41,73,77,116,154,320,340,399,427,872,1477,6380,26951,...,$
$n!+1$ is prime. But how can you prove that this is always the case? Especially for the larger ones.



For example $1477!+1$ this number has several hundert digits, I know we can apply stochastic factor or prime algorithms, but how can you do the final proof without testing all factors?










share|cite|improve this question















For $n=0,1,2,3,11,27,37,41,73,77,116,154,320,340,399,427,872,1477,6380,26951,...,$
$n!+1$ is prime. But how can you prove that this is always the case? Especially for the larger ones.



For example $1477!+1$ this number has several hundert digits, I know we can apply stochastic factor or prime algorithms, but how can you do the final proof without testing all factors?







prime-numbers pseudoprimes






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Nov 21 at 11:50









Flermat

1,28311129




1,28311129










asked Jul 13 '16 at 8:22









user160069

370310




370310












  • $n!+1$ isn't prime always. So what are you trying to prove? Or are you asking for some way to check whether for a particular $n$, $n!+1$ is prime?
    – Aritra Das
    Jul 13 '16 at 8:28










  • So basically you're asking how people test for primality. Well, if you want to be sure, you need to use a deterministic primality test. Checking all the factors is such a test, but it is very slow. You can read here for more information on some other tests, but they can be very difficult. en.wikipedia.org/wiki/Primality_test
    – Mathematician 42
    Jul 13 '16 at 8:31






  • 2




    Let $m=n!+1.$ Since you have the complete prime factorization of $m-1$ you can use Theorem 1 (improved Lucas test) from primes.utm.edu/prove/prove3_1.html to computionally test the primality.
    – gammatester
    Jul 13 '16 at 8:32












  • Actually both, how can you prove $n!+1$ is prime or how can you prove $n!+1$ isn't prime, without stochastic tests such as PollardRho etc.
    – user160069
    Jul 13 '16 at 8:32


















  • $n!+1$ isn't prime always. So what are you trying to prove? Or are you asking for some way to check whether for a particular $n$, $n!+1$ is prime?
    – Aritra Das
    Jul 13 '16 at 8:28










  • So basically you're asking how people test for primality. Well, if you want to be sure, you need to use a deterministic primality test. Checking all the factors is such a test, but it is very slow. You can read here for more information on some other tests, but they can be very difficult. en.wikipedia.org/wiki/Primality_test
    – Mathematician 42
    Jul 13 '16 at 8:31






  • 2




    Let $m=n!+1.$ Since you have the complete prime factorization of $m-1$ you can use Theorem 1 (improved Lucas test) from primes.utm.edu/prove/prove3_1.html to computionally test the primality.
    – gammatester
    Jul 13 '16 at 8:32












  • Actually both, how can you prove $n!+1$ is prime or how can you prove $n!+1$ isn't prime, without stochastic tests such as PollardRho etc.
    – user160069
    Jul 13 '16 at 8:32
















$n!+1$ isn't prime always. So what are you trying to prove? Or are you asking for some way to check whether for a particular $n$, $n!+1$ is prime?
– Aritra Das
Jul 13 '16 at 8:28




$n!+1$ isn't prime always. So what are you trying to prove? Or are you asking for some way to check whether for a particular $n$, $n!+1$ is prime?
– Aritra Das
Jul 13 '16 at 8:28












So basically you're asking how people test for primality. Well, if you want to be sure, you need to use a deterministic primality test. Checking all the factors is such a test, but it is very slow. You can read here for more information on some other tests, but they can be very difficult. en.wikipedia.org/wiki/Primality_test
– Mathematician 42
Jul 13 '16 at 8:31




So basically you're asking how people test for primality. Well, if you want to be sure, you need to use a deterministic primality test. Checking all the factors is such a test, but it is very slow. You can read here for more information on some other tests, but they can be very difficult. en.wikipedia.org/wiki/Primality_test
– Mathematician 42
Jul 13 '16 at 8:31




2




2




Let $m=n!+1.$ Since you have the complete prime factorization of $m-1$ you can use Theorem 1 (improved Lucas test) from primes.utm.edu/prove/prove3_1.html to computionally test the primality.
– gammatester
Jul 13 '16 at 8:32






Let $m=n!+1.$ Since you have the complete prime factorization of $m-1$ you can use Theorem 1 (improved Lucas test) from primes.utm.edu/prove/prove3_1.html to computionally test the primality.
– gammatester
Jul 13 '16 at 8:32














Actually both, how can you prove $n!+1$ is prime or how can you prove $n!+1$ isn't prime, without stochastic tests such as PollardRho etc.
– user160069
Jul 13 '16 at 8:32




Actually both, how can you prove $n!+1$ is prime or how can you prove $n!+1$ isn't prime, without stochastic tests such as PollardRho etc.
– user160069
Jul 13 '16 at 8:32















active

oldest

votes











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%2f1857929%2fhow-to-test-if-n1-is-prime-or-not%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1857929%2fhow-to-test-if-n1-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

Wiesbaden

Marschland

Dieringhausen