Is there an explicit function mapping $2^n+2^m$ to $(n,m)$?Function for unique hash codeDetermine an explicit expression for $f$.A functional equation over integersHow to scale a ratio to a limited range?Equal functions with non-equal definitionsIs there a mathematical function which flips 1 and 2?Is there any explicit bijective mapping from $mathbbZ$ to $mathbbQ^+$?Is the Cantor Pairing function guaranteed to generate a unique real number for all real numbers?Dichotomy of function mapping and its inverse.Term for functions that map functions to other functions

Am I not good enough for you?

Fourth person (in Slavey language)

Do I really need to have a scientific explanation for my premise?

CSS animation in LWC not working

infinitive telling the purpose

Could a cubesat propel itself to Mars?

What are the best books to study Neural Networks from a purely mathematical perspective?

What are some noteworthy "mic-drop" moments in math?

Is this animal really missing?

Latest web browser compatible with Windows 98

How do I express some one as a black person?

Is "history" a male-biased word ("his+story")?

Solving "Resistance between two nodes on a grid" problem in Mathematica

The return of String.intern() explained

Probability of rolling two dices

How strictly should I take "Candidates must be local"?

Why does the negative sign arise in this thermodynamic relation?

Grey hair or white hair

Replacing Windows 7 security updates with anti-virus?

MTG: Can I kill an opponent in response to lethal activated abilities, and not take the damage?

Rejected in 4th interview round citing insufficient years of experience

Constexpr variable captured inside lambda loses its constexpr-ness

Could a cubesat be self propelled to the moon from LEO?

Is having access to past exams cheating and, if yes, could it be proven just by a good grade?



Is there an explicit function mapping $2^n+2^m$ to $(n,m)$?


Function for unique hash codeDetermine an explicit expression for $f$.A functional equation over integersHow to scale a ratio to a limited range?Equal functions with non-equal definitionsIs there a mathematical function which flips 1 and 2?Is there any explicit bijective mapping from $mathbbZ$ to $mathbbQ^+$?Is the Cantor Pairing function guaranteed to generate a unique real number for all real numbers?Dichotomy of function mapping and its inverse.Term for functions that map functions to other functions













4












$begingroup$


We know that the number $2^n+2^m$ is unique for $n,minmathbbN$. Is there any explicit way of writing a function $sigma:mathbbNtomathbbN^2$ such that
$$
sigma(2^n+2^m)=(n,m),
$$

for all $n,minmathbbN$?



Remark (edit): Here, $(n,m)$ is to be interpreted as the unordered pair $n,m$, since I'm only interested in the pair. More specifically, I want to find functions $sigma,f$ and $g$ such that
$$
sigma(k)=(g(k),f(k)),
$$

where $k=2^g(k)+2^f(k)$, $forall k inmathbbN$.










share|cite|improve this question











$endgroup$







  • 4




    $begingroup$
    Such a function can't be well defined, otherwise you would have $sigma(2^n+2^m) = (n,m)=(m,n)$. But in $mathbbN^2$, you don't identify $(n,m)$ and $(m,n)$... The image of $sigma$ should be the set of parts of $mathbbN$ with two elements.
    $endgroup$
    – TheSilverDoe
    18 hours ago











  • $begingroup$
    You're right! I'm more interested in the unordered pair. How may I change my question to be more accurate w.r.t. this?
    $endgroup$
    – sam wolfe
    18 hours ago











  • $begingroup$
    You can write $sigma(2^n + 2^m) = (n,m) text or (m,n)$ maybe.
    $endgroup$
    – TheSilverDoe
    17 hours ago










  • $begingroup$
    You could write $sigma(2^n+2^m)=n,m$. But I'm not sure I understand what your goal is. What you have there is already an eminently explicit and understandable definition of your function -- you may just need to specify explicitly what $sigma$ does to numbers not of the form $2^n+2^m$. Unless you have extremely specific and concrete requirements to meet, any attempt to make it look "more symbolic" will just succeed in making the definition harder to understand. For which purpose would you want that?
    $endgroup$
    – Henning Makholm
    17 hours ago










  • $begingroup$
    I want a way of recovering the unique integers pair via an explicitly constructible bijection. Please check the edit I made
    $endgroup$
    – sam wolfe
    17 hours ago
















4












$begingroup$


We know that the number $2^n+2^m$ is unique for $n,minmathbbN$. Is there any explicit way of writing a function $sigma:mathbbNtomathbbN^2$ such that
$$
sigma(2^n+2^m)=(n,m),
$$

for all $n,minmathbbN$?



Remark (edit): Here, $(n,m)$ is to be interpreted as the unordered pair $n,m$, since I'm only interested in the pair. More specifically, I want to find functions $sigma,f$ and $g$ such that
$$
sigma(k)=(g(k),f(k)),
$$

where $k=2^g(k)+2^f(k)$, $forall k inmathbbN$.










share|cite|improve this question











