Can a formula that is tailor-made to incorporate answers be correct?












5














Sample problem:




Find an equation $theta(n)$ for which $theta(n)=left{ begin{array} &0, text{when } nin text{Composed} \ n, text{when } nin text{Prime} end{array} right.$




This problem is from the International Youth Math Challenge $2018$ and since they do not return marked sheets, I am unsure if my solution was correct.



My final answer was: $$theta (n)=n-ncdot text{sgn} left(prod_{i=1}^{infty} |n-p_i|right)$$ where $p_i$ is the $i^{text{th}}$ prime number. This is all I could come up with and to be honest, I am not too happy with it, because I feel like I have basically chosen something that will only give the answer I want. Is this solution correct, mathematically? Is there a better solution?



Note: $text {sgn}(n)$ is the $text{sign}$ or $text{signum}$ function and $$text{sgn}(n)=left{ begin{array} &-1; nlt 0\ 0; n=0\ 1; ngt 0 end{array} right.$$










share|cite|improve this question





























    5














    Sample problem:




    Find an equation $theta(n)$ for which $theta(n)=left{ begin{array} &0, text{when } nin text{Composed} \ n, text{when } nin text{Prime} end{array} right.$




    This problem is from the International Youth Math Challenge $2018$ and since they do not return marked sheets, I am unsure if my solution was correct.



    My final answer was: $$theta (n)=n-ncdot text{sgn} left(prod_{i=1}^{infty} |n-p_i|right)$$ where $p_i$ is the $i^{text{th}}$ prime number. This is all I could come up with and to be honest, I am not too happy with it, because I feel like I have basically chosen something that will only give the answer I want. Is this solution correct, mathematically? Is there a better solution?



    Note: $text {sgn}(n)$ is the $text{sign}$ or $text{signum}$ function and $$text{sgn}(n)=left{ begin{array} &-1; nlt 0\ 0; n=0\ 1; ngt 0 end{array} right.$$










    share|cite|improve this question



























      5












      5








      5


      2





      Sample problem:




      Find an equation $theta(n)$ for which $theta(n)=left{ begin{array} &0, text{when } nin text{Composed} \ n, text{when } nin text{Prime} end{array} right.$




      This problem is from the International Youth Math Challenge $2018$ and since they do not return marked sheets, I am unsure if my solution was correct.



      My final answer was: $$theta (n)=n-ncdot text{sgn} left(prod_{i=1}^{infty} |n-p_i|right)$$ where $p_i$ is the $i^{text{th}}$ prime number. This is all I could come up with and to be honest, I am not too happy with it, because I feel like I have basically chosen something that will only give the answer I want. Is this solution correct, mathematically? Is there a better solution?



      Note: $text {sgn}(n)$ is the $text{sign}$ or $text{signum}$ function and $$text{sgn}(n)=left{ begin{array} &-1; nlt 0\ 0; n=0\ 1; ngt 0 end{array} right.$$










      share|cite|improve this question















      Sample problem:




      Find an equation $theta(n)$ for which $theta(n)=left{ begin{array} &0, text{when } nin text{Composed} \ n, text{when } nin text{Prime} end{array} right.$




      This problem is from the International Youth Math Challenge $2018$ and since they do not return marked sheets, I am unsure if my solution was correct.



      My final answer was: $$theta (n)=n-ncdot text{sgn} left(prod_{i=1}^{infty} |n-p_i|right)$$ where $p_i$ is the $i^{text{th}}$ prime number. This is all I could come up with and to be honest, I am not too happy with it, because I feel like I have basically chosen something that will only give the answer I want. Is this solution correct, mathematically? Is there a better solution?



      Note: $text {sgn}(n)$ is the $text{sign}$ or $text{signum}$ function and $$text{sgn}(n)=left{ begin{array} &-1; nlt 0\ 0; n=0\ 1; ngt 0 end{array} right.$$







      prime-numbers contest-math






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited 1 hour ago

























      asked 1 hour ago









      Mohammad Zuhair Khan

      1,4232525




      1,4232525






















          3 Answers
          3






          active

          oldest

          votes


















          2














          I'm not sure what kind of functions are allowed but here is a similar one (might be equivalent after some small changes), the differences being it's finite and doesn't require ability to select primes:



          For any positive integer $p$, define this function
          $$
          f(n,p):= leftlceil frac{n-plfloor frac{n}{p}rfloor}{n} rightrceil
          $$

          If $p$ divides $n$ then $f(n,p)=0$, otherwise $n-plfloor n/prfloorneq 0$ so $f(n,p)=1$.



          You can then use this to make the following:
          $$
          theta(n):= n - nprod_{p=2}^{n-1}f(n,p)
          $$

          If $n$ is composite then one of the $p$'s will make the product $0$ and hence $theta(n)=n$. Otherwise $n$ is prime and the product is $1$, giving $theta(n)=0$.






          share|cite|improve this answer





























            1














            Good try; but there's something that needs fixing. When $n$ is composite, the product diverges to $infty$; so you should define $text {sgn} (infty) = 1$.






            share|cite|improve this answer





















            • Thanks for the advice. But, unless I am mistaken, $+infty gt 0?$
              – Mohammad Zuhair Khan
              1 hour ago






            • 1




              @MohammadZuhairKhan Yes; just personally, I would mention that case, since often people assume that youre working in $mathbb{R}$ instead of the extended number system. I would just put it to make sure there's no chance of getting points off.
              – Ovi
              1 hour ago










            • Oh okay thank you. Ofcourse, as it is done already, I can not (and would not) update my answer. But is there any other solution for this problem? I have a suspicion that this might be an open problem, or atleast a sensible version of it will.
              – Mohammad Zuhair Khan
              1 hour ago










            • @MohammadZuhairKhan I am thinking about it
              – Ovi
              1 hour ago



















            1














            Instead of the sign function, you could potentially use the Kronecker delta, which is defined as



            $$delta_{mn}=begin{cases}
            1 & text{if }n=m\
            0 & text{if }nneq m
            end{cases}$$



            It basically compares two numbers and gives $1$ if there is a match and $0$ otherwise. By summing over such Kronecker delta's, you could build:



            $$theta(n)=nsum_{i=1}^{infty}delta_{np_i}$$



            (where $p_i$ is the $i$-th prime number). However, I'm wondering if this would be accepted because it kind of bypasses the question of "checking if $n$ is prime". Both our formulas are just a nice rewording of the "text-form" formula given in the question, so I'm not certain this was the kind of answer that was expected.






            share|cite|improve this answer





















              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',
              autoActivateHeartbeat: false,
              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%2f3048222%2fcan-a-formula-that-is-tailor-made-to-incorporate-answers-be-correct%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              2














              I'm not sure what kind of functions are allowed but here is a similar one (might be equivalent after some small changes), the differences being it's finite and doesn't require ability to select primes:



              For any positive integer $p$, define this function
              $$
              f(n,p):= leftlceil frac{n-plfloor frac{n}{p}rfloor}{n} rightrceil
              $$

              If $p$ divides $n$ then $f(n,p)=0$, otherwise $n-plfloor n/prfloorneq 0$ so $f(n,p)=1$.



              You can then use this to make the following:
              $$
              theta(n):= n - nprod_{p=2}^{n-1}f(n,p)
              $$

              If $n$ is composite then one of the $p$'s will make the product $0$ and hence $theta(n)=n$. Otherwise $n$ is prime and the product is $1$, giving $theta(n)=0$.






              share|cite|improve this answer


























                2














                I'm not sure what kind of functions are allowed but here is a similar one (might be equivalent after some small changes), the differences being it's finite and doesn't require ability to select primes:



                For any positive integer $p$, define this function
                $$
                f(n,p):= leftlceil frac{n-plfloor frac{n}{p}rfloor}{n} rightrceil
                $$

                If $p$ divides $n$ then $f(n,p)=0$, otherwise $n-plfloor n/prfloorneq 0$ so $f(n,p)=1$.



                You can then use this to make the following:
                $$
                theta(n):= n - nprod_{p=2}^{n-1}f(n,p)
                $$

                If $n$ is composite then one of the $p$'s will make the product $0$ and hence $theta(n)=n$. Otherwise $n$ is prime and the product is $1$, giving $theta(n)=0$.






                share|cite|improve this answer
























                  2












                  2








                  2






                  I'm not sure what kind of functions are allowed but here is a similar one (might be equivalent after some small changes), the differences being it's finite and doesn't require ability to select primes:



                  For any positive integer $p$, define this function
                  $$
                  f(n,p):= leftlceil frac{n-plfloor frac{n}{p}rfloor}{n} rightrceil
                  $$

                  If $p$ divides $n$ then $f(n,p)=0$, otherwise $n-plfloor n/prfloorneq 0$ so $f(n,p)=1$.



                  You can then use this to make the following:
                  $$
                  theta(n):= n - nprod_{p=2}^{n-1}f(n,p)
                  $$

                  If $n$ is composite then one of the $p$'s will make the product $0$ and hence $theta(n)=n$. Otherwise $n$ is prime and the product is $1$, giving $theta(n)=0$.






                  share|cite|improve this answer












                  I'm not sure what kind of functions are allowed but here is a similar one (might be equivalent after some small changes), the differences being it's finite and doesn't require ability to select primes:



                  For any positive integer $p$, define this function
                  $$
                  f(n,p):= leftlceil frac{n-plfloor frac{n}{p}rfloor}{n} rightrceil
                  $$

                  If $p$ divides $n$ then $f(n,p)=0$, otherwise $n-plfloor n/prfloorneq 0$ so $f(n,p)=1$.



                  You can then use this to make the following:
                  $$
                  theta(n):= n - nprod_{p=2}^{n-1}f(n,p)
                  $$

                  If $n$ is composite then one of the $p$'s will make the product $0$ and hence $theta(n)=n$. Otherwise $n$ is prime and the product is $1$, giving $theta(n)=0$.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered 28 mins ago









                  Yong Hao Ng

                  3,1891220




                  3,1891220























                      1














                      Good try; but there's something that needs fixing. When $n$ is composite, the product diverges to $infty$; so you should define $text {sgn} (infty) = 1$.






                      share|cite|improve this answer





















                      • Thanks for the advice. But, unless I am mistaken, $+infty gt 0?$
                        – Mohammad Zuhair Khan
                        1 hour ago






                      • 1




                        @MohammadZuhairKhan Yes; just personally, I would mention that case, since often people assume that youre working in $mathbb{R}$ instead of the extended number system. I would just put it to make sure there's no chance of getting points off.
                        – Ovi
                        1 hour ago










                      • Oh okay thank you. Ofcourse, as it is done already, I can not (and would not) update my answer. But is there any other solution for this problem? I have a suspicion that this might be an open problem, or atleast a sensible version of it will.
                        – Mohammad Zuhair Khan
                        1 hour ago










                      • @MohammadZuhairKhan I am thinking about it
                        – Ovi
                        1 hour ago
















                      1














                      Good try; but there's something that needs fixing. When $n$ is composite, the product diverges to $infty$; so you should define $text {sgn} (infty) = 1$.






                      share|cite|improve this answer





















                      • Thanks for the advice. But, unless I am mistaken, $+infty gt 0?$
                        – Mohammad Zuhair Khan
                        1 hour ago






                      • 1




                        @MohammadZuhairKhan Yes; just personally, I would mention that case, since often people assume that youre working in $mathbb{R}$ instead of the extended number system. I would just put it to make sure there's no chance of getting points off.
                        – Ovi
                        1 hour ago










                      • Oh okay thank you. Ofcourse, as it is done already, I can not (and would not) update my answer. But is there any other solution for this problem? I have a suspicion that this might be an open problem, or atleast a sensible version of it will.
                        – Mohammad Zuhair Khan
                        1 hour ago










                      • @MohammadZuhairKhan I am thinking about it
                        – Ovi
                        1 hour ago














                      1












                      1








                      1






                      Good try; but there's something that needs fixing. When $n$ is composite, the product diverges to $infty$; so you should define $text {sgn} (infty) = 1$.






                      share|cite|improve this answer












                      Good try; but there's something that needs fixing. When $n$ is composite, the product diverges to $infty$; so you should define $text {sgn} (infty) = 1$.







                      share|cite|improve this answer












                      share|cite|improve this answer



                      share|cite|improve this answer










                      answered 1 hour ago









                      Ovi

                      12.2k1038109




                      12.2k1038109












                      • Thanks for the advice. But, unless I am mistaken, $+infty gt 0?$
                        – Mohammad Zuhair Khan
                        1 hour ago






                      • 1




                        @MohammadZuhairKhan Yes; just personally, I would mention that case, since often people assume that youre working in $mathbb{R}$ instead of the extended number system. I would just put it to make sure there's no chance of getting points off.
                        – Ovi
                        1 hour ago










                      • Oh okay thank you. Ofcourse, as it is done already, I can not (and would not) update my answer. But is there any other solution for this problem? I have a suspicion that this might be an open problem, or atleast a sensible version of it will.
                        – Mohammad Zuhair Khan
                        1 hour ago










                      • @MohammadZuhairKhan I am thinking about it
                        – Ovi
                        1 hour ago


















                      • Thanks for the advice. But, unless I am mistaken, $+infty gt 0?$
                        – Mohammad Zuhair Khan
                        1 hour ago






                      • 1




                        @MohammadZuhairKhan Yes; just personally, I would mention that case, since often people assume that youre working in $mathbb{R}$ instead of the extended number system. I would just put it to make sure there's no chance of getting points off.
                        – Ovi
                        1 hour ago










                      • Oh okay thank you. Ofcourse, as it is done already, I can not (and would not) update my answer. But is there any other solution for this problem? I have a suspicion that this might be an open problem, or atleast a sensible version of it will.
                        – Mohammad Zuhair Khan
                        1 hour ago










                      • @MohammadZuhairKhan I am thinking about it
                        – Ovi
                        1 hour ago
















                      Thanks for the advice. But, unless I am mistaken, $+infty gt 0?$
                      – Mohammad Zuhair Khan
                      1 hour ago




                      Thanks for the advice. But, unless I am mistaken, $+infty gt 0?$
                      – Mohammad Zuhair Khan
                      1 hour ago




                      1




                      1




                      @MohammadZuhairKhan Yes; just personally, I would mention that case, since often people assume that youre working in $mathbb{R}$ instead of the extended number system. I would just put it to make sure there's no chance of getting points off.
                      – Ovi
                      1 hour ago




                      @MohammadZuhairKhan Yes; just personally, I would mention that case, since often people assume that youre working in $mathbb{R}$ instead of the extended number system. I would just put it to make sure there's no chance of getting points off.
                      – Ovi
                      1 hour ago












                      Oh okay thank you. Ofcourse, as it is done already, I can not (and would not) update my answer. But is there any other solution for this problem? I have a suspicion that this might be an open problem, or atleast a sensible version of it will.
                      – Mohammad Zuhair Khan
                      1 hour ago




                      Oh okay thank you. Ofcourse, as it is done already, I can not (and would not) update my answer. But is there any other solution for this problem? I have a suspicion that this might be an open problem, or atleast a sensible version of it will.
                      – Mohammad Zuhair Khan
                      1 hour ago












                      @MohammadZuhairKhan I am thinking about it
                      – Ovi
                      1 hour ago




                      @MohammadZuhairKhan I am thinking about it
                      – Ovi
                      1 hour ago











                      1














                      Instead of the sign function, you could potentially use the Kronecker delta, which is defined as



                      $$delta_{mn}=begin{cases}
                      1 & text{if }n=m\
                      0 & text{if }nneq m
                      end{cases}$$



                      It basically compares two numbers and gives $1$ if there is a match and $0$ otherwise. By summing over such Kronecker delta's, you could build:



                      $$theta(n)=nsum_{i=1}^{infty}delta_{np_i}$$



                      (where $p_i$ is the $i$-th prime number). However, I'm wondering if this would be accepted because it kind of bypasses the question of "checking if $n$ is prime". Both our formulas are just a nice rewording of the "text-form" formula given in the question, so I'm not certain this was the kind of answer that was expected.






                      share|cite|improve this answer


























                        1














                        Instead of the sign function, you could potentially use the Kronecker delta, which is defined as



                        $$delta_{mn}=begin{cases}
                        1 & text{if }n=m\
                        0 & text{if }nneq m
                        end{cases}$$



                        It basically compares two numbers and gives $1$ if there is a match and $0$ otherwise. By summing over such Kronecker delta's, you could build:



                        $$theta(n)=nsum_{i=1}^{infty}delta_{np_i}$$



                        (where $p_i$ is the $i$-th prime number). However, I'm wondering if this would be accepted because it kind of bypasses the question of "checking if $n$ is prime". Both our formulas are just a nice rewording of the "text-form" formula given in the question, so I'm not certain this was the kind of answer that was expected.






                        share|cite|improve this answer
























                          1












                          1








                          1






                          Instead of the sign function, you could potentially use the Kronecker delta, which is defined as



                          $$delta_{mn}=begin{cases}
                          1 & text{if }n=m\
                          0 & text{if }nneq m
                          end{cases}$$



                          It basically compares two numbers and gives $1$ if there is a match and $0$ otherwise. By summing over such Kronecker delta's, you could build:



                          $$theta(n)=nsum_{i=1}^{infty}delta_{np_i}$$



                          (where $p_i$ is the $i$-th prime number). However, I'm wondering if this would be accepted because it kind of bypasses the question of "checking if $n$ is prime". Both our formulas are just a nice rewording of the "text-form" formula given in the question, so I'm not certain this was the kind of answer that was expected.






                          share|cite|improve this answer












                          Instead of the sign function, you could potentially use the Kronecker delta, which is defined as



                          $$delta_{mn}=begin{cases}
                          1 & text{if }n=m\
                          0 & text{if }nneq m
                          end{cases}$$



                          It basically compares two numbers and gives $1$ if there is a match and $0$ otherwise. By summing over such Kronecker delta's, you could build:



                          $$theta(n)=nsum_{i=1}^{infty}delta_{np_i}$$



                          (where $p_i$ is the $i$-th prime number). However, I'm wondering if this would be accepted because it kind of bypasses the question of "checking if $n$ is prime". Both our formulas are just a nice rewording of the "text-form" formula given in the question, so I'm not certain this was the kind of answer that was expected.







                          share|cite|improve this answer












                          share|cite|improve this answer



                          share|cite|improve this answer










                          answered 37 mins ago









                          orion2112

                          436210




                          436210






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Mathematics Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              Use MathJax to format equations. MathJax reference.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3048222%2fcan-a-formula-that-is-tailor-made-to-incorporate-answers-be-correct%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

                              數位音樂下載

                              When can things happen in Etherscan, such as the picture below?

                              格利澤436b