Hermite polynomials and primality testing











up vote
1
down vote

favorite
2












Can you provide a proof or a counterexample for the claim given below ?



Inspired by Agrawal's conjecture in this paper I have formulated the following claim :




Let $n$ be a natural number greater than two . Let $r$ be the smallest odd prime number such that $r nmid n$ and $n^2 notequiv 1 pmod r$ . Let $H_n(x)$ be Hermite polynomial , then $n$ is either a prime number or Fermat pseudoprime to base $2$ if and only if $H_n(x) equiv 2x^n pmod {x^r-1,n}$ .




You can run this test here .



Mathematica implementation of test :



n=31;
r=3;
While[Mod[n,r]==0 || PowerMod[n,2,r]==1,r=NextPrime[r]];
If[PolynomialMod[PolynomialRemainder[HermiteH[n,x],x^r-1,x],n]-PolynomialRemainder[2*x^n,x^r-1,x]===0,Print["probably prime"],Print["composite"]];









share|cite|improve this question


























    up vote
    1
    down vote

    favorite
    2












    Can you provide a proof or a counterexample for the claim given below ?



    Inspired by Agrawal's conjecture in this paper I have formulated the following claim :




    Let $n$ be a natural number greater than two . Let $r$ be the smallest odd prime number such that $r nmid n$ and $n^2 notequiv 1 pmod r$ . Let $H_n(x)$ be Hermite polynomial , then $n$ is either a prime number or Fermat pseudoprime to base $2$ if and only if $H_n(x) equiv 2x^n pmod {x^r-1,n}$ .




    You can run this test here .



    Mathematica implementation of test :



    n=31;
    r=3;
    While[Mod[n,r]==0 || PowerMod[n,2,r]==1,r=NextPrime[r]];
    If[PolynomialMod[PolynomialRemainder[HermiteH[n,x],x^r-1,x],n]-PolynomialRemainder[2*x^n,x^r-1,x]===0,Print["probably prime"],Print["composite"]];









    share|cite|improve this question
























      up vote
      1
      down vote

      favorite
      2









      up vote
      1
      down vote

      favorite
      2






      2





      Can you provide a proof or a counterexample for the claim given below ?



      Inspired by Agrawal's conjecture in this paper I have formulated the following claim :




      Let $n$ be a natural number greater than two . Let $r$ be the smallest odd prime number such that $r nmid n$ and $n^2 notequiv 1 pmod r$ . Let $H_n(x)$ be Hermite polynomial , then $n$ is either a prime number or Fermat pseudoprime to base $2$ if and only if $H_n(x) equiv 2x^n pmod {x^r-1,n}$ .




      You can run this test here .



      Mathematica implementation of test :



      n=31;
      r=3;
      While[Mod[n,r]==0 || PowerMod[n,2,r]==1,r=NextPrime[r]];
      If[PolynomialMod[PolynomialRemainder[HermiteH[n,x],x^r-1,x],n]-PolynomialRemainder[2*x^n,x^r-1,x]===0,Print["probably prime"],Print["composite"]];









      share|cite|improve this question













      Can you provide a proof or a counterexample for the claim given below ?



      Inspired by Agrawal's conjecture in this paper I have formulated the following claim :




      Let $n$ be a natural number greater than two . Let $r$ be the smallest odd prime number such that $r nmid n$ and $n^2 notequiv 1 pmod r$ . Let $H_n(x)$ be Hermite polynomial , then $n$ is either a prime number or Fermat pseudoprime to base $2$ if and only if $H_n(x) equiv 2x^n pmod {x^r-1,n}$ .




      You can run this test here .



      Mathematica implementation of test :



      n=31;
      r=3;
      While[Mod[n,r]==0 || PowerMod[n,2,r]==1,r=NextPrime[r]];
      If[PolynomialMod[PolynomialRemainder[HermiteH[n,x],x^r-1,x],n]-PolynomialRemainder[2*x^n,x^r-1,x]===0,Print["probably prime"],Print["composite"]];






      elementary-number-theory prime-numbers examples-counterexamples primality-test






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Sep 23 at 9:37









      Peđa Terzić

      7,88022570




      7,88022570






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted
          +50










          The claim is not true.





          It is not true that if $H_n(x) equiv 2x^n pmod {x^r-1,n}$, then $n$ is either a prime number or Fermat pseudoprime to base $2$.



          Proof :



          Let us consider the case where $n$ is an even number greater than $2$.



          So, $n$ is neither a prime number nor Fermat pseudoprime to base $2$.



          Using the following expression
          $$H_{2k}=(-1)^k2^k(2k-1)!!left(1+sum_{j=1}^{k}frac{(-4k)(-4k+4)cdots (-4k+4j-4)}{(2j)!}x^{2j}right)$$
          we have, using $(n-1)!!cdot 2^{frac n2}(frac n2)!=n!$,
          $$begin{align}H_{n}&=(-1)^{frac n2}2^{frac n2}(n-1)!!left(1+sum_{j=1}^{frac n2}frac{(-2n)(-2n+4)cdots (-2n+4j-4)}{(2j)!}x^{2j}right)
          \\&=(-1)^{frac n2}2^{frac n2}(n-1)!!bigg(1+frac{(-2n)(-2n+4)cdots (-4)}{n!}x^{n}
          \&qquadqquadqquadqquadqquad+sum_{j=1}^{frac n2-1}frac{(-2n)(-2n+4)cdots (-2n+4j-4)}{(2j)!}x^{2j}bigg)
          \\&=(-1)^{frac n2}2^{frac n2}(n-1)!!bigg(1+frac{(-4)^{frac n2}(frac n2)!}{n!}x^{n}+sum_{j=1}^{frac n2-1}frac{(-4)^j(frac n2)!}{(frac{n-2j}{2})!(2j)!}x^{2j}bigg)
          \\&=2x^n+(2^n-2)x^n+frac{(-1)^{frac n2}n!}{(frac n2)!}+n(-1)^{frac n2}sum_{j=1}^{frac n2-1}frac{(n-2j-1)!}{(frac{n-2j}{2})!}binom{n-1}{2j}(-4)^j
          end{align}$$



          So, there is a polynomial $f$ with integer coefficients such that
          $$H_n(x)=2x^n+(2^n-2)x^n+(x^r-1)times 0+nf$$
          Now, if $n$ is an even pseudoprime to base 2, then we get $2^n-2equiv 0pmod n$, so it follows that $H_n(x) equiv 2x^n pmod {x^r-1,n}$.



          Therefore, $n=161038$ is a counterexample.$qquadblacksquare$





          It is true that if $n$ is either a prime number or Fermat pseudoprime to base $2$, then $H_n(x) equiv 2x^n pmod {x^r-1,n}$.



          Proof :



          For $n=3$, we have
          $$H_3(x)=2x^3+(x^r-1)times 0+3(2x^3-4x)equiv 0pmod {x^r-1,3}$$



          In the following, $n$ is an odd number greater than $3$.



          Using the following expression
          $$H_{2k+1}(x)=(-1)^kcdot 2^{k+1}(2k+1)!!bigg(x+sum_{j=1}^{k}frac{(-4k)(-4k+4)cdots (-4k+4j-4)}{(2j+1)!}x^{2j+1}bigg)$$
          we have, using $n!!cdot 2^{frac{n-1}{2}}(frac{n-1}{2})!=n!$,



          $$begin{align}H_{n}(x)&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+sum_{j=1}^{frac{n-1}{2}}frac{(-2n+2)(-2n+6)cdots (-2n+4j-2)}{(2j+1)!}x^{2j+1}bigg)
          \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+frac{(-2n+2)(-2n+6)cdots (-4)}{n!}x^{n}
          \&qquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{(-2n+2)(-2n+6)cdots (-2n+4j-2)}{(2j+1)!}x^{2j+1}bigg)
          \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+frac{(-4)^{frac{n-1}{2}}(frac{n-1}{2})!}{n!}x^{n}
          \&qquadqquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{(-4)^j(frac{n-1}{2})!}{(2j+1)!(frac{n-2j-1}{2})!}x^{2j+1}bigg)
          \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!x+2^nx^{n}
          \&qquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{n!cdot(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}(-4)^{j}}{(2j+1)!left(frac{n-2j-1}{2}right)!cdot 2^{frac{n-1}{2}}}x^{2j+1}
          \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!x+2^nx^{n}
          \&qquadqquadqquadqquad+nsum_{j=1}^{frac{n-3}{2}}frac{(n-2j-2)!binom{n-1}{2j+1}(-1)^{frac{n-1}{2}}cdot 2cdot (-4)^{j}}{left(frac{n-2j-1}{2}right)!}x^{2j+1}
          \\&=2x^n+(2^n-2)x^{n}+2n(-1)^{frac{n-1}{2}}sum_{j=color{red}{0}}^{frac{n-3}{2}}frac{(n-2j-2)!}{left(frac{n-2j-1}{2}right)!}binom{n-1}{2j+1}(-4)^{j}x^{2j+1}
          end{align}$$



          So, there is a polynomial $g$ with integer coefficients such that
          $$H_n(x)=2x^n+(2^n-2)x^n+(x^r-1)times 0+ng$$



          Since $n$ is either a prime number or Fermat pseudoprime to base $2$, we get $2^n-2equiv 0pmod n$.



          It follows that $$H_n(x)equiv 2x^npmod{x^r-1,n}qquadblacksquare$$






          share|cite|improve this answer





















          • Thank you for the clarification, I really appreciate it.
            – Peđa Terzić
            Nov 17 at 16:33


















          up vote
          0
          down vote













          Please let me know if this is way off base.



          We know $rnot|n$ and $n^{2} not equiv 1 mod r$. Therefore, from the latter part of the statement we know $rnot| n^{2}-1$ which is equivalent to $rnot |(n-1)$ and $rnot|(n+1)$. So for any $n$ we have two cases. The first being $n-1$ is odd, $n$ is even, and $n+1$ is odd. The second being $n-1$ is even, $n$ is odd, and $n+1$ is even. Since in both circumstances we have an even integer we know $nnot = 2$. Because we have three consecutive integers, that are greater than 2, we must have at least one that is divisible by $3$.



          So the fact that we cannot have $3$, but you state that $n$ is a prime number greater than $2$ or pseudo-prime to base $2$ (smallest is $341$?) makes your proof invalid due to a contradiction in your consequent.



          Once again, sorry if I am not understanding something.






          share|cite|improve this answer








          New contributor




          multicusp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















            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%2f2927462%2fhermite-polynomials-and-primality-testing%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            4
            down vote



            accepted
            +50










            The claim is not true.





            It is not true that if $H_n(x) equiv 2x^n pmod {x^r-1,n}$, then $n$ is either a prime number or Fermat pseudoprime to base $2$.



            Proof :



            Let us consider the case where $n$ is an even number greater than $2$.



            So, $n$ is neither a prime number nor Fermat pseudoprime to base $2$.



            Using the following expression
            $$H_{2k}=(-1)^k2^k(2k-1)!!left(1+sum_{j=1}^{k}frac{(-4k)(-4k+4)cdots (-4k+4j-4)}{(2j)!}x^{2j}right)$$
            we have, using $(n-1)!!cdot 2^{frac n2}(frac n2)!=n!$,
            $$begin{align}H_{n}&=(-1)^{frac n2}2^{frac n2}(n-1)!!left(1+sum_{j=1}^{frac n2}frac{(-2n)(-2n+4)cdots (-2n+4j-4)}{(2j)!}x^{2j}right)
            \\&=(-1)^{frac n2}2^{frac n2}(n-1)!!bigg(1+frac{(-2n)(-2n+4)cdots (-4)}{n!}x^{n}
            \&qquadqquadqquadqquadqquad+sum_{j=1}^{frac n2-1}frac{(-2n)(-2n+4)cdots (-2n+4j-4)}{(2j)!}x^{2j}bigg)
            \\&=(-1)^{frac n2}2^{frac n2}(n-1)!!bigg(1+frac{(-4)^{frac n2}(frac n2)!}{n!}x^{n}+sum_{j=1}^{frac n2-1}frac{(-4)^j(frac n2)!}{(frac{n-2j}{2})!(2j)!}x^{2j}bigg)
            \\&=2x^n+(2^n-2)x^n+frac{(-1)^{frac n2}n!}{(frac n2)!}+n(-1)^{frac n2}sum_{j=1}^{frac n2-1}frac{(n-2j-1)!}{(frac{n-2j}{2})!}binom{n-1}{2j}(-4)^j
            end{align}$$



            So, there is a polynomial $f$ with integer coefficients such that
            $$H_n(x)=2x^n+(2^n-2)x^n+(x^r-1)times 0+nf$$
            Now, if $n$ is an even pseudoprime to base 2, then we get $2^n-2equiv 0pmod n$, so it follows that $H_n(x) equiv 2x^n pmod {x^r-1,n}$.



            Therefore, $n=161038$ is a counterexample.$qquadblacksquare$





            It is true that if $n$ is either a prime number or Fermat pseudoprime to base $2$, then $H_n(x) equiv 2x^n pmod {x^r-1,n}$.



            Proof :



            For $n=3$, we have
            $$H_3(x)=2x^3+(x^r-1)times 0+3(2x^3-4x)equiv 0pmod {x^r-1,3}$$



            In the following, $n$ is an odd number greater than $3$.



            Using the following expression
            $$H_{2k+1}(x)=(-1)^kcdot 2^{k+1}(2k+1)!!bigg(x+sum_{j=1}^{k}frac{(-4k)(-4k+4)cdots (-4k+4j-4)}{(2j+1)!}x^{2j+1}bigg)$$
            we have, using $n!!cdot 2^{frac{n-1}{2}}(frac{n-1}{2})!=n!$,



            $$begin{align}H_{n}(x)&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+sum_{j=1}^{frac{n-1}{2}}frac{(-2n+2)(-2n+6)cdots (-2n+4j-2)}{(2j+1)!}x^{2j+1}bigg)
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+frac{(-2n+2)(-2n+6)cdots (-4)}{n!}x^{n}
            \&qquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{(-2n+2)(-2n+6)cdots (-2n+4j-2)}{(2j+1)!}x^{2j+1}bigg)
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+frac{(-4)^{frac{n-1}{2}}(frac{n-1}{2})!}{n!}x^{n}
            \&qquadqquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{(-4)^j(frac{n-1}{2})!}{(2j+1)!(frac{n-2j-1}{2})!}x^{2j+1}bigg)
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!x+2^nx^{n}
            \&qquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{n!cdot(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}(-4)^{j}}{(2j+1)!left(frac{n-2j-1}{2}right)!cdot 2^{frac{n-1}{2}}}x^{2j+1}
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!x+2^nx^{n}
            \&qquadqquadqquadqquad+nsum_{j=1}^{frac{n-3}{2}}frac{(n-2j-2)!binom{n-1}{2j+1}(-1)^{frac{n-1}{2}}cdot 2cdot (-4)^{j}}{left(frac{n-2j-1}{2}right)!}x^{2j+1}
            \\&=2x^n+(2^n-2)x^{n}+2n(-1)^{frac{n-1}{2}}sum_{j=color{red}{0}}^{frac{n-3}{2}}frac{(n-2j-2)!}{left(frac{n-2j-1}{2}right)!}binom{n-1}{2j+1}(-4)^{j}x^{2j+1}
            end{align}$$



            So, there is a polynomial $g$ with integer coefficients such that
            $$H_n(x)=2x^n+(2^n-2)x^n+(x^r-1)times 0+ng$$



            Since $n$ is either a prime number or Fermat pseudoprime to base $2$, we get $2^n-2equiv 0pmod n$.



            It follows that $$H_n(x)equiv 2x^npmod{x^r-1,n}qquadblacksquare$$






            share|cite|improve this answer





















            • Thank you for the clarification, I really appreciate it.
              – Peđa Terzić
              Nov 17 at 16:33















            up vote
            4
            down vote



            accepted
            +50










            The claim is not true.





            It is not true that if $H_n(x) equiv 2x^n pmod {x^r-1,n}$, then $n$ is either a prime number or Fermat pseudoprime to base $2$.



            Proof :



            Let us consider the case where $n$ is an even number greater than $2$.



            So, $n$ is neither a prime number nor Fermat pseudoprime to base $2$.



            Using the following expression
            $$H_{2k}=(-1)^k2^k(2k-1)!!left(1+sum_{j=1}^{k}frac{(-4k)(-4k+4)cdots (-4k+4j-4)}{(2j)!}x^{2j}right)$$
            we have, using $(n-1)!!cdot 2^{frac n2}(frac n2)!=n!$,
            $$begin{align}H_{n}&=(-1)^{frac n2}2^{frac n2}(n-1)!!left(1+sum_{j=1}^{frac n2}frac{(-2n)(-2n+4)cdots (-2n+4j-4)}{(2j)!}x^{2j}right)
            \\&=(-1)^{frac n2}2^{frac n2}(n-1)!!bigg(1+frac{(-2n)(-2n+4)cdots (-4)}{n!}x^{n}
            \&qquadqquadqquadqquadqquad+sum_{j=1}^{frac n2-1}frac{(-2n)(-2n+4)cdots (-2n+4j-4)}{(2j)!}x^{2j}bigg)
            \\&=(-1)^{frac n2}2^{frac n2}(n-1)!!bigg(1+frac{(-4)^{frac n2}(frac n2)!}{n!}x^{n}+sum_{j=1}^{frac n2-1}frac{(-4)^j(frac n2)!}{(frac{n-2j}{2})!(2j)!}x^{2j}bigg)
            \\&=2x^n+(2^n-2)x^n+frac{(-1)^{frac n2}n!}{(frac n2)!}+n(-1)^{frac n2}sum_{j=1}^{frac n2-1}frac{(n-2j-1)!}{(frac{n-2j}{2})!}binom{n-1}{2j}(-4)^j
            end{align}$$



            So, there is a polynomial $f$ with integer coefficients such that
            $$H_n(x)=2x^n+(2^n-2)x^n+(x^r-1)times 0+nf$$
            Now, if $n$ is an even pseudoprime to base 2, then we get $2^n-2equiv 0pmod n$, so it follows that $H_n(x) equiv 2x^n pmod {x^r-1,n}$.



            Therefore, $n=161038$ is a counterexample.$qquadblacksquare$





            It is true that if $n$ is either a prime number or Fermat pseudoprime to base $2$, then $H_n(x) equiv 2x^n pmod {x^r-1,n}$.



            Proof :



            For $n=3$, we have
            $$H_3(x)=2x^3+(x^r-1)times 0+3(2x^3-4x)equiv 0pmod {x^r-1,3}$$



            In the following, $n$ is an odd number greater than $3$.



            Using the following expression
            $$H_{2k+1}(x)=(-1)^kcdot 2^{k+1}(2k+1)!!bigg(x+sum_{j=1}^{k}frac{(-4k)(-4k+4)cdots (-4k+4j-4)}{(2j+1)!}x^{2j+1}bigg)$$
            we have, using $n!!cdot 2^{frac{n-1}{2}}(frac{n-1}{2})!=n!$,



            $$begin{align}H_{n}(x)&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+sum_{j=1}^{frac{n-1}{2}}frac{(-2n+2)(-2n+6)cdots (-2n+4j-2)}{(2j+1)!}x^{2j+1}bigg)
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+frac{(-2n+2)(-2n+6)cdots (-4)}{n!}x^{n}
            \&qquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{(-2n+2)(-2n+6)cdots (-2n+4j-2)}{(2j+1)!}x^{2j+1}bigg)
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+frac{(-4)^{frac{n-1}{2}}(frac{n-1}{2})!}{n!}x^{n}
            \&qquadqquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{(-4)^j(frac{n-1}{2})!}{(2j+1)!(frac{n-2j-1}{2})!}x^{2j+1}bigg)
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!x+2^nx^{n}
            \&qquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{n!cdot(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}(-4)^{j}}{(2j+1)!left(frac{n-2j-1}{2}right)!cdot 2^{frac{n-1}{2}}}x^{2j+1}
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!x+2^nx^{n}
            \&qquadqquadqquadqquad+nsum_{j=1}^{frac{n-3}{2}}frac{(n-2j-2)!binom{n-1}{2j+1}(-1)^{frac{n-1}{2}}cdot 2cdot (-4)^{j}}{left(frac{n-2j-1}{2}right)!}x^{2j+1}
            \\&=2x^n+(2^n-2)x^{n}+2n(-1)^{frac{n-1}{2}}sum_{j=color{red}{0}}^{frac{n-3}{2}}frac{(n-2j-2)!}{left(frac{n-2j-1}{2}right)!}binom{n-1}{2j+1}(-4)^{j}x^{2j+1}
            end{align}$$



            So, there is a polynomial $g$ with integer coefficients such that
            $$H_n(x)=2x^n+(2^n-2)x^n+(x^r-1)times 0+ng$$



            Since $n$ is either a prime number or Fermat pseudoprime to base $2$, we get $2^n-2equiv 0pmod n$.



            It follows that $$H_n(x)equiv 2x^npmod{x^r-1,n}qquadblacksquare$$






            share|cite|improve this answer





















            • Thank you for the clarification, I really appreciate it.
              – Peđa Terzić
              Nov 17 at 16:33













            up vote
            4
            down vote



            accepted
            +50







            up vote
            4
            down vote



            accepted
            +50




            +50




            The claim is not true.





            It is not true that if $H_n(x) equiv 2x^n pmod {x^r-1,n}$, then $n$ is either a prime number or Fermat pseudoprime to base $2$.



            Proof :



            Let us consider the case where $n$ is an even number greater than $2$.



            So, $n$ is neither a prime number nor Fermat pseudoprime to base $2$.



            Using the following expression
            $$H_{2k}=(-1)^k2^k(2k-1)!!left(1+sum_{j=1}^{k}frac{(-4k)(-4k+4)cdots (-4k+4j-4)}{(2j)!}x^{2j}right)$$
            we have, using $(n-1)!!cdot 2^{frac n2}(frac n2)!=n!$,
            $$begin{align}H_{n}&=(-1)^{frac n2}2^{frac n2}(n-1)!!left(1+sum_{j=1}^{frac n2}frac{(-2n)(-2n+4)cdots (-2n+4j-4)}{(2j)!}x^{2j}right)
            \\&=(-1)^{frac n2}2^{frac n2}(n-1)!!bigg(1+frac{(-2n)(-2n+4)cdots (-4)}{n!}x^{n}
            \&qquadqquadqquadqquadqquad+sum_{j=1}^{frac n2-1}frac{(-2n)(-2n+4)cdots (-2n+4j-4)}{(2j)!}x^{2j}bigg)
            \\&=(-1)^{frac n2}2^{frac n2}(n-1)!!bigg(1+frac{(-4)^{frac n2}(frac n2)!}{n!}x^{n}+sum_{j=1}^{frac n2-1}frac{(-4)^j(frac n2)!}{(frac{n-2j}{2})!(2j)!}x^{2j}bigg)
            \\&=2x^n+(2^n-2)x^n+frac{(-1)^{frac n2}n!}{(frac n2)!}+n(-1)^{frac n2}sum_{j=1}^{frac n2-1}frac{(n-2j-1)!}{(frac{n-2j}{2})!}binom{n-1}{2j}(-4)^j
            end{align}$$



            So, there is a polynomial $f$ with integer coefficients such that
            $$H_n(x)=2x^n+(2^n-2)x^n+(x^r-1)times 0+nf$$
            Now, if $n$ is an even pseudoprime to base 2, then we get $2^n-2equiv 0pmod n$, so it follows that $H_n(x) equiv 2x^n pmod {x^r-1,n}$.



            Therefore, $n=161038$ is a counterexample.$qquadblacksquare$





            It is true that if $n$ is either a prime number or Fermat pseudoprime to base $2$, then $H_n(x) equiv 2x^n pmod {x^r-1,n}$.



            Proof :



            For $n=3$, we have
            $$H_3(x)=2x^3+(x^r-1)times 0+3(2x^3-4x)equiv 0pmod {x^r-1,3}$$



            In the following, $n$ is an odd number greater than $3$.



            Using the following expression
            $$H_{2k+1}(x)=(-1)^kcdot 2^{k+1}(2k+1)!!bigg(x+sum_{j=1}^{k}frac{(-4k)(-4k+4)cdots (-4k+4j-4)}{(2j+1)!}x^{2j+1}bigg)$$
            we have, using $n!!cdot 2^{frac{n-1}{2}}(frac{n-1}{2})!=n!$,



            $$begin{align}H_{n}(x)&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+sum_{j=1}^{frac{n-1}{2}}frac{(-2n+2)(-2n+6)cdots (-2n+4j-2)}{(2j+1)!}x^{2j+1}bigg)
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+frac{(-2n+2)(-2n+6)cdots (-4)}{n!}x^{n}
            \&qquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{(-2n+2)(-2n+6)cdots (-2n+4j-2)}{(2j+1)!}x^{2j+1}bigg)
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+frac{(-4)^{frac{n-1}{2}}(frac{n-1}{2})!}{n!}x^{n}
            \&qquadqquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{(-4)^j(frac{n-1}{2})!}{(2j+1)!(frac{n-2j-1}{2})!}x^{2j+1}bigg)
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!x+2^nx^{n}
            \&qquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{n!cdot(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}(-4)^{j}}{(2j+1)!left(frac{n-2j-1}{2}right)!cdot 2^{frac{n-1}{2}}}x^{2j+1}
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!x+2^nx^{n}
            \&qquadqquadqquadqquad+nsum_{j=1}^{frac{n-3}{2}}frac{(n-2j-2)!binom{n-1}{2j+1}(-1)^{frac{n-1}{2}}cdot 2cdot (-4)^{j}}{left(frac{n-2j-1}{2}right)!}x^{2j+1}
            \\&=2x^n+(2^n-2)x^{n}+2n(-1)^{frac{n-1}{2}}sum_{j=color{red}{0}}^{frac{n-3}{2}}frac{(n-2j-2)!}{left(frac{n-2j-1}{2}right)!}binom{n-1}{2j+1}(-4)^{j}x^{2j+1}
            end{align}$$



            So, there is a polynomial $g$ with integer coefficients such that
            $$H_n(x)=2x^n+(2^n-2)x^n+(x^r-1)times 0+ng$$



            Since $n$ is either a prime number or Fermat pseudoprime to base $2$, we get $2^n-2equiv 0pmod n$.



            It follows that $$H_n(x)equiv 2x^npmod{x^r-1,n}qquadblacksquare$$






            share|cite|improve this answer












            The claim is not true.





            It is not true that if $H_n(x) equiv 2x^n pmod {x^r-1,n}$, then $n$ is either a prime number or Fermat pseudoprime to base $2$.



            Proof :



            Let us consider the case where $n$ is an even number greater than $2$.



            So, $n$ is neither a prime number nor Fermat pseudoprime to base $2$.



            Using the following expression
            $$H_{2k}=(-1)^k2^k(2k-1)!!left(1+sum_{j=1}^{k}frac{(-4k)(-4k+4)cdots (-4k+4j-4)}{(2j)!}x^{2j}right)$$
            we have, using $(n-1)!!cdot 2^{frac n2}(frac n2)!=n!$,
            $$begin{align}H_{n}&=(-1)^{frac n2}2^{frac n2}(n-1)!!left(1+sum_{j=1}^{frac n2}frac{(-2n)(-2n+4)cdots (-2n+4j-4)}{(2j)!}x^{2j}right)
            \\&=(-1)^{frac n2}2^{frac n2}(n-1)!!bigg(1+frac{(-2n)(-2n+4)cdots (-4)}{n!}x^{n}
            \&qquadqquadqquadqquadqquad+sum_{j=1}^{frac n2-1}frac{(-2n)(-2n+4)cdots (-2n+4j-4)}{(2j)!}x^{2j}bigg)
            \\&=(-1)^{frac n2}2^{frac n2}(n-1)!!bigg(1+frac{(-4)^{frac n2}(frac n2)!}{n!}x^{n}+sum_{j=1}^{frac n2-1}frac{(-4)^j(frac n2)!}{(frac{n-2j}{2})!(2j)!}x^{2j}bigg)
            \\&=2x^n+(2^n-2)x^n+frac{(-1)^{frac n2}n!}{(frac n2)!}+n(-1)^{frac n2}sum_{j=1}^{frac n2-1}frac{(n-2j-1)!}{(frac{n-2j}{2})!}binom{n-1}{2j}(-4)^j
            end{align}$$



            So, there is a polynomial $f$ with integer coefficients such that
            $$H_n(x)=2x^n+(2^n-2)x^n+(x^r-1)times 0+nf$$
            Now, if $n$ is an even pseudoprime to base 2, then we get $2^n-2equiv 0pmod n$, so it follows that $H_n(x) equiv 2x^n pmod {x^r-1,n}$.



            Therefore, $n=161038$ is a counterexample.$qquadblacksquare$





            It is true that if $n$ is either a prime number or Fermat pseudoprime to base $2$, then $H_n(x) equiv 2x^n pmod {x^r-1,n}$.



            Proof :



            For $n=3$, we have
            $$H_3(x)=2x^3+(x^r-1)times 0+3(2x^3-4x)equiv 0pmod {x^r-1,3}$$



            In the following, $n$ is an odd number greater than $3$.



            Using the following expression
            $$H_{2k+1}(x)=(-1)^kcdot 2^{k+1}(2k+1)!!bigg(x+sum_{j=1}^{k}frac{(-4k)(-4k+4)cdots (-4k+4j-4)}{(2j+1)!}x^{2j+1}bigg)$$
            we have, using $n!!cdot 2^{frac{n-1}{2}}(frac{n-1}{2})!=n!$,



            $$begin{align}H_{n}(x)&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+sum_{j=1}^{frac{n-1}{2}}frac{(-2n+2)(-2n+6)cdots (-2n+4j-2)}{(2j+1)!}x^{2j+1}bigg)
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+frac{(-2n+2)(-2n+6)cdots (-4)}{n!}x^{n}
            \&qquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{(-2n+2)(-2n+6)cdots (-2n+4j-2)}{(2j+1)!}x^{2j+1}bigg)
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!bigg(x+frac{(-4)^{frac{n-1}{2}}(frac{n-1}{2})!}{n!}x^{n}
            \&qquadqquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{(-4)^j(frac{n-1}{2})!}{(2j+1)!(frac{n-2j-1}{2})!}x^{2j+1}bigg)
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!x+2^nx^{n}
            \&qquadqquadqquadqquad+sum_{j=1}^{frac{n-3}{2}}frac{n!cdot(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}(-4)^{j}}{(2j+1)!left(frac{n-2j-1}{2}right)!cdot 2^{frac{n-1}{2}}}x^{2j+1}
            \\&=(-1)^{frac{n-1}{2}}cdot 2^{frac{n+1}{2}}n!!x+2^nx^{n}
            \&qquadqquadqquadqquad+nsum_{j=1}^{frac{n-3}{2}}frac{(n-2j-2)!binom{n-1}{2j+1}(-1)^{frac{n-1}{2}}cdot 2cdot (-4)^{j}}{left(frac{n-2j-1}{2}right)!}x^{2j+1}
            \\&=2x^n+(2^n-2)x^{n}+2n(-1)^{frac{n-1}{2}}sum_{j=color{red}{0}}^{frac{n-3}{2}}frac{(n-2j-2)!}{left(frac{n-2j-1}{2}right)!}binom{n-1}{2j+1}(-4)^{j}x^{2j+1}
            end{align}$$



            So, there is a polynomial $g$ with integer coefficients such that
            $$H_n(x)=2x^n+(2^n-2)x^n+(x^r-1)times 0+ng$$



            Since $n$ is either a prime number or Fermat pseudoprime to base $2$, we get $2^n-2equiv 0pmod n$.



            It follows that $$H_n(x)equiv 2x^npmod{x^r-1,n}qquadblacksquare$$







            share|cite|improve this answer












            share|cite|improve this answer



            share|cite|improve this answer










            answered Nov 17 at 15:35









            mathlove

            91.4k880214




            91.4k880214












            • Thank you for the clarification, I really appreciate it.
              – Peđa Terzić
              Nov 17 at 16:33


















            • Thank you for the clarification, I really appreciate it.
              – Peđa Terzić
              Nov 17 at 16:33
















            Thank you for the clarification, I really appreciate it.
            – Peđa Terzić
            Nov 17 at 16:33




            Thank you for the clarification, I really appreciate it.
            – Peđa Terzić
            Nov 17 at 16:33










            up vote
            0
            down vote













            Please let me know if this is way off base.



            We know $rnot|n$ and $n^{2} not equiv 1 mod r$. Therefore, from the latter part of the statement we know $rnot| n^{2}-1$ which is equivalent to $rnot |(n-1)$ and $rnot|(n+1)$. So for any $n$ we have two cases. The first being $n-1$ is odd, $n$ is even, and $n+1$ is odd. The second being $n-1$ is even, $n$ is odd, and $n+1$ is even. Since in both circumstances we have an even integer we know $nnot = 2$. Because we have three consecutive integers, that are greater than 2, we must have at least one that is divisible by $3$.



            So the fact that we cannot have $3$, but you state that $n$ is a prime number greater than $2$ or pseudo-prime to base $2$ (smallest is $341$?) makes your proof invalid due to a contradiction in your consequent.



            Once again, sorry if I am not understanding something.






            share|cite|improve this answer








            New contributor




            multicusp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






















              up vote
              0
              down vote













              Please let me know if this is way off base.



              We know $rnot|n$ and $n^{2} not equiv 1 mod r$. Therefore, from the latter part of the statement we know $rnot| n^{2}-1$ which is equivalent to $rnot |(n-1)$ and $rnot|(n+1)$. So for any $n$ we have two cases. The first being $n-1$ is odd, $n$ is even, and $n+1$ is odd. The second being $n-1$ is even, $n$ is odd, and $n+1$ is even. Since in both circumstances we have an even integer we know $nnot = 2$. Because we have three consecutive integers, that are greater than 2, we must have at least one that is divisible by $3$.



              So the fact that we cannot have $3$, but you state that $n$ is a prime number greater than $2$ or pseudo-prime to base $2$ (smallest is $341$?) makes your proof invalid due to a contradiction in your consequent.



              Once again, sorry if I am not understanding something.






              share|cite|improve this answer








              New contributor




              multicusp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.




















                up vote
                0
                down vote










                up vote
                0
                down vote









                Please let me know if this is way off base.



                We know $rnot|n$ and $n^{2} not equiv 1 mod r$. Therefore, from the latter part of the statement we know $rnot| n^{2}-1$ which is equivalent to $rnot |(n-1)$ and $rnot|(n+1)$. So for any $n$ we have two cases. The first being $n-1$ is odd, $n$ is even, and $n+1$ is odd. The second being $n-1$ is even, $n$ is odd, and $n+1$ is even. Since in both circumstances we have an even integer we know $nnot = 2$. Because we have three consecutive integers, that are greater than 2, we must have at least one that is divisible by $3$.



                So the fact that we cannot have $3$, but you state that $n$ is a prime number greater than $2$ or pseudo-prime to base $2$ (smallest is $341$?) makes your proof invalid due to a contradiction in your consequent.



                Once again, sorry if I am not understanding something.






                share|cite|improve this answer








                New contributor




                multicusp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                Please let me know if this is way off base.



                We know $rnot|n$ and $n^{2} not equiv 1 mod r$. Therefore, from the latter part of the statement we know $rnot| n^{2}-1$ which is equivalent to $rnot |(n-1)$ and $rnot|(n+1)$. So for any $n$ we have two cases. The first being $n-1$ is odd, $n$ is even, and $n+1$ is odd. The second being $n-1$ is even, $n$ is odd, and $n+1$ is even. Since in both circumstances we have an even integer we know $nnot = 2$. Because we have three consecutive integers, that are greater than 2, we must have at least one that is divisible by $3$.



                So the fact that we cannot have $3$, but you state that $n$ is a prime number greater than $2$ or pseudo-prime to base $2$ (smallest is $341$?) makes your proof invalid due to a contradiction in your consequent.



                Once again, sorry if I am not understanding something.







                share|cite|improve this answer








                New contributor




                multicusp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|cite|improve this answer



                share|cite|improve this answer






                New contributor




                multicusp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered yesterday









                multicusp

                211




                211




                New contributor




                multicusp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                multicusp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                multicusp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2927462%2fhermite-polynomials-and-primality-testing%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

                    Quarter-circle Tiles

                    build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

                    Mont Emei