$endgroup$







  • 4




    $begingroup$
    Such a function can't be well defined, otherwise you would have $sigma(2^n+2^m) = (n,m)=(m,n)$. But in $mathbbN^2$, you don't identify $(n,m)$ and $(m,n)$... The image of $sigma$ should be the set of parts of $mathbbN$ with two elements.
    $endgroup$
    – TheSilverDoe
    18 hours ago











  • $begingroup$
    You're right! I'm more interested in the unordered pair. How may I change my question to be more accurate w.r.t. this?
    $endgroup$
    – sam wolfe
    18 hours ago











  • $begingroup$
    You can write $sigma(2^n + 2^m) = (n,m) text or (m,n)$ maybe.
    $endgroup$
    – TheSilverDoe
    17 hours ago










  • $begingroup$
    You could write $sigma(2^n+2^m)=n,m$. But I'm not sure I understand what your goal is. What you have there is already an eminently explicit and understandable definition of your function -- you may just need to specify explicitly what $sigma$ does to numbers not of the form $2^n+2^m$. Unless you have extremely specific and concrete requirements to meet, any attempt to make it look "more symbolic" will just succeed in making the definition harder to understand. For which purpose would you want that?
    $endgroup$
    – Henning Makholm
    17 hours ago










  • $begingroup$
    I want a way of recovering the unique integers pair via an explicitly constructible bijection. Please check the edit I made
    $endgroup$
    – sam wolfe
    17 hours ago














4












4








4


0



$begingroup$


We know that the number $2^n+2^m$ is unique for $n,minmathbbN$. Is there any explicit way of writing a function $sigma:mathbbNtomathbbN^2$ such that
$$
sigma(2^n+2^m)=(n,m),
$$

for all $n,minmathbbN$?



Remark (edit): Here, $(n,m)$ is to be interpreted as the unordered pair $n,m$, since I'm only interested in the pair. More specifically, I want to find functions $sigma,f$ and $g$ such that
$$
sigma(k)=(g(k),f(k)),
$$

where $k=2^g(k)+2^f(k)$, $forall k inmathbbN$.










share|cite|improve this question











$endgroup$




We know that the number $2^n+2^m$ is unique for $n,minmathbbN$. Is there any explicit way of writing a function $sigma:mathbbNtomathbbN^2$ such that
$$
sigma(2^n+2^m)=(n,m),
$$

for all $n,minmathbbN$?



Remark (edit): Here, $(n,m)$ is to be interpreted as the unordered pair $n,m$, since I'm only interested in the pair. More specifically, I want to find functions $sigma,f$ and $g$ such that
$$
sigma(k)=(g(k),f(k)),
$$

where $k=2^g(k)+2^f(k)$, $forall k inmathbbN$.







elementary-number-theory functions






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited 15 hours ago









Asaf Karagila

306k33438769




306k33438769










asked 18 hours ago









sam wolfesam wolfe

793525




793525







  • 4




    $begingroup$
    Such a function can't be well defined, otherwise you would have $sigma(2^n+2^m) = (n,m)=(m,n)$. But in $mathbbN^2$, you don't identify $(n,m)$ and $(m,n)$... The image of $sigma$ should be the set of parts of $mathbbN$ with two elements.
    $endgroup$
    – TheSilverDoe
    18 hours ago











  • $begingroup$
    You're right! I'm more interested in the unordered pair. How may I change my question to be more accurate w.r.t. this?
    $endgroup$
    – sam wolfe
    18 hours ago











  • $begingroup$
    You can write $sigma(2^n + 2^m) = (n,m) text or (m,n)$ maybe.
    $endgroup$
    – TheSilverDoe
    17 hours ago










  • $begingroup$
    You could write $sigma(2^n+2^m)=n,m$. But I'm not sure I understand what your goal is. What you have there is already an eminently explicit and understandable definition of your function -- you may just need to specify explicitly what $sigma$ does to numbers not of the form $2^n+2^m$. Unless you have extremely specific and concrete requirements to meet, any attempt to make it look "more symbolic" will just succeed in making the definition harder to understand. For which purpose would you want that?
    $endgroup$
    – Henning Makholm
    17 hours ago










  • $begingroup$
    I want a way of recovering the unique integers pair via an explicitly constructible bijection. Please check the edit I made
    $endgroup$
    – sam wolfe
    17 hours ago













  • 4




    $begingroup$
    Such a function can't be well defined, otherwise you would have $sigma(2^n+2^m) = (n,m)=(m,n)$. But in $mathbbN^2$, you don't identify $(n,m)$ and $(m,n)$... The image of $sigma$ should be the set of parts of $mathbbN$ with two elements.
    $endgroup$
    – TheSilverDoe
    18 hours ago











  • $begingroup$
    You're right! I'm more interested in the unordered pair. How may I change my question to be more accurate w.r.t. this?
    $endgroup$
    – sam wolfe
    18 hours ago











  • $begingroup$
    You can write $sigma(2^n + 2^m) = (n,m) text or (m,n)$ maybe.
    $endgroup$
    – TheSilverDoe
    17 hours ago










  • $begingroup$
    You could write $sigma(2^n+2^m)=n,m$. But I'm not sure I understand what your goal is. What you have there is already an eminently explicit and understandable definition of your function -- you may just need to specify explicitly what $sigma$ does to numbers not of the form $2^n+2^m$. Unless you have extremely specific and concrete requirements to meet, any attempt to make it look "more symbolic" will just succeed in making the definition harder to understand. For which purpose would you want that?
    $endgroup$
    – Henning Makholm
    17 hours ago










  • $begingroup$
    I want a way of recovering the unique integers pair via an explicitly constructible bijection. Please check the edit I made
    $endgroup$
    – sam wolfe
    17 hours ago








