Source permutationSwap the parityWhat an Odd FunctionReconstruct a PermutationSpiral Permutation SequencePermutation Square RootParity of a PermutationSteps of PermutationInverse permutation indexPermutation? Permutatino!Code golf the best permutationPumping quine radixCollapsing numbers

Sword in the Stone story where the sword was held in place by electromagnets

Should QA ask requirements to developers?

How do anti-virus programs start at Windows boot?

Is going from continuous data to categorical always wrong?

Question about partial fractions with irreducible quadratic factors

Want to switch to tankless, but can I use my existing wiring?

Unreachable code, but reachable with exception

What wound would be of little consequence to a biped but terrible for a quadruped?

What is the blue range indicating on this manifold pressure gauge?

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

Time dilation for a moving electronic clock

My adviser wants to be the first author

Does Linux have system calls to access all the features of the file systems it supports?

When is a batch class instantiated when you schedule it?

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

Decoding assembly instructions in a Game Boy disassembler

Examples of odd-dimensional manifolds that do not admit contact structure

Excess Zinc in garden soil

"One can do his homework in the library"

What is the dot in “1.2.4."

Word for a person who has no opinion about whether god exists

validation vs test vs training accuracy, which one to compare for claiming overfit?

What exactly is the purpose of connection links straped between the rocket and the launch pad

redhat 7 + How to stop systemctl service permanent



Source permutation


Swap the parityWhat an Odd FunctionReconstruct a PermutationSpiral Permutation SequencePermutation Square RootParity of a PermutationSteps of PermutationInverse permutation indexPermutation? Permutatino!Code golf the best permutationPumping quine radixCollapsing numbers













11












$begingroup$


A permutation of a set $S = s_1, s_2, dotsc, s_n$ is a bijective function $pi: S to S$. For example, if $S = 1,2,3,4$ then the function $pi: x mapsto 1 + (x + 1 mod 4)$ is a permutation:



$$
pi(1) = 3,quad
pi(2) = 4,quad
pi(3) = 1,quad
pi(4) = 2
$$



We can also have permutations on infinite sets, let's take $mathbbN$ as an example: The function $pi: x mapsto x-1 + 2cdot(x mod 2)$ is a permutation, swapping the odd and even integers in blocks of two. The first elements are as follows:



$$
2,1,4,3,6,5,8,7,10,9,12,11,14,13,16,15,dotsc
$$



Challenge



Your task for this challenge is to write a function/program implementing any1 permutation on the positive natural numbers. The score of your solution is the sum of codepoints after mapping them with the implemented permutation.



Example



Suppose we take the above permutation implemented with Python:





def pi(x):
return x - 1 + 2*(x % 2)


Try it online!



The character d has codepoint $100$, $textttpi(100) = 99$. If we do this for every character, we get:



$$
99,102,101,31,111,106,39,119,42,57,9,31,31,31,31,113,102,115,118,113,109,31,119,31,46,31,50,31,44,31,49,41,39,119,31,38,31,49,42
$$



The sum of all these mapped characters is $2463$, this would be the score for that function.



Rules



You will implement a permutation $pi$ either as a function or program



  • given an natural number $x$, return/output $pi(x)$

  • for the purpose of this challenge $mathbbN$ does not contain $0$

  • the permutation must non-trivially permute an infinite subset of $mathbbN$

  • your function/program is not allowed to read its own source

Scoring