4




4




$begingroup$
Such a function can't be well defined, otherwise you would have $sigma(2^n+2^m) = (n,m)=(m,n)$. But in $mathbbN^2$, you don't identify $(n,m)$ and $(m,n)$... The image of $sigma$ should be the set of parts of $mathbbN$ with two elements.
$endgroup$
– TheSilverDoe
18 hours ago





$begingroup$
Such a function can't be well defined, otherwise you would have $sigma(2^n+2^m) = (n,m)=(m,n)$. But in $mathbbN^2$, you don't identify $(n,m)$ and $(m,n)$... The image of $sigma$ should be the set of parts of $mathbbN$ with two elements.
$endgroup$
– TheSilverDoe
18 hours ago













$begingroup$
You're right! I'm more interested in the unordered pair. How may I change my question to be more accurate w.r.t. this?
$endgroup$
– sam wolfe
18 hours ago





$begingroup$
You're right! I'm more interested in the unordered pair. How may I change my question to be more accurate w.r.t. this?
$endgroup$
– sam wolfe
18 hours ago













$begingroup$
You can write $sigma(2^n + 2^m) = (n,m) text or (m,n)$ maybe.
$endgroup$
– TheSilverDoe
17 hours ago




$begingroup$
You can write $sigma(2^n + 2^m) = (n,m) text or (m,n)$ maybe.
$endgroup$
– TheSilverDoe
17 hours ago












$begingroup$
You could write $sigma(2^n+2^m)=n,m$. But I'm not sure I understand what your goal is. What you have there is already an eminently explicit and understandable definition of your function -- you may just need to specify explicitly what $sigma$ does to numbers not of the form $2^n+2^m$. Unless you have extremely specific and concrete requirements to meet, any attempt to make it look "more symbolic" will just succeed in making the definition harder to understand. For which purpose would you want that?
$endgroup$
– Henning Makholm
17 hours ago




$begingroup$
You could write $sigma(2^n+2^m)=n,m$. But I'm not sure I understand what your goal is. What you have there is already an eminently explicit and understandable definition of your function -- you may just need to specify explicitly what $sigma$ does to numbers not of the form $2^n+2^m$. Unless you have extremely specific and concrete requirements to meet, any attempt to make it look "more symbolic" will just succeed in making the definition harder to understand. For which purpose would you want that?
$endgroup$
– Henning Makholm
17 hours ago












$begingroup$
I want a way of recovering the unique integers pair via an explicitly constructible bijection. Please check the edit I made
$endgroup$
– sam wolfe
17 hours ago





$begingroup$
I want a way of recovering the unique integers pair via an explicitly constructible bijection. Please check the edit I made
$endgroup$
– sam wolfe
17 hours ago











3 Answers
3






active

oldest

votes


















5












$begingroup$

What do you think of
$$forall k in mathbbN, quad sigma(k)=left( lfloor log_2(k) rfloor, lfloor log_2 left( k-2^lfloor log_2(k) rfloor right)rfloor right)$$



This is well defined except when $k$ is a power of $2$.



In the other case where $k=2^p$, choose $sigma(k)=(p-1,p-1)$.






share|cite|improve this answer











$endgroup$








  • 2




    $begingroup$
    (+1) Looks like you had the idea first. It's hacky but it works.
    $endgroup$
    – 6005
    17 hours ago










  • $begingroup$
    I was a bit confused about the $lfloor log_2(k) rfloor$ choice, but I now understand that this actually picks the highest power between $n$ and $m$, thus the problem with $k=2^p$. Thank you!
    $endgroup$
    – sam wolfe
    17 hours ago










  • $begingroup$
    @samwolfe you got it ;)
    $endgroup$
    – TheSilverDoe
    17 hours ago


















3












$begingroup$

We have to relax your requirement a bit due to the comment by TheSilverDoe. So we require that for all $boldsymbolm ge n ge 0$, $sigma(2^m + 2^n) = (m, n)$.
Then this is possible. First define
$$
tau(x) := lceil log_2(x) rceil - 1,
$$

for example, $tau(2) = 0$, $tau(3) = tau(4) = 1$, $tau(5) = 2$, etc.
Then, define
$$
sigma(x) := Big(tau(x), tau left( 1 + x - 2^tau(x) right) Big).
$$



How it works:



  • $tau(x)$ is the exponent in the largest power of $2$ smaller than $x$; that is, if $2^k < x le 2^k+1$, then $tau(x) = k$.


  • For any $m ge n ge 0$, we know that $2^m < 2^m + 2^n le 2^m+1$. Therefore, $tau(2^m + 2^n) = m$.


  • So for $x = 2^m + 2^n$, we get $tau(x) = m$. Then, $1 + x - 2^tau(x) = 1 + (2^m + 2^n) - 2^n = 2^m + 1$, and the largest power of $2$ smaller than $2^m + 1$ is $2^m$. Thus,
    $$tau(1 + x - 2^tau(x)) = n,$$
    so
    $$
    sigma(x) = (m,n).
    $$


Remark:
It seems likely that there will be no way to get a function $sigma$ that does not use floor functions or similar tricks. Some evidence for this is that there is no function on real numbers that satisfies $sigma(2^x + 2^y) = (x,y)$.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    Yes, I understood my question was initially not so well posed. Thanks for the edit and the explanation, helped me to better understand TheSilverDoe's answer.
    $endgroup$
    – sam wolfe
    17 hours ago


















2












$begingroup$

If you just want to define your functions, and you're writing for an audience of human readers, I would strongly recommend writing simply:




Define the functions $f$ and $g$ such that for all $ale b$ it holds that
$$f(2^a+2^b)=a qquad g(2^a+2^b)=b $$
and for any number $n$ that is not of the form $2^a+2^b$, we have $f(n)=g(n)=0$.



These conditions obviously define $f$ and $g$ uniquely.




This is much easier to understand, and will give the reader a much clearer intuition about what on earth you're doing, than to try to avoid using English words. (Deliberately attempting to avoid English words in definition almost leads to bad mathematical exposition).



If you're writing not for a human audience, then what you should write depends crucially on what the non-human audience will understand.



In particular, if you're trying to program a computer to implement appropriate $f$ and $g$ for you, you should not be looking for algebraic expressions at all. Rather, exploit the fact that there are operations that work for this built right into modern CPUs. On x86/x64 processors they're implemented by the BSF and BSR instructions. Some programming languages expose them fairly directly, such as Long.numberOfLeadingZeros(n) and Long.numberOfTrailingZeros(n) in Java -- you need just a bit of trivial arithmetic to convert the result of the former of these to the representation you want.






share|cite|improve this answer