The score is given by the sum of all codepoints (zero bytes may not be part of the source code) under that permutation (the codepoints depend on your language2, you're free to use SBCS, UTF-8 etc. as long as your language supports it).



The submission with the lowest score wins, ties are broken by earliest submission.




  1. Except for permutations which only permute a finite subset of $mathbbN$, meaning that the set $ pi(x) neq x $ must be infinite.


  2. If it improves your score, you can for example use a UTF-8 encoded Jelly submission instead of the usual SBCS.










share|improve this question











$endgroup$











  • $begingroup$
    By non-trivially permute do you mean you just can't do 1,2,3...* or that you also can't do stuff like 2,1,3,4...*?
    $endgroup$
    – Jo King
    Mar 10 at 23:30











  • $begingroup$
    Can our submission be 0-indexed? i.e. Given 0, output the first element of the permutation. If our sequence is 1-indexed how do we score NUL bytes?
    $endgroup$
    – Jo King
    Mar 11 at 1:00







  • 1




    $begingroup$
    @JoKing "zero bytes may not be part of the source code" re: the second question
    $endgroup$
    – ASCII-only
    Mar 11 at 1:11











  • $begingroup$
    @ASCII-only oops, i misinterpreted that as a weird way of saying your code must be non-empty >.<
    $endgroup$
    – Jo King
    Mar 11 at 1:17










  • $begingroup$
    Related.
    $endgroup$
    – Peter Taylor
    2 days ago















11












$begingroup$


A permutation of a set $S = s_1, s_2, dotsc, s_n$ is a bijective function $pi: S to S$. For example, if $S = 1,2,3,4$ then the function $pi: x mapsto 1 + (x + 1 mod 4)$ is a permutation:



$$
pi(1) = 3,quad
pi(2) = 4,quad
pi(3) = 1,quad
pi(4) = 2
$$



We can also have permutations on infinite sets, let's take $mathbbN$ as an example: The function $pi: x mapsto x-1 + 2cdot(x mod 2)$ is a permutation, swapping the odd and even integers in blocks of two. The first elements are as follows:



$$
2,1,4,3,6,5,8,7,10,9,12,11,14,13,16,15,dotsc
$$



Challenge



Your task for this challenge is to write a function/program implementing any1 permutation on the positive natural numbers. The score of your solution is the sum of codepoints after mapping them with the implemented permutation.



Example



Suppose we take the above permutation implemented with Python:





def pi(x):
return x - 1 + 2*(x % 2)


Try it online!



The character d has codepoint $100$, $textttpi(100) = 99$. If we do this for every character, we get:



$$
99,102,101,31,111,106,39,119,42,57,9,31,31,31,31,113,102,115,118,113,109,31,119,31,46,31,50,31,44,31,49,41,39,119,31,38,31,49,42
$$



The sum of all these mapped characters is $2463$, this would be the score for that function.



Rules



You will implement a permutation $pi$ either as a function or program



  • given an natural number $x$, return/output $pi(x)$

  • for the purpose of this challenge $mathbbN$ does not contain $0$

  • the permutation must non-trivially permute an infinite subset of $mathbbN$

  • your function/program is not allowed to read its own source

Scoring



The score is given by the sum of all codepoints (zero bytes may not be part of the source code) under that permutation (the codepoints depend on your language2, you're free to use SBCS, UTF-8 etc. as long as your language supports it).



The submission with the lowest score wins, ties are broken by earliest submission.




  1. Except for permutations which only permute a finite subset of $mathbbN$, meaning that the set $ pi(x) neq x $ must be infinite.


  2. If it improves your score, you can for example use a UTF-8 encoded Jelly submission instead of the usual SBCS.










share|improve this question











$endgroup$











  • $begingroup$
    By non-trivially permute do you mean you just can't do 1,2,3...* or that you also can't do stuff like 2,1,3,4...*?
    $endgroup$
    – Jo King
    Mar 10 at 23:30











  • $begingroup$
    Can our submission be 0-indexed? i.e. Given 0, output the first element of the permutation. If our sequence is 1-indexed how do we score NUL bytes?
    $endgroup$
    – Jo King
    Mar 11 at 1:00







  • 1




    $begingroup$
    @JoKing "zero bytes may not be part of the source code" re: the second question
    $endgroup$
    – ASCII-only
    Mar 11 at 1:11











  • $begingroup$
    @ASCII-only oops, i misinterpreted that as a weird way of saying your code must be non-empty >.<
    $endgroup$
    – Jo King
    Mar 11 at 1:17










  • $begingroup$
    Related.
    $endgroup$
    – Peter Taylor
    2 days ago













11












11








11





$begingroup$


A permutation of a set $S = s_1, s_2, dotsc, s_n$ is a bijective function $pi: S to S$. For example, if $S = 1,2,3,4$ then the function $pi: x mapsto 1 + (x + 1 mod 4)$ is a permutation:



$$
pi(1) = 3,quad
pi(2) = 4,quad
pi(3) = 1,quad
pi(4) = 2
$$



We can also have permutations on infinite sets, let's take $mathbbN$ as an example: The function $pi: x mapsto x-1 + 2cdot(x mod 2)$ is a permutation, swapping the odd and even integers in blocks of two. The first elements are as follows:



$$
2,1,4,3,6,5,8,7,10,9,12,11,14,13,16,15,dotsc
$$



Challenge



Your task for this challenge is to write a function/program implementing any1 permutation on the positive natural numbers. The score of your solution is the sum of codepoints after mapping them with the implemented permutation.



Example



Suppose we take the above permutation implemented with Python:





def pi(x):
return x - 1 + 2*(x % 2)


Try it online!



The character d has codepoint $100$, $textttpi(100) = 99$. If we do this for every character, we get:



$$
99,102,101,31,111,106,39,119,42,57,9,31,31,31,31,113,102,115,118,113,109,31,119,31,46,31,50,31,44,31,49,41,39,119,31,38,31,49,42
$$



The sum of all these mapped characters is $2463$, this would be the score for that function.



Rules



You will implement a permutation $pi$ either as a function or program



  • given an natural number $x$, return/output $pi(x)$

  • for the purpose of this challenge $mathbbN$ does not contain $0$

  • the permutation must non-trivially permute an infinite subset of $mathbbN$

  • your function/program is not allowed to read its own source

Scoring



The score is given by the sum of all codepoints (zero bytes may not be part of the source code) under that permutation (the codepoints depend on your language2, you're free to use SBCS, UTF-8 etc. as long as your language supports it).



The submission with the lowest score wins, ties are broken by earliest submission.




  1. Except for permutations which only permute a finite subset of $mathbbN$, meaning that the set $ pi(x) neq x $ must be infinite.


  2. If it improves your score, you can for example use a UTF-8 encoded Jelly submission instead of the usual SBCS.










share|improve this question











$endgroup$




A permutation of a set $S = s_1, s_2, dotsc, s_n$ is a bijective function $pi: S to S$. For example, if $S = 1,2,3,4$ then the function $pi: x mapsto 1 + (x + 1 mod 4)$ is a permutation:



$$
pi(1) = 3,quad
pi(2) = 4,quad
pi(3) = 1,quad
pi(4) = 2
$$



We can also have permutations on infinite sets, let's take $mathbbN$ as an example: The function $pi: x mapsto x-1 + 2cdot(x mod 2)$ is a permutation, swapping the odd and even integers in blocks of two. The first elements are as follows:



$$
2,1,4,3,6,5,8,7,10,9,12,11,14,13,16,15,dotsc
$$



Challenge



Your task for this challenge is to write a function/program implementing any1 permutation on the positive natural numbers. The score of your solution is the sum of codepoints after mapping them with the implemented permutation.



Example



Suppose we take the above permutation implemented with Python:





def pi(x):
return x - 1 + 2*(x % 2)


Try it online!



The character d has codepoint $100$, $textttpi(100) = 99$. If we do this for every character, we get:



$$
99,102,101,31,111,106,39,119,42,57,9,31,31,31,31,113,102,115,118,113,109,31,119,31,46,31,50,31,44,31,49,41,39,119,31,38,31,49,42
$$



The sum of all these mapped characters is $2463$, this would be the score for that function.



Rules



You will implement a permutation $pi$ either as a function or program



  • given an natural number $x$, return/output $pi(x)$

  • for the purpose of this challenge $mathbbN$ does not contain $0$

  • the permutation must non-trivially permute an infinite subset of $mathbbN$

  • your function/program is not allowed to read its own source

Scoring



The score is given by the sum of all codepoints (zero bytes may not be part of the source code) under that permutation (the codepoints depend on your language2, you're free to use SBCS, UTF-8 etc. as long as your language supports it).



The submission with the lowest score wins, ties are broken by earliest submission.




  1. Except for permutations which only permute a finite subset of $mathbbN$, meaning that the set $ pi(x) neq x $ must be infinite.


  2. If it improves your score, you can for example use a UTF-8 encoded Jelly submission instead of the usual SBCS.







code-challenge sequence integer permutations self-referential






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 4 hours ago









DJMcMayhem

41.1k12148313




41.1k12148313










asked Mar 10 at 16:41









ბიმობიმო

12k22393




12k22393











  • $begingroup$
    By non-trivially permute do you mean you just can't do 1,2,3...* or that you also can't do stuff like 2,1,3,4...*?
    $endgroup$
    – Jo King
    Mar 10 at 23:30











  • $begingroup$
    Can our submission be 0-indexed? i.e. Given 0, output the first element of the permutation. If our sequence is 1-indexed how do we score NUL bytes?
    $endgroup$
    – Jo King
    Mar 11 at 1:00







  • 1




    $begingroup$
    @JoKing "zero bytes may not be part of the source code" re: the second question
    $endgroup$
    – ASCII-only
    Mar 11 at 1:11











  • $begingroup$
    @ASCII-only oops, i misinterpreted that as a weird way of saying your code must be non-empty >.<
    $endgroup$
    – Jo King
    Mar 11 at 1:17










  • $begingroup$
    Related.
    $endgroup$
    – Peter Taylor
    2 days ago
















  • $begingroup$
    By non-trivially permute do you mean you just can't do 1,2,3...* or that you also can't do stuff like 2,1,3,4...*?
    $endgroup$
    – Jo King
    Mar 10 at 23:30











  • $begingroup$
    Can our submission be 0-indexed? i.e. Given 0, output the first element of the permutation. If our sequence is 1-indexed how do we score NUL bytes?
    $endgroup$
    – Jo King
    Mar 11 at 1:00







  • 1




    $begingroup$
    @JoKing "zero bytes may not be part of the source code" re: the second question
    $endgroup$
    – ASCII-only
    Mar 11 at 1:11











  • $begingroup$
    @ASCII-only oops, i misinterpreted that as a weird way of saying your code must be non-empty >.<
    $endgroup$
    – Jo King
    Mar 11 at 1:17










  • $begingroup$
    Related.
    $endgroup$
    – Peter Taylor
    2 days ago















$begingroup$
By non-trivially permute do you mean you just can't do 1,2,3...* or that you also can't do stuff like 2,1,3,4...*?
$endgroup$
– Jo King
Mar 10 at 23:30





$begingroup$
By non-trivially permute do you mean you just can't do 1,2,3...* or that you also can't do stuff like 2,1,3,4...*?
$endgroup$
– Jo King
Mar 10 at 23:30













$begingroup$
Can our submission be 0-indexed? i.e. Given 0, output the first element of the permutation. If our sequence is 1-indexed how do we score NUL bytes?
$endgroup$
– Jo King
Mar 11 at 1:00





$begingroup$
Can our submission be 0-indexed? i.e. Given 0, output the first element of the permutation. If our sequence is 1-indexed how do we score NUL bytes?
$endgroup$
– Jo King
Mar 11 at 1:00





1




1




$begingroup$
@JoKing "zero bytes may not be part of the source code" re: the second question
$endgroup$
– ASCII-only
Mar 11 at 1:11





$begingroup$
@JoKing "zero bytes may not be part of the source code" re: the second question
$endgroup$
– ASCII-only
Mar 11 at 1:11













$begingroup$
@ASCII-only oops, i misinterpreted that as a weird way of saying your code must be non-empty >.<
$endgroup$
– Jo King
Mar 11 at 1:17




$begingroup$
@ASCII-only oops, i misinterpreted that as a weird way of saying your code must be non-empty >.<
$endgroup$
– Jo King
Mar 11 at 1:17












$begingroup$
Related.
$endgroup$
– Peter Taylor
2 days ago




$begingroup$
Related.
$endgroup$
– Peter Taylor
2 days ago










8 Answers
8






active

oldest

votes


















6












$begingroup$


Jelly, score  288 250 212  199



-38 thanks to Erik the Outgolfer!



C-*+


Swaps even with odd.



The score is $67+45+44+43=199$ - see self-scoring here.



Try it online!






share|improve this answer











$endgroup$












  • $begingroup$
    Apparently, Leaky Nun's -*ạ has a score of 300... however, -*_@ has a score of 250. Maybe I should post that as my own, although it's the same permutation.
    $endgroup$
    – Erik the Outgolfer
    Mar 10 at 17:42











  • $begingroup$
    Ah nice observation by Leaky Nun, so -*N+ scores 212
    $endgroup$
    – Jonathan Allan
    Mar 10 at 17:52










  • $begingroup$
    It wasn't an observation, it was a self-answer to his (now pretty old) challenge. ;-)
    $endgroup$
    – Erik the Outgolfer
    Mar 10 at 17:52







  • 3




    $begingroup$
    C-*+ sound like some future variation of C++.
    $endgroup$
    – val
    2 days ago


















5












$begingroup$

JavaScript (ES6), Score =  276  268





$=>(--$^40)+!0


Try it online!






share|improve this answer











$endgroup$












  • $begingroup$
    but 54^54 is 0
    $endgroup$
    – Jonathan Allan
    Mar 10 at 17:56










  • $begingroup$
    @JonathanAllan Thanks for notifying. I somehow missed that part. Should be correct now.
    $endgroup$
    – Arnauld
    Mar 10 at 18:04


















3












$begingroup$


Perl 6, Score: 201





*-!0+^40+!0


Try it online!



Port of Arnauld's answer. This benefits from xor (+^) having the same precedence as - and +, and the use of a Whatever lambda to reduce overall characters. Other than that, I couldn't find a way of representing it differently that got a better score.




Perl 6, Score 804 702





(++$∉ords(q[!$%()+-2?[]_doqrsx∉])??++$+22-$++%2-$++%2!!++$)xx$_()[-!$+$_]


Try it online!



The first quine-y type answer here, and I think it scores pretty well.



This produces the sequence $23,22,25,24...$ from the question body with the range $1,2,3,4...21$ inserted at the indexes of the unique sorted codepoints of the code. For example, the 30th through 35th elements of the sequence are $50, 53, 52, 1, 55, 54$ since the 33rd codepoint is ! and that's the lowest codepoint in my code.






share|improve this answer











$endgroup$












  • $begingroup$
    O_o that's a massive improvement
    $endgroup$
    – ASCII-only
    2 days ago


















2












$begingroup$


Retina 0.8.2, 6 bytes, score 260



T`O`RO


Try it online! Link includes self-scoring footer. Simply swaps digits 1 and 9 and 3 and 7 in the decimal representations, so that numbers that contain no digits coprime to 10 are unaffected.






share|improve this answer









$endgroup$




















    2












    $begingroup$


    C# (Visual C# Interactive Compiler), 22 bytes, Score 247 245





    A=>A>65?A-1+A%2*2:66-A


    Try it online!



    Simple, if less than 66, return 66 minus input, else use the formula in the question that swaps even and odd numbers.






    share|improve this answer











    $endgroup$












    • $begingroup$
      What's wrong with the previous version A=>A<66?66-A:A?
      $endgroup$
      – Jo King
      Mar 11 at 2:35






    • 1




      $begingroup$
      @JoKing Except for permutations which only permute a finite subset of $mathbbN$, meaning that the set $ pi(x) neq x $ must be infinite. The set isn't infinite, since the only values in the set are 1-65, since above 65, all values of A map to A
      $endgroup$
      – Embodiment of Ignorance
      Mar 11 at 2:37










    • $begingroup$
      Oh darn, I didn't notice that. That means my own answer is invalid too :(
      $endgroup$
      – Jo King
      Mar 11 at 2:40



















    1












    $begingroup$


    Charcoal, 13 bytes, score 681



    ⁻⁺²³²ι⊗﹪⊖ι²³³


    Try it online! Link is to self-scoring version with header to map over an array of byte codes. (Charcoal has a custom code page so I've manually inserted the correct byte codes in the input.) Works by reversing ranges of 233 numbers, so that 117, 350, 583 ... are unchanged. Explanation:



     ι Value
    ⁺ Plus
    ²³² Literal 232
    ⁻ Minus
    ι Value
    ⊖ Decremented
    ﹪ Modulo
    ²³³ Literal 233
    ⊗ Doubled





    share|improve this answer









    $endgroup$




















      1












      $begingroup$

      Haskell, score 985



      (((.),(-))->(.)*200+mod(-39+(-))200+1).((*)->divMod((*)-1)200)


      Try it online!






      share|improve this answer











      $endgroup$












      • $begingroup$
        I don't think this is a permutation, since adding a*200 has no effect modulo 200 so a doesn't matter.
        $endgroup$
        – xnor
        Mar 10 at 22:34










      • $begingroup$
        @xnor Good catch. That's supposed to be outside of the mod. At some point while golfing, I must have messed up order of operations. Fixed now, thanks!
        $endgroup$
        – Joseph Sible
        Mar 10 at 22:52











      • $begingroup$
        I think there's another issue that 40 maps to 0 but the challenge requires positive integers, which makes approaches like this tricky.
        $endgroup$
        – xnor
        Mar 10 at 23:15






      • 1




        $begingroup$
        Using sum[1|...] over if..then..else should help.
        $endgroup$
        – ბიმო
        Mar 11 at 0:09






      • 1




        $begingroup$
        Let us continue this discussion in chat.
        $endgroup$
        – ASCII-only
        Mar 11 at 1:18


















      1












      $begingroup$


      05AB1E, score: 488 in 05AB1E's code page



      È·<-


      Swaps odd and even like the example function.



      Will try to improve the score from here.



      Try it online with input in the range [1, 100] or Try it online with the codepoints.



      Explanation:





      È # Check if the (implicit) input is even (1 if truhy; 0 if falsey)
      · # Double (2 if truthy; 0 if falsey)
      < # Decrease by 1 (1 if truthy; -1 if falsey)
      - # Subtract it from the (implicit) input (and output implicitly)





      share|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.ifUsing("editor", function ()
        StackExchange.using("externalEditor", function ()
        StackExchange.using("snippets", function ()
        StackExchange.snippets.init();
        );
        );
        , "code-snippets");

        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "200"
        ;
        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: false,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        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
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f181262%2fsource-permutation%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        8 Answers
        8






        active

        oldest

        votes








        8 Answers
        8






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        6












        $begingroup$


        Jelly, score  288 250 212  199



        -38 thanks to Erik the Outgolfer!



        C-*+


        Swaps even with odd.



        The score is $67+45+44+43=199$ - see self-scoring here.



        Try it online!






        share|improve this answer











        $endgroup$












        • $begingroup$
          Apparently, Leaky Nun's -*ạ has a score of 300... however, -*_@ has a score of 250. Maybe I should post that as my own, although it's the same permutation.
          $endgroup$
          – Erik the Outgolfer
          Mar 10 at 17:42











        • $begingroup$
          Ah nice observation by Leaky Nun, so -*N+ scores 212
          $endgroup$
          – Jonathan Allan
          Mar 10 at 17:52










        • $begingroup$
          It wasn't an observation, it was a self-answer to his (now pretty old) challenge. ;-)
          $endgroup$
          – Erik the Outgolfer
          Mar 10 at 17:52







        • 3




          $begingroup$
          C-*+ sound like some future variation of C++.
          $endgroup$
          – val
          2 days ago















        6












        $begingroup$


        Jelly, score  288 250 212  199



        -38 thanks to Erik the Outgolfer!



        C-*+


        Swaps even with odd.



        The score is $67+45+44+43=199$ - see self-scoring here.



        Try it online!






        share|improve this answer











        $endgroup$












        • $begingroup$
          Apparently, Leaky Nun's -*ạ has a score of 300... however, -*_@ has a score of 250. Maybe I should post that as my own, although it's the same permutation.
          $endgroup$
          – Erik the Outgolfer
          Mar 10 at 17:42











        • $begingroup$
          Ah nice observation by Leaky Nun, so -*N+ scores 212
          $endgroup$
          – Jonathan Allan
          Mar 10 at 17:52










        • $begingroup$
          It wasn't an observation, it was a self-answer to his (now pretty old) challenge. ;-)
          $endgroup$
          – Erik the Outgolfer
          Mar 10 at 17:52







        • 3




          $begingroup$
          C-*+ sound like some future variation of C++.
          $endgroup$
          – val
          2 days ago













        6












        6








        6





        $begingroup$


        Jelly, score  288 250 212  199



        -38 thanks to Erik the Outgolfer!



        C-*+


        Swaps even with odd.



        The score is $67+45+44+43=199$ - see self-scoring here.



        Try it online!






        share|improve this answer











        $endgroup$




        Jelly, score  288 250 212  199



        -38 thanks to Erik the Outgolfer!



        C-*+


        Swaps even with odd.



        The score is $67+45+44+43=199$ - see self-scoring here.



        Try it online!







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 10 at 18:22

























        answered Mar 10 at 17:38









        Jonathan AllanJonathan Allan

        53k535172




        53k535172











        • $begingroup$
          Apparently, Leaky Nun's -*ạ has a score of 300... however, -*_@ has a score of 250. Maybe I should post that as my own, although it's the same permutation.
          $endgroup$
          – Erik the Outgolfer
          Mar 10 at 17:42











        • $begingroup$
          Ah nice observation by Leaky Nun, so -*N+ scores 212
          $endgroup$
          – Jonathan Allan
          Mar 10 at 17:52










        • $begingroup$
          It wasn't an observation, it was a self-answer to his (now pretty old) challenge. ;-)
          $endgroup$
          – Erik the Outgolfer
          Mar 10 at 17:52







        • 3




          $begingroup$
          C-*+ sound like some future variation of C++.
          $endgroup$
          – val
          2 days ago
















        • $begingroup$
          Apparently, Leaky Nun's -*ạ has a score of 300... however, -*_@ has a score of 250. Maybe I should post that as my own, although it's the same permutation.
          $endgroup$
          – Erik the Outgolfer
          Mar 10 at 17:42











        • $begingroup$
          Ah nice observation by Leaky Nun, so -*N+ scores 212
          $endgroup$
          – Jonathan Allan
          Mar 10 at 17:52










        • $begingroup$
          It wasn't an observation, it was a self-answer to his (now pretty old) challenge. ;-)
          $endgroup$
          – Erik the Outgolfer
          Mar 10 at 17:52







        • 3




          $begingroup$
          C-*+ sound like some future variation of C++.
          $endgroup$
          – val
          2 days ago















        $begingroup$
        Apparently, Leaky Nun's -*ạ has a score of 300... however, -*_@ has a score of 250. Maybe I should post that as my own, although it's the same permutation.
        $endgroup$
        – Erik the Outgolfer
        Mar 10 at 17:42





        $begingroup$
        Apparently, Leaky Nun's -*ạ has a score of 300... however, -*_@ has a score of 250. Maybe I should post that as my own, although it's the same permutation.
        $endgroup$
        – Erik the Outgolfer
        Mar 10 at 17:42













        $begingroup$
        Ah nice observation by Leaky Nun, so -*N+ scores 212
        $endgroup$
        – Jonathan Allan
        Mar 10 at 17:52




        $begingroup$
        Ah nice observation by Leaky Nun, so -*N+ scores 212
        $endgroup$
        – Jonathan Allan
        Mar 10 at 17:52












        $begingroup$
        It wasn't an observation, it was a self-answer to his (now pretty old) challenge. ;-)
        $endgroup$
        – Erik the Outgolfer
        Mar 10 at 17:52





        $begingroup$
        It wasn't an observation, it was a self-answer to his (now pretty old) challenge. ;-)
        $endgroup$
        – Erik the Outgolfer
        Mar 10 at 17:52





        3




        3




        $begingroup$
        C-*+ sound like some future variation of C++.
        $endgroup$
        – val
        2 days ago




        $begingroup$
        C-*+ sound like some future variation of C++.
        $endgroup$
        – val
        2 days ago











        5












        $begingroup$

        JavaScript (ES6), Score =  276  268





        $=>(--$^40)+!0


        Try it online!






        share|improve this answer











        $endgroup$












        • $begingroup$
          but 54^54 is 0
          $endgroup$
          – Jonathan Allan
          Mar 10 at 17:56










        • $begingroup$
          @JonathanAllan Thanks for notifying. I somehow missed that part. Should be correct now.
          $endgroup$
          – Arnauld
          Mar 10 at 18:04















        5












        $begingroup$

        JavaScript (ES6), Score =  276  268





        $=>(--$^40)+!0


        Try it online!






        share|improve this answer











        $endgroup$












        • $begingroup$
          but 54^54 is 0
          $endgroup$
          – Jonathan Allan
          Mar 10 at 17:56










        • $begingroup$
          @JonathanAllan Thanks for notifying. I somehow missed that part. Should be correct now.
          $endgroup$
          – Arnauld
          Mar 10 at 18:04













        5












        5








        5





        $begingroup$

        JavaScript (ES6), Score =  276  268





        $=>(--$^40)+!0


        Try it online!






        share|improve this answer











        $endgroup$



        JavaScript (ES6), Score =  276  268





        $=>(--$^40)+!0


        Try it online!







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 10 at 18:33

























        answered Mar 10 at 17:35









        ArnauldArnauld

        78.6k795327




        78.6k795327











        • $begingroup$
          but 54^54 is 0
          $endgroup$
          – Jonathan Allan
          Mar 10 at 17:56










        • $begingroup$
          @JonathanAllan Thanks for notifying. I somehow missed that part. Should be correct now.
          $endgroup$
          – Arnauld
          Mar 10 at 18:04
















        • $begingroup$
          but 54^54 is 0
          $endgroup$
          – Jonathan Allan
          Mar 10 at 17:56










        • $begingroup$
          @JonathanAllan Thanks for notifying. I somehow missed that part. Should be correct now.
          $endgroup$
          – Arnauld
          Mar 10 at 18:04















        $begingroup$
        but 54^54 is 0
        $endgroup$
        – Jonathan Allan
        Mar 10 at 17:56




        $begingroup$
        but 54^54 is 0
        $endgroup$
        – Jonathan Allan
        Mar 10 at 17:56












        $begingroup$
        @JonathanAllan Thanks for notifying. I somehow missed that part. Should be correct now.
        $endgroup$
        – Arnauld
        Mar 10 at 18:04




        $begingroup$
        @JonathanAllan Thanks for notifying. I somehow missed that part. Should be correct now.
        $endgroup$
        – Arnauld
        Mar 10 at 18:04











        3












        $begingroup$


        Perl 6, Score: 201





        *-!0+^40+!0


        Try it online!



        Port of Arnauld's answer. This benefits from xor (+^) having the same precedence as - and +, and the use of a Whatever lambda to reduce overall characters. Other than that, I couldn't find a way of representing it differently that got a better score.




        Perl 6, Score 804 702





        (++$∉ords(q[!$%()+-2?[]_doqrsx∉])??++$+22-$++%2-$++%2!!++$)xx$_()[-!$+$_]


        Try it online!



        The first quine-y type answer here, and I think it scores pretty well.



        This produces the sequence $23,22,25,24...$ from the question body with the range $1,2,3,4...21$ inserted at the indexes of the unique sorted codepoints of the code. For example, the 30th through 35th elements of the sequence are $50, 53, 52, 1, 55, 54$ since the 33rd codepoint is ! and that's the lowest codepoint in my code.






        share|improve this answer











        $endgroup$












        • $begingroup$
          O_o that's a massive improvement
          $endgroup$
          – ASCII-only
          2 days ago















        3












        $begingroup$


        Perl 6, Score: 201





        *-!0+^40+!0


        Try it online!



        Port of Arnauld's answer. This benefits from xor (+^) having the same precedence as - and +, and the use of a Whatever lambda to reduce overall characters. Other than that, I couldn't find a way of representing it differently that got a better score.




        Perl 6, Score 804 702





        (++$∉ords(q[!$%()+-2?[]_doqrsx∉])??++$+22-$++%2-$++%2!!++$)xx$_()[-!$+$_]


        Try it online!



        The first quine-y type answer here, and I think it scores pretty well.



        This produces the sequence $23,22,25,24...$ from the question body with the range $1,2,3,4...21$ inserted at the indexes of the unique sorted codepoints of the code. For example, the 30th through 35th elements of the sequence are $50, 53, 52, 1, 55, 54$ since the 33rd codepoint is ! and that's the lowest codepoint in my code.






        share|improve this answer











        $endgroup$












        • $begingroup$
          O_o that's a massive improvement
          $endgroup$
          – ASCII-only
          2 days ago













        3












        3








        3





        $begingroup$


        Perl 6, Score: 201





        *-!0+^40+!0


        Try it online!



        Port of Arnauld's answer. This benefits from xor (+^) having the same precedence as - and +, and the use of a Whatever lambda to reduce overall characters. Other than that, I couldn't find a way of representing it differently that got a better score.




        Perl 6, Score 804 702





        (++$∉ords(q[!$%()+-2?[]_doqrsx∉])??++$+22-$++%2-$++%2!!++$)xx$_()[-!$+$_]


        Try it online!



        The first quine-y type answer here, and I think it scores pretty well.



        This produces the sequence $23,22,25,24...$ from the question body with the range $1,2,3,4...21$ inserted at the indexes of the unique sorted codepoints of the code. For example, the 30th through 35th elements of the sequence are $50, 53, 52, 1, 55, 54$ since the 33rd codepoint is ! and that's the lowest codepoint in my code.






        share|improve this answer











        $endgroup$




        Perl 6, Score: 201





        *-!0+^40+!0


        Try it online!



        Port of Arnauld's answer. This benefits from xor (+^) having the same precedence as - and +, and the use of a Whatever lambda to reduce overall characters. Other than that, I couldn't find a way of representing it differently that got a better score.




        Perl 6, Score 804 702





        (++$∉ords(q[!$%()+-2?[]_doqrsx∉])??++$+22-$++%2-$++%2!!++$)xx$_()[-!$+$_]


        Try it online!



        The first quine-y type answer here, and I think it scores pretty well.



        This produces the sequence $23,22,25,24...$ from the question body with the range $1,2,3,4...21$ inserted at the indexes of the unique sorted codepoints of the code. For example, the 30th through 35th elements of the sequence are $50, 53, 52, 1, 55, 54$ since the 33rd codepoint is ! and that's the lowest codepoint in my code.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 2 days ago

























        answered Mar 10 at 23:25









        Jo KingJo King

        24.8k358128




        24.8k358128











        • $begingroup$
          O_o that's a massive improvement
          $endgroup$
          – ASCII-only
          2 days ago
















        • $begingroup$
          O_o that's a massive improvement
          $endgroup$
          – ASCII-only
          2 days ago















        $begingroup$
        O_o that's a massive improvement
        $endgroup$
        – ASCII-only
        2 days ago




        $begingroup$
        O_o that's a massive improvement
        $endgroup$
        – ASCII-only
        2 days ago











        2












        $begingroup$


        Retina 0.8.2, 6 bytes, score 260



        T`O`RO


        Try it online! Link includes self-scoring footer. Simply swaps digits 1 and 9 and 3 and 7 in the decimal representations, so that numbers that contain no digits coprime to 10 are unaffected.






        share|improve this answer









        $endgroup$

















          2












          $begingroup$


          Retina 0.8.2, 6 bytes, score 260



          T`O`RO


          Try it online! Link includes self-scoring footer. Simply swaps digits 1 and 9 and 3 and 7 in the decimal representations, so that numbers that contain no digits coprime to 10 are unaffected.






          share|improve this answer









          $endgroup$















            2












            2








            2





            $begingroup$


            Retina 0.8.2, 6 bytes, score 260



            T`O`RO


            Try it online! Link includes self-scoring footer. Simply swaps digits 1 and 9 and 3 and 7 in the decimal representations, so that numbers that contain no digits coprime to 10 are unaffected.






            share|improve this answer









            $endgroup$




            Retina 0.8.2, 6 bytes, score 260



            T`O`RO


            Try it online! Link includes self-scoring footer. Simply swaps digits 1 and 9 and 3 and 7 in the decimal representations, so that numbers that contain no digits coprime to 10 are unaffected.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 10 at 19:33









            NeilNeil

            81.6k745178




            81.6k745178





















                2












                $begingroup$


                C# (Visual C# Interactive Compiler), 22 bytes, Score 247 245





                A=>A>65?A-1+A%2*2:66-A


                Try it online!



                Simple, if less than 66, return 66 minus input, else use the formula in the question that swaps even and odd numbers.






                share|improve this answer











                $endgroup$












                • $begingroup$
                  What's wrong with the previous version A=>A<66?66-A:A?
                  $endgroup$
                  – Jo King
                  Mar 11 at 2:35






                • 1




                  $begingroup$
                  @JoKing Except for permutations which only permute a finite subset of $mathbbN$, meaning that the set $ pi(x) neq x $ must be infinite. The set isn't infinite, since the only values in the set are 1-65, since above 65, all values of A map to A
                  $endgroup$
                  – Embodiment of Ignorance
                  Mar 11 at 2:37










                • $begingroup$
                  Oh darn, I didn't notice that. That means my own answer is invalid too :(
                  $endgroup$
                  – Jo King
                  Mar 11 at 2:40
















                2












                $begingroup$


                C# (Visual C# Interactive Compiler), 22 bytes, Score 247 245





                A=>A>65?A-1+A%2*2:66-A


                Try it online!



                Simple, if less than 66, return 66 minus input, else use the formula in the question that swaps even and odd numbers.






                share|improve this answer











                $endgroup$












                • $begingroup$
                  What's wrong with the previous version A=>A<66?66-A:A?
                  $endgroup$
                  – Jo King
                  Mar 11 at 2:35






                • 1




                  $begingroup$
                  @JoKing Except for permutations which only permute a finite subset of $mathbbN$, meaning that the set $ pi(x) neq x $ must be infinite. The set isn't infinite, since the only values in the set are 1-65, since above 65, all values of A map to A
                  $endgroup$
                  – Embodiment of Ignorance
                  Mar 11 at 2:37










                • $begingroup$
                  Oh darn, I didn't notice that. That means my own answer is invalid too :(
                  $endgroup$
                  – Jo King
                  Mar 11 at 2:40














                2












                2








                2





                $begingroup$


                C# (Visual C# Interactive Compiler), 22 bytes, Score 247 245





                A=>A>65?A-1+A%2*2:66-A


                Try it online!



                Simple, if less than 66, return 66 minus input, else use the formula in the question that swaps even and odd numbers.






                share|improve this answer











                $endgroup$




                C# (Visual C# Interactive Compiler), 22 bytes, Score 247 245





                A=>A>65?A-1+A%2*2:66-A


                Try it online!



                Simple, if less than 66, return 66 minus input, else use the formula in the question that swaps even and odd numbers.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 11 at 4:08

























                answered Mar 11 at 2:03









                Embodiment of IgnoranceEmbodiment of Ignorance

                1,688124




                1,688124











                • $begingroup$
                  What's wrong with the previous version A=>A<66?66-A:A?
                  $endgroup$
                  – Jo King
                  Mar 11 at 2:35






                • 1




                  $begingroup$
                  @JoKing Except for permutations which only permute a finite subset of $mathbbN$, meaning that the set $ pi(x) neq x $ must be infinite. The set isn't infinite, since the only values in the set are 1-65, since above 65, all values of A map to A
                  $endgroup$
                  – Embodiment of Ignorance
                  Mar 11 at 2:37










                • $begingroup$
                  Oh darn, I didn't notice that. That means my own answer is invalid too :(
                  $endgroup$
                  – Jo King
                  Mar 11 at 2:40

















                • $begingroup$
                  What's wrong with the previous version A=>A<66?66-A:A?
                  $endgroup$
                  – Jo King
                  Mar 11 at 2:35






                • 1




                  $begingroup$
                  @JoKing Except for permutations which only permute a finite subset of $mathbbN$, meaning that the set $ pi(x) neq x $ must be infinite. The set isn't infinite, since the only values in the set are 1-65, since above 65, all values of A map to A
                  $endgroup$
                  – Embodiment of Ignorance
                  Mar 11 at 2:37










                • $begingroup$
                  Oh darn, I didn't notice that. That means my own answer is invalid too :(
                  $endgroup$
                  – Jo King
                  Mar 11 at 2:40
















                $begingroup$
                What's wrong with the previous version A=>A<66?66-A:A?
                $endgroup$
                – Jo King
                Mar 11 at 2:35




                $begingroup$
                What's wrong with the previous version A=>A<66?66-A:A?
                $endgroup$
                – Jo King
                Mar 11 at 2:35




                1




                1




                $begingroup$
                @JoKing Except for permutations which only permute a finite subset of $mathbbN$, meaning that the set $ pi(x) neq x $ must be infinite. The set isn't infinite, since the only values in the set are 1-65, since above 65, all values of A map to A
                $endgroup$
                – Embodiment of Ignorance
                Mar 11 at 2:37




                $begingroup$
                @JoKing Except for permutations which only permute a finite subset of $mathbbN$, meaning that the set $ pi(x) neq x $ must be infinite. The set isn't infinite, since the only values in the set are 1-65, since above 65, all values of A map to A
                $endgroup$
                – Embodiment of Ignorance
                Mar 11 at 2:37












                $begingroup$
                Oh darn, I didn't notice that. That means my own answer is invalid too :(
                $endgroup$
                – Jo King
                Mar 11 at 2:40





                $begingroup$
                Oh darn, I didn't notice that. That means my own answer is invalid too :(
                $endgroup$
                – Jo King
                Mar 11 at 2:40












                1












                $begingroup$


                Charcoal, 13 bytes, score 681



                ⁻⁺²³²ι⊗﹪⊖ι²³³


                Try it online! Link is to self-scoring version with header to map over an array of byte codes. (Charcoal has a custom code page so I've manually inserted the correct byte codes in the input.) Works by reversing ranges of 233 numbers, so that 117, 350, 583 ... are unchanged. Explanation:



                 ι Value
                ⁺ Plus
                ²³² Literal 232
                ⁻ Minus
                ι Value
                ⊖ Decremented
                ﹪ Modulo
                ²³³ Literal 233
                ⊗ Doubled





                share|improve this answer









                $endgroup$

















                  1












                  $begingroup$


                  Charcoal, 13 bytes, score 681



                  ⁻⁺²³²ι⊗﹪⊖ι²³³


                  Try it online! Link is to self-scoring version with header to map over an array of byte codes. (Charcoal has a custom code page so I've manually inserted the correct byte codes in the input.) Works by reversing ranges of 233 numbers, so that 117, 350, 583 ... are unchanged. Explanation:



                   ι Value
                  ⁺ Plus
                  ²³² Literal 232
                  ⁻ Minus
                  ι Value
                  ⊖ Decremented
                  ﹪ Modulo
                  ²³³ Literal 233
                  ⊗ Doubled





                  share|improve this answer









                  $endgroup$















                    1












                    1








                    1





                    $begingroup$


                    Charcoal, 13 bytes, score 681



                    ⁻⁺²³²ι⊗﹪⊖ι²³³


                    Try it online! Link is to self-scoring version with header to map over an array of byte codes. (Charcoal has a custom code page so I've manually inserted the correct byte codes in the input.) Works by reversing ranges of 233 numbers, so that 117, 350, 583 ... are unchanged. Explanation:



                     ι Value
                    ⁺ Plus
                    ²³² Literal 232
                    ⁻ Minus
                    ι Value
                    ⊖ Decremented
                    ﹪ Modulo
                    ²³³ Literal 233
                    ⊗ Doubled





                    share|improve this answer









                    $endgroup$




                    Charcoal, 13 bytes, score 681



                    ⁻⁺²³²ι⊗﹪⊖ι²³³


                    Try it online! Link is to self-scoring version with header to map over an array of byte codes. (Charcoal has a custom code page so I've manually inserted the correct byte codes in the input.) Works by reversing ranges of 233 numbers, so that 117, 350, 583 ... are unchanged. Explanation:



                     ι Value
                    ⁺ Plus
                    ²³² Literal 232
                    ⁻ Minus
                    ι Value
                    ⊖ Decremented
                    ﹪ Modulo
                    ²³³ Literal 233
                    ⊗ Doubled






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 10 at 19:27









                    NeilNeil

                    81.6k745178




                    81.6k745178





















                        1












                        $begingroup$

                        Haskell, score 985



                        (((.),(-))->(.)*200+mod(-39+(-))200+1).((*)->divMod((*)-1)200)


                        Try it online!






                        share|improve this answer











                        $endgroup$












                        • $begingroup$
                          I don't think this is a permutation, since adding a*200 has no effect modulo 200 so a doesn't matter.
                          $endgroup$
                          – xnor
                          Mar 10 at 22:34










                        • $begingroup$
                          @xnor Good catch. That's supposed to be outside of the mod. At some point while golfing, I must have messed up order of operations. Fixed now, thanks!
                          $endgroup$
                          – Joseph Sible
                          Mar 10 at 22:52











                        • $begingroup$
                          I think there's another issue that 40 maps to 0 but the challenge requires positive integers, which makes approaches like this tricky.
                          $endgroup$
                          – xnor
                          Mar 10 at 23:15






                        • 1




                          $begingroup$
                          Using sum[1|...] over if..then..else should help.
                          $endgroup$
                          – ბიმო
                          Mar 11 at 0:09






                        • 1




                          $begingroup$
                          Let us continue this discussion in chat.
                          $endgroup$
                          – ASCII-only
                          Mar 11 at 1:18















                        1












                        $begingroup$

                        Haskell, score 985



                        (((.),(-))->(.)*200+mod(-39+(-))200+1).((*)->divMod((*)-1)200)


                        Try it online!






                        share|improve this answer











                        $endgroup$












                        • $begingroup$
                          I don't think this is a permutation, since adding a*200 has no effect modulo 200 so a doesn't matter.
                          $endgroup$
                          – xnor
                          Mar 10 at 22:34










                        • $begingroup$
                          @xnor Good catch. That's supposed to be outside of the mod. At some point while golfing, I must have messed up order of operations. Fixed now, thanks!
                          $endgroup$
                          – Joseph Sible
                          Mar 10 at 22:52











                        • $begingroup$
                          I think there's another issue that 40 maps to 0 but the challenge requires positive integers, which makes approaches like this tricky.
                          $endgroup$
                          – xnor
                          Mar 10 at 23:15






                        • 1




                          $begingroup$
                          Using sum[1|...] over if..then..else should help.
                          $endgroup$
                          – ბიმო
                          Mar 11 at 0:09






                        • 1




                          $begingroup$
                          Let us continue this discussion in chat.
                          $endgroup$
                          – ASCII-only
                          Mar 11 at 1:18













                        1












                        1








                        1





                        $begingroup$

                        Haskell, score 985



                        (((.),(-))->(.)*200+mod(-39+(-))200+1).((*)->divMod((*)-1)200)


                        Try it online!






                        share|improve this answer











                        $endgroup$



                        Haskell, score 985



                        (((.),(-))->(.)*200+mod(-39+(-))200+1).((*)->divMod((*)-1)200)


                        Try it online!







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Mar 11 at 1:21

























                        answered Mar 10 at 21:28









                        Joseph SibleJoseph Sible

                        2376




                        2376











                        • $begingroup$
                          I don't think this is a permutation, since adding a*200 has no effect modulo 200 so a doesn't matter.
                          $endgroup$
                          – xnor
                          Mar 10 at 22:34










                        • $begingroup$
                          @xnor Good catch. That's supposed to be outside of the mod. At some point while golfing, I must have messed up order of operations. Fixed now, thanks!
                          $endgroup$
                          – Joseph Sible
                          Mar 10 at 22:52











                        • $begingroup$
                          I think there's another issue that 40 maps to 0 but the challenge requires positive integers, which makes approaches like this tricky.
                          $endgroup$
                          – xnor
                          Mar 10 at 23:15






                        • 1




                          $begingroup$
                          Using sum[1|...] over if..then..else should help.
                          $endgroup$
                          – ბიმო
                          Mar 11 at 0:09






                        • 1




                          $begingroup$
                          Let us continue this discussion in chat.
                          $endgroup$
                          – ASCII-only
                          Mar 11 at 1:18
















                        • $begingroup$
                          I don't think this is a permutation, since adding a*200 has no effect modulo 200 so a doesn't matter.
                          $endgroup$
                          – xnor
                          Mar 10 at 22:34










                        • $begingroup$
                          @xnor Good catch. That's supposed to be outside of the mod. At some point while golfing, I must have messed up order of operations. Fixed now, thanks!
                          $endgroup$
                          – Joseph Sible
                          Mar 10 at 22:52











                        • $begingroup$
                          I think there's another issue that 40 maps to 0 but the challenge requires positive integers, which makes approaches like this tricky.
                          $endgroup$
                          – xnor
                          Mar 10 at 23:15






                        • 1




                          $begingroup$
                          Using sum[1|...] over if..then..else should help.
                          $endgroup$
                          – ბიმო
                          Mar 11 at 0:09






                        • 1




                          $begingroup$
                          Let us continue this discussion in chat.
                          $endgroup$
                          – ASCII-only
                          Mar 11 at 1:18















                        $begingroup$
                        I don't think this is a permutation, since adding a*200 has no effect modulo 200 so a doesn't matter.
                        $endgroup$
                        – xnor
                        Mar 10 at 22:34




                        $begingroup$
                        I don't think this is a permutation, since adding a*200 has no effect modulo 200 so a doesn't matter.
                        $endgroup$
                        – xnor
                        Mar 10 at 22:34












                        $begingroup$
                        @xnor Good catch. That's supposed to be outside of the mod. At some point while golfing, I must have messed up order of operations. Fixed now, thanks!
                        $endgroup$
                        – Joseph Sible
                        Mar 10 at 22:52





                        $begingroup$
                        @xnor Good catch. That's supposed to be outside of the mod. At some point while golfing, I must have messed up order of operations. Fixed now, thanks!
                        $endgroup$
                        – Joseph Sible
                        Mar 10 at 22:52













                        $begingroup$
                        I think there's another issue that 40 maps to 0 but the challenge requires positive integers, which makes approaches like this tricky.
                        $endgroup$
                        – xnor
                        Mar 10 at 23:15




                        $begingroup$
                        I think there's another issue that 40 maps to 0 but the challenge requires positive integers, which makes approaches like this tricky.
                        $endgroup$
                        – xnor
                        Mar 10 at 23:15




                        1




                        1




                        $begingroup$
                        Using sum[1|...] over if..then..else should help.
                        $endgroup$
                        – ბიმო
                        Mar 11 at 0:09




                        $begingroup$
                        Using sum[1|...] over if..then..else should help.
                        $endgroup$
                        – ბიმო
                        Mar 11 at 0:09




                        1




                        1




                        $begingroup$
                        Let us continue this discussion in chat.
                        $endgroup$
                        – ASCII-only
                        Mar 11 at 1:18




                        $begingroup$
                        Let us continue this discussion in chat.
                        $endgroup$
                        – ASCII-only
                        Mar 11 at 1:18











                        1












                        $begingroup$


                        05AB1E, score: 488 in 05AB1E's code page



                        È·<-


                        Swaps odd and even like the example function.



                        Will try to improve the score from here.



                        Try it online with input in the range [1, 100] or Try it online with the codepoints.



                        Explanation:





                        È # Check if the (implicit) input is even (1 if truhy; 0 if falsey)
                        · # Double (2 if truthy; 0 if falsey)
                        < # Decrease by 1 (1 if truthy; -1 if falsey)
                        - # Subtract it from the (implicit) input (and output implicitly)





                        share|improve this answer









                        $endgroup$

















                          1












                          $begingroup$


                          05AB1E, score: 488 in 05AB1E's code page



                          È·<-


                          Swaps odd and even like the example function.



                          Will try to improve the score from here.



                          Try it online with input in the range [1, 100] or Try it online with the codepoints.



                          Explanation:





                          È # Check if the (implicit) input is even (1 if truhy; 0 if falsey)
                          · # Double (2 if truthy; 0 if falsey)
                          < # Decrease by 1 (1 if truthy; -1 if falsey)
                          - # Subtract it from the (implicit) input (and output implicitly)





                          share|improve this answer









                          $endgroup$















                            1












                            1








                            1





                            $begingroup$


                            05AB1E, score: 488 in 05AB1E's code page



                            È·<-


                            Swaps odd and even like the example function.



                            Will try to improve the score from here.



                            Try it online with input in the range [1, 100] or Try it online with the codepoints.



                            Explanation:





                            È # Check if the (implicit) input is even (1 if truhy; 0 if falsey)
                            · # Double (2 if truthy; 0 if falsey)
                            < # Decrease by 1 (1 if truthy; -1 if falsey)
                            - # Subtract it from the (implicit) input (and output implicitly)





                            share|improve this answer









                            $endgroup$




                            05AB1E, score: 488 in 05AB1E's code page



                            È·<-


                            Swaps odd and even like the example function.



                            Will try to improve the score from here.



                            Try it online with input in the range [1, 100] or Try it online with the codepoints.



                            Explanation:





                            È # Check if the (implicit) input is even (1 if truhy; 0 if falsey)
                            · # Double (2 if truthy; 0 if falsey)
                            < # Decrease by 1 (1 if truthy; -1 if falsey)
                            - # Subtract it from the (implicit) input (and output implicitly)






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered 2 days ago









                            Kevin CruijssenKevin Cruijssen

                            40.4k565210




                            40.4k565210



























                                draft saved

                                draft discarded
















































                                If this is an answer to a challenge…



                                • …Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.


                                • …Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
                                  Explanations of your answer make it more interesting to read and are very much encouraged.


                                • …Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.


                                More generally…



                                • …Please make sure to answer the question and provide sufficient detail.


                                • …Avoid asking for help, clarification or responding to other answers (use comments instead).




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f181262%2fsource-permutation%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

                                How should I support this large drywall patch? Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How do I cover large gaps in drywall?How do I keep drywall around a patch from crumbling?Can I glue a second layer of drywall?How to patch long strip on drywall?Large drywall patch: how to avoid bulging seams?Drywall Mesh Patch vs. Bulge? To remove or not to remove?How to fix this drywall job?Prep drywall before backsplashWhat's the best way to fix this horrible drywall patch job?Drywall patching using 3M Patch Plus Primer

                                random experiment with two different functions on unit interval Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Random variable and probability space notionsRandom Walk with EdgesFinding functions where the increase over a random interval is Poisson distributedNumber of days until dayCan an observed event in fact be of zero probability?Unit random processmodels of coins and uniform distributionHow to get the number of successes given $n$ trials , probability $P$ and a random variable $X$Absorbing Markov chain in a computer. Is “almost every” turned into always convergence in computer executions?Stopped random walk is not uniformly integrable

                                Lowndes Grove History Architecture References Navigation menu32°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661132°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661178002500"National Register Information System"Historic houses of South Carolina"Lowndes Grove""+32° 48' 6.00", −79° 57' 58.00""Lowndes Grove, Charleston County (260 St. Margaret St., Charleston)""Lowndes Grove"The Charleston ExpositionIt Happened in South Carolina"Lowndes Grove (House), Saint Margaret Street & Sixth Avenue, Charleston, Charleston County, SC(Photographs)"Plantations of the Carolina Low Countrye