$endgroup$












    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%2f3145419%2fis-there-an-explicit-function-mapping-2n2m-to-n-m%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









    5












    $begingroup$

    What do you think of
    $$forall k in mathbbN, quad sigma(k)=left( lfloor log_2(k) rfloor, lfloor log_2 left( k-2^lfloor log_2(k) rfloor right)rfloor right)$$



    This is well defined except when $k$ is a power of $2$.



    In the other case where $k=2^p$, choose $sigma(k)=(p-1,p-1)$.






    share|cite|improve this answer











    $endgroup$








    • 2




      $begingroup$
      (+1) Looks like you had the idea first. It's hacky but it works.
      $endgroup$
      – 6005
      17 hours ago










    • $begingroup$
      I was a bit confused about the $lfloor log_2(k) rfloor$ choice, but I now understand that this actually picks the highest power between $n$ and $m$, thus the problem with $k=2^p$. Thank you!
      $endgroup$
      – sam wolfe
      17 hours ago










    • $begingroup$
      @samwolfe you got it ;)
      $endgroup$
      – TheSilverDoe
      17 hours ago















    5












    $begingroup$

    What do you think of
    $$forall k in mathbbN, quad sigma(k)=left( lfloor log_2(k) rfloor, lfloor log_2 left( k-2^lfloor log_2(k) rfloor right)rfloor right)$$



    This is well defined except when $k$ is a power of $2$.



    In the other case where $k=2^p$, choose $sigma(k)=(p-1,p-1)$.






    share|cite|improve this answer











    $endgroup$








    • 2




      $begingroup$
      (+1) Looks like you had the idea first. It's hacky but it works.
      $endgroup$
      – 6005
      17 hours ago










    • $begingroup$
      I was a bit confused about the $lfloor log_2(k) rfloor$ choice, but I now understand that this actually picks the highest power between $n$ and $m$, thus the problem with $k=2^p$. Thank you!
      $endgroup$
      – sam wolfe
      17 hours ago










    • $begingroup$
      @samwolfe you got it ;)
      $endgroup$
      – TheSilverDoe
      17 hours ago













    5












    5








    5





    $begingroup$

    What do you think of
    $$forall k in mathbbN, quad sigma(k)=left( lfloor log_2(k) rfloor, lfloor log_2 left( k-2^lfloor log_2(k) rfloor right)rfloor right)$$



    This is well defined except when $k$ is a power of $2$.



    In the other case where $k=2^p$, choose $sigma(k)=(p-1,p-1)$.






    share|cite|improve this answer











    $endgroup$



    What do you think of
    $$forall k in mathbbN, quad sigma(k)=left( lfloor log_2(k) rfloor, lfloor log_2 left( k-2^lfloor log_2(k) rfloor right)rfloor right)$$



    This is well defined except when $k$ is a power of $2$.



    In the other case where $k=2^p$, choose $sigma(k)=(p-1,p-1)$.







    share|cite|improve this answer














    share|cite|improve this answer



    share|cite|improve this answer








    edited 17 hours ago

























    answered 18 hours ago









    TheSilverDoeTheSilverDoe

    3,804112




    3,804112







    • 2




      $begingroup$
      (+1) Looks like you had the idea first. It's hacky but it works.
      $endgroup$
      – 6005
      17 hours ago










    • $begingroup$
      I was a bit confused about the $lfloor log_2(k) rfloor$ choice, but I now understand that this actually picks the highest power between $n$ and $m$, thus the problem with $k=2^p$. Thank you!
      $endgroup$
      – sam wolfe
      17 hours ago










    • $begingroup$
      @samwolfe you got it ;)
      $endgroup$
      – TheSilverDoe
      17 hours ago












    • 2




      $begingroup$
      (+1) Looks like you had the idea first. It's hacky but it works.
      $endgroup$
      – 6005
      17 hours ago










    • $begingroup$
      I was a bit confused about the $lfloor log_2(k) rfloor$ choice, but I now understand that this actually picks the highest power between $n$ and $m$, thus the problem with $k=2^p$. Thank you!
      $endgroup$
      – sam wolfe
      17 hours ago










    • $begingroup$
      @samwolfe you got it ;)
      $endgroup$
      – TheSilverDoe
      17 hours ago







    2




    2




    $begingroup$
    (+1) Looks like you had the idea first. It's hacky but it works.
    $endgroup$
    – 6005
    17 hours ago




    $begingroup$
    (+1) Looks like you had the idea first. It's hacky but it works.
    $endgroup$
    – 6005
    17 hours ago












    $begingroup$
    I was a bit confused about the $lfloor log_2(k) rfloor$ choice, but I now understand that this actually picks the highest power between $n$ and $m$, thus the problem with $k=2^p$. Thank you!
    $endgroup$
    – sam wolfe
    17 hours ago




    $begingroup$
    I was a bit confused about the $lfloor log_2(k) rfloor$ choice, but I now understand that this actually picks the highest power between $n$ and $m$, thus the problem with $k=2^p$. Thank you!
    $endgroup$
    – sam wolfe
    17 hours ago












    $begingroup$
    @samwolfe you got it ;)
    $endgroup$
    – TheSilverDoe
    17 hours ago




    $begingroup$
    @samwolfe you got it ;)
    $endgroup$
    – TheSilverDoe
    17 hours ago











    3












    $begingroup$

    We have to relax your requirement a bit due to the comment by TheSilverDoe. So we require that for all $boldsymbolm ge n ge 0$, $sigma(2^m + 2^n) = (m, n)$.
    Then this is possible. First define
    $$
    tau(x) := lceil log_2(x) rceil - 1,
    $$

    for example, $tau(2) = 0$, $tau(3) = tau(4) = 1$, $tau(5) = 2$, etc.
    Then, define
    $$
    sigma(x) := Big(tau(x), tau left( 1 + x - 2^tau(x) right) Big).
    $$



    How it works:



    • $tau(x)$ is the exponent in the largest power of $2$ smaller than $x$; that is, if $2^k < x le 2^k+1$, then $tau(x) = k$.


    • For any $m ge n ge 0$, we know that $2^m < 2^m + 2^n le 2^m+1$. Therefore, $tau(2^m + 2^n) = m$.


    • So for $x = 2^m + 2^n$, we get $tau(x) = m$. Then, $1 + x - 2^tau(x) = 1 + (2^m + 2^n) - 2^n = 2^m + 1$, and the largest power of $2$ smaller than $2^m + 1$ is $2^m$. Thus,
      $$tau(1 + x - 2^tau(x)) = n,$$
      so
      $$
      sigma(x) = (m,n).
      $$


    Remark:
    It seems likely that there will be no way to get a function $sigma$ that does not use floor functions or similar tricks. Some evidence for this is that there is no function on real numbers that satisfies $sigma(2^x + 2^y) = (x,y)$.






    share|cite|improve this answer









    $endgroup$












    • $begingroup$
      Yes, I understood my question was initially not so well posed. Thanks for the edit and the explanation, helped me to better understand TheSilverDoe's answer.
      $endgroup$
      – sam wolfe
      17 hours ago















    3












    $begingroup$

    We have to relax your requirement a bit due to the comment by TheSilverDoe. So we require that for all $boldsymbolm ge n ge 0$, $sigma(2^m + 2^n) = (m, n)$.
    Then this is possible. First define
    $$
    tau(x) := lceil log_2(x) rceil - 1,
    $$

    for example, $tau(2) = 0$, $tau(3) = tau(4) = 1$, $tau(5) = 2$, etc.
    Then, define
    $$
    sigma(x) := Big(tau(x), tau left( 1 + x - 2^tau(x) right) Big).
    $$



    How it works:



    • $tau(x)$ is the exponent in the largest power of $2$ smaller than $x$; that is, if $2^k < x le 2^k+1$, then $tau(x) = k$.


    • For any $m ge n ge 0$, we know that $2^m < 2^m + 2^n le 2^m+1$. Therefore, $tau(2^m + 2^n) = m$.


    • So for $x = 2^m + 2^n$, we get $tau(x) = m$. Then, $1 + x - 2^tau(x) = 1 + (2^m + 2^n) - 2^n = 2^m + 1$, and the largest power of $2$ smaller than $2^m + 1$ is $2^m$. Thus,
      $$tau(1 + x - 2^tau(x)) = n,$$
      so
      $$
      sigma(x) = (m,n).
      $$


    Remark:
    It seems likely that there will be no way to get a function $sigma$ that does not use floor functions or similar tricks. Some evidence for this is that there is no function on real numbers that satisfies $sigma(2^x + 2^y) = (x,y)$.






    share|cite|improve this answer









    $endgroup$












    • $begingroup$
      Yes, I understood my question was initially not so well posed. Thanks for the edit and the explanation, helped me to better understand TheSilverDoe's answer.
      $endgroup$
      – sam wolfe
      17 hours ago













    3












    3








    3





    $begingroup$

    We have to relax your requirement a bit due to the comment by TheSilverDoe. So we require that for all $boldsymbolm ge n ge 0$, $sigma(2^m + 2^n) = (m, n)$.
    Then this is possible. First define
    $$
    tau(x) := lceil log_2(x) rceil - 1,
    $$

    for example, $tau(2) = 0$, $tau(3) = tau(4) = 1$, $tau(5) = 2$, etc.
    Then, define
    $$
    sigma(x) := Big(tau(x), tau left( 1 + x - 2^tau(x) right) Big).
    $$



    How it works:



    • $tau(x)$ is the exponent in the largest power of $2$ smaller than $x$; that is, if $2^k < x le 2^k+1$, then $tau(x) = k$.


    • For any $m ge n ge 0$, we know that $2^m < 2^m + 2^n le 2^m+1$. Therefore, $tau(2^m + 2^n) = m$.


    • So for $x = 2^m + 2^n$, we get $tau(x) = m$. Then, $1 + x - 2^tau(x) = 1 + (2^m + 2^n) - 2^n = 2^m + 1$, and the largest power of $2$ smaller than $2^m + 1$ is $2^m$. Thus,
      $$tau(1 + x - 2^tau(x)) = n,$$
      so
      $$
      sigma(x) = (m,n).
      $$


    Remark:
    It seems likely that there will be no way to get a function $sigma$ that does not use floor functions or similar tricks. Some evidence for this is that there is no function on real numbers that satisfies $sigma(2^x + 2^y) = (x,y)$.






    share|cite|improve this answer









    $endgroup$



    We have to relax your requirement a bit due to the comment by TheSilverDoe. So we require that for all $boldsymbolm ge n ge 0$, $sigma(2^m + 2^n) = (m, n)$.
    Then this is possible. First define
    $$
    tau(x) := lceil log_2(x) rceil - 1,
    $$

    for example, $tau(2) = 0$, $tau(3) = tau(4) = 1$, $tau(5) = 2$, etc.
    Then, define
    $$
    sigma(x) := Big(tau(x), tau left( 1 + x - 2^tau(x) right) Big).
    $$



    How it works:



    • $tau(x)$ is the exponent in the largest power of $2$ smaller than $x$; that is, if $2^k < x le 2^k+1$, then $tau(x) = k$.


    • For any $m ge n ge 0$, we know that $2^m < 2^m + 2^n le 2^m+1$. Therefore, $tau(2^m + 2^n) = m$.


    • So for $x = 2^m + 2^n$, we get $tau(x) = m$. Then, $1 + x - 2^tau(x) = 1 + (2^m + 2^n) - 2^n = 2^m + 1$, and the largest power of $2$ smaller than $2^m + 1$ is $2^m$. Thus,
      $$tau(1 + x - 2^tau(x)) = n,$$
      so
      $$
      sigma(x) = (m,n).
      $$


    Remark:
    It seems likely that there will be no way to get a function $sigma$ that does not use floor functions or similar tricks. Some evidence for this is that there is no function on real numbers that satisfies $sigma(2^x + 2^y) = (x,y)$.







    share|cite|improve this answer












    share|cite|improve this answer



    share|cite|improve this answer










    answered 17 hours ago









    60056005

    36.7k751127




    36.7k751127











    • $begingroup$
      Yes, I understood my question was initially not so well posed. Thanks for the edit and the explanation, helped me to better understand TheSilverDoe's answer.
      $endgroup$
      – sam wolfe
      17 hours ago
















    • $begingroup$
      Yes, I understood my question was initially not so well posed. Thanks for the edit and the explanation, helped me to better understand TheSilverDoe's answer.
      $endgroup$
      – sam wolfe
      17 hours ago















    $begingroup$
    Yes, I understood my question was initially not so well posed. Thanks for the edit and the explanation, helped me to better understand TheSilverDoe's answer.
    $endgroup$
    – sam wolfe
    17 hours ago




    $begingroup$
    Yes, I understood my question was initially not so well posed. Thanks for the edit and the explanation, helped me to better understand TheSilverDoe's answer.
    $endgroup$
    – sam wolfe
    17 hours ago











    2












    $begingroup$

    If you just want to define your functions, and you're writing for an audience of human readers, I would strongly recommend writing simply:




    Define the functions $f$ and $g$ such that for all $ale b$ it holds that
    $$f(2^a+2^b)=a qquad g(2^a+2^b)=b $$
    and for any number $n$ that is not of the form $2^a+2^b$, we have $f(n)=g(n)=0$.



    These conditions obviously define $f$ and $g$ uniquely.




    This is much easier to understand, and will give the reader a much clearer intuition about what on earth you're doing, than to try to avoid using English words. (Deliberately attempting to avoid English words in definition almost leads to bad mathematical exposition).



    If you're writing not for a human audience, then what you should write depends crucially on what the non-human audience will understand.



    In particular, if you're trying to program a computer to implement appropriate $f$ and $g$ for you, you should not be looking for algebraic expressions at all. Rather, exploit the fact that there are operations that work for this built right into modern CPUs. On x86/x64 processors they're implemented by the BSF and BSR instructions. Some programming languages expose them fairly directly, such as Long.numberOfLeadingZeros(n) and Long.numberOfTrailingZeros(n) in Java -- you need just a bit of trivial arithmetic to convert the result of the former of these to the representation you want.






    share|cite|improve this answer









    $endgroup$

















      2












      $begingroup$

      If you just want to define your functions, and you're writing for an audience of human readers, I would strongly recommend writing simply:




      Define the functions $f$ and $g$ such that for all $ale b$ it holds that
      $$f(2^a+2^b)=a qquad g(2^a+2^b)=b $$
      and for any number $n$ that is not of the form $2^a+2^b$, we have $f(n)=g(n)=0$.



      These conditions obviously define $f$ and $g$ uniquely.




      This is much easier to understand, and will give the reader a much clearer intuition about what on earth you're doing, than to try to avoid using English words. (Deliberately attempting to avoid English words in definition almost leads to bad mathematical exposition).



      If you're writing not for a human audience, then what you should write depends crucially on what the non-human audience will understand.



      In particular, if you're trying to program a computer to implement appropriate $f$ and $g$ for you, you should not be looking for algebraic expressions at all. Rather, exploit the fact that there are operations that work for this built right into modern CPUs. On x86/x64 processors they're implemented by the BSF and BSR instructions. Some programming languages expose them fairly directly, such as Long.numberOfLeadingZeros(n) and Long.numberOfTrailingZeros(n) in Java -- you need just a bit of trivial arithmetic to convert the result of the former of these to the representation you want.






      share|cite|improve this answer









      $endgroup$















        2












        2








        2





        $begingroup$

        If you just want to define your functions, and you're writing for an audience of human readers, I would strongly recommend writing simply:




        Define the functions $f$ and $g$ such that for all $ale b$ it holds that
        $$f(2^a+2^b)=a qquad g(2^a+2^b)=b $$
        and for any number $n$ that is not of the form $2^a+2^b$, we have $f(n)=g(n)=0$.



        These conditions obviously define $f$ and $g$ uniquely.




        This is much easier to understand, and will give the reader a much clearer intuition about what on earth you're doing, than to try to avoid using English words. (Deliberately attempting to avoid English words in definition almost leads to bad mathematical exposition).



        If you're writing not for a human audience, then what you should write depends crucially on what the non-human audience will understand.



        In particular, if you're trying to program a computer to implement appropriate $f$ and $g$ for you, you should not be looking for algebraic expressions at all. Rather, exploit the fact that there are operations that work for this built right into modern CPUs. On x86/x64 processors they're implemented by the BSF and BSR instructions. Some programming languages expose them fairly directly, such as Long.numberOfLeadingZeros(n) and Long.numberOfTrailingZeros(n) in Java -- you need just a bit of trivial arithmetic to convert the result of the former of these to the representation you want.






        share|cite|improve this answer









        $endgroup$



        If you just want to define your functions, and you're writing for an audience of human readers, I would strongly recommend writing simply:




        Define the functions $f$ and $g$ such that for all $ale b$ it holds that
        $$f(2^a+2^b)=a qquad g(2^a+2^b)=b $$
        and for any number $n$ that is not of the form $2^a+2^b$, we have $f(n)=g(n)=0$.



        These conditions obviously define $f$ and $g$ uniquely.




        This is much easier to understand, and will give the reader a much clearer intuition about what on earth you're doing, than to try to avoid using English words. (Deliberately attempting to avoid English words in definition almost leads to bad mathematical exposition).



        If you're writing not for a human audience, then what you should write depends crucially on what the non-human audience will understand.



        In particular, if you're trying to program a computer to implement appropriate $f$ and $g$ for you, you should not be looking for algebraic expressions at all. Rather, exploit the fact that there are operations that work for this built right into modern CPUs. On x86/x64 processors they're implemented by the BSF and BSR instructions. Some programming languages expose them fairly directly, such as Long.numberOfLeadingZeros(n) and Long.numberOfTrailingZeros(n) in Java -- you need just a bit of trivial arithmetic to convert the result of the former of these to the representation you want.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered 17 hours ago









        Henning MakholmHenning Makholm

        242k17308549




        242k17308549



























            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3145419%2fis-there-an-explicit-function-mapping-2n2m-to-n-m%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







            -elementary-number-theory, functions

            Popular posts from this blog

            Word for a person who has no opinion about whether god existsWord for having a definite opinion while simultaneously withholding judgment?What's the opposite of “newcomer? Is ”veteran" OK?What do you call an “atheist” who might believe in an afterlife?What's a word for someone who wants to voice opinions but not have them challenged?Word for someone who dismisses contrary opinions as irrational?Somone who thinks they are overly special/out of the ordinaryIs there a word, phrase or idiom for “a person who is incapable of thinking about the future”?The belief that a god is human-likeA word for a non-famous person/thing you have heard a lot aboutAdjective for a person who enjoys taking care of their appearance

            What was this official D&D 3.5e Lovecraft-flavored rulebook?What was this set of RPG tools called?As a first-time DM should I let my players play complex character classes and roles?Nymph's Kiss and the RelationshipWhat was the name of this Cleric Prestige Class that shapes metal with its bare hands?Are the 3.5e Dragonlance books third party or official works?What's up with the domain Vile Darkness?What was this 80s book about RPGs?What was the name of this Werewolf band?What book had Rituals to “upgrade” animal companions to keep them viable at higher levels?What was this RPG that had rules for player-owned businesses?

            2017 IndyCar Series Contents Series news Teams and drivers Schedule Season summary Footnotes References External links Navigation menu"INDYCAR: Initial 2018 bodywork concepts unveiled"the original"IndyCar confirms switch to Performance Friction brakes in 2017""AJ Foyt Racing will switch to Chevy"the original"Carlos Munoz, Conor Daly will drive for AJ Foyt Racing""Zach Veach's Indy 500 Debut Confirmed with Foyt""No mass exodus from Honda after Ganassi switch""Ex-F1 driver Sato joins Andretti Autosport for 2017 IndyCar season""IndyCar's Ryan Hunter-Reay, sponsor DHL paired through 2020""hhgregg and Andretti Autosport announce partnership for key races in 2016""INDYCAR: Rossi re-signs with Andretti"the original"McLaren Formula 1 - Fernando Alonso to race at Indy 500 with McLaren, Honda and Andretti Autosport""Shank will finally take part in Indy 500 with Harvey, Andretti | MotorSportsTalk""Andretti adds Jack Harvey to Indy 500 field""Ganassi switches to Honda power for 2017""INDYCAR: Chilton returns to Ganassi"the original"IndyCar silly season: Who's going where in 2017?""INDYCAR: Kanaan, NTT Data return to Ganassi"the original"Kimball to remain at Ganassi for 2017""Coyne confirms Bourdais for 2017 IndyCar season""Davison to sub for Bourdais in Indy 500"the original"Gutierrez confirmed for Detroit IndyCar debut""Gutierrez returns with Coyne for rest of 2017 season""Vautier to drive for Coyne at Texas"the original"INDYCAR: Coyne confirms Jones for 2017"the original"Pippa Mann returns to Coyne for Indy 500""Karam, Dreyer & Reinbold teaming up again for Indianapolis 500""Pigot to return to Ed Carpenter Racing""Hildebrand confirmed as full-time Ed Carpenter driver""Veach to replace injured Hildebrand at Barber"the originalNew Team Harding Racing Enters Chaves for 101st Indianapolis 500"Juncos Racing Announces Entry in 101st Running of the Indianapolis 500 :: Juncos Racing""Juncos confirms Pigot for Indy 500""Saavedra confirmed in Juncos' second 500 entry"the original"Lazier confirms Indy 500 run after son's USF2000 debut"the original"Claman DeMelo to race for RLLR at Sonoma"the original"Rahal signs Servia and ace engineer for 2017""IndyCar: Aleshin returns with Schmidt"the original"Aleshin replaced by Saavedra for Toronto""Jack Harvey will pilot SPM No. 7 car at Watkins Glen, Sonoma""Jay Howard confirmed in Tony Stewart's supported SPM Indy entry""INDYCAR: Newgarden to wave the flag at Penske"the original"Pagenaud opts for No. 1 in 2017"the original"Penske confirms Newgarden for 2017""Montoya to stay with Team Penske in 2017""Target leaving IndyCar after 27 seasons with Chip Ganassi""Cavin: IndyCar could see complete driver/team shakeup in 2017""End of the road for KV Racing?""KV Racing confirms closure, equipment sold to Juncos""Juncos confirms IndyCar Series entry"the original"Juncos readies IndyCar program, aims for '17 500"the original"Harding Racing to add Texas, Pocono to schedule"the original"Sato signs with Andretti Autosport for 2017""INDYCAR: Aleshin in Doubt at SPM"the original"Long Beach notebook: JR Hildebrand breaks hand""Hildebrand cleared to return at Phoenix"the original"Bourdais to undergo surgery on multiple fractures""Aleshin loses Schmidt Peterson IndyCar ride""Saavedra in at SPM for Pocono, Gateway"the original"Bourdais to make return at Gateway"the original"The IndyCar Grand Prix no longer is sponsored by Angie's List""2017 IndyCar Series rulebook""2017 Verizon IndyCar Series Official Rulebook"Official websiteeeeee