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

Ballot RPC message

Expressing logarithmic equations without logs

Should I take out a loan for a friend to invest on my behalf?

What do *foreign films* mean for an American?

How do we create new idioms and use them in a novel?

Source permutation

Doubts in understanding some concepts of potential energy

I am where you are now, too

Gaining more land

Trouble making an executable as a service

What is this diamond of every day?

Are small insurances worth it?

Recommendation letter by significant other if you worked with them professionally?

What is the population of Romulus in the TNG era?

What was the motivation for developing the plugin API?

Proving a statement about real numbers

Plausibility of Mushroom Buildings

Virginia employer terminated employee and wants signing bonus returned

Giving a career talk in my old university, how prominently should I tell students my salary?

Is it possible to avoid unpacking when merging Association?

Has a sovereign Communist government ever run, and conceded loss, on a fair election?

Getting the || sign while using Kurier

Why is a very small peak with larger m/z not considered to be the molecular ion?

Is it possible that a question has only two answers?



Source permutation


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













4












$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 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 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 $ 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$
    @JonathanAllan: "The permutation must permute an infinite subset of $mathbbN$".
    $endgroup$
    – ბიმო
    4 hours ago










  • $begingroup$
    @JonathanAllan: I see, added a clarification :)
    $endgroup$
    – ბიმო
    4 hours ago










  • $begingroup$
    s1..sn (from who build every permutations) are in input? I would remember that a permutation is just one function 1..n->s1...sn injective and on all the set of arrive
    $endgroup$
    – RosLuP
    4 hours ago











  • $begingroup$
    @JonathanAllan: That's what I meant, yes. I try to clarify.
    $endgroup$
    – ბიმო
    2 hours ago










  • $begingroup$
    @EriktheOutgolfer: Yes feel free to edit, I think I made things worse.
    $endgroup$
    – ბიმო
    1 hour ago















4












$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 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 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 $ 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$
    @JonathanAllan: "The permutation must permute an infinite subset of $mathbbN$".
    $endgroup$
    – ბიმო
    4 hours ago










  • $begingroup$
    @JonathanAllan: I see, added a clarification :)
    $endgroup$
    – ბიმო
    4 hours ago










  • $begingroup$
    s1..sn (from who build every permutations) are in input? I would remember that a permutation is just one function 1..n->s1...sn injective and on all the set of arrive
    $endgroup$
    – RosLuP
    4 hours ago











  • $begingroup$
    @JonathanAllan: That's what I meant, yes. I try to clarify.
    $endgroup$
    – ბიმო
    2 hours ago










  • $begingroup$
    @EriktheOutgolfer: Yes feel free to edit, I think I made things worse.
    $endgroup$
    – ბიმო
    1 hour ago













4












4








4





$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 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 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 $ 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 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 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 $ 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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago









Erik the Outgolfer

32.2k429104




32.2k429104










asked 4 hours ago









ბიმობიმო

11.9k22392




11.9k22392











  • $begingroup$
    @JonathanAllan: "The permutation must permute an infinite subset of $mathbbN$".
    $endgroup$
    – ბიმო
    4 hours ago










  • $begingroup$
    @JonathanAllan: I see, added a clarification :)
    $endgroup$
    – ბიმო
    4 hours ago










  • $begingroup$
    s1..sn (from who build every permutations) are in input? I would remember that a permutation is just one function 1..n->s1...sn injective and on all the set of arrive
    $endgroup$
    – RosLuP
    4 hours ago











  • $begingroup$
    @JonathanAllan: That's what I meant, yes. I try to clarify.
    $endgroup$
    – ბიმო
    2 hours ago










  • $begingroup$
    @EriktheOutgolfer: Yes feel free to edit, I think I made things worse.
    $endgroup$
    – ბიმო
    1 hour ago
















  • $begingroup$
    @JonathanAllan: "The permutation must permute an infinite subset of $mathbbN$".
    $endgroup$
    – ბიმო
    4 hours ago










  • $begingroup$
    @JonathanAllan: I see, added a clarification :)
    $endgroup$
    – ბიმო
    4 hours ago










  • $begingroup$
    s1..sn (from who build every permutations) are in input? I would remember that a permutation is just one function 1..n->s1...sn injective and on all the set of arrive
    $endgroup$
    – RosLuP
    4 hours ago











  • $begingroup$
    @JonathanAllan: That's what I meant, yes. I try to clarify.
    $endgroup$
    – ბიმო
    2 hours ago










  • $begingroup$
    @EriktheOutgolfer: Yes feel free to edit, I think I made things worse.
    $endgroup$
    – ბიმო
    1 hour ago















$begingroup$
@JonathanAllan: "The permutation must permute an infinite subset of $mathbbN$".
$endgroup$
– ბიმო
4 hours ago




$begingroup$
@JonathanAllan: "The permutation must permute an infinite subset of $mathbbN$".
$endgroup$
– ბიმო
4 hours ago












$begingroup$
@JonathanAllan: I see, added a clarification :)
$endgroup$
– ბიმო
4 hours ago




$begingroup$
@JonathanAllan: I see, added a clarification :)
$endgroup$
– ბიმო
4 hours ago












$begingroup$
s1..sn (from who build every permutations) are in input? I would remember that a permutation is just one function 1..n->s1...sn injective and on all the set of arrive
$endgroup$
– RosLuP
4 hours ago





$begingroup$
s1..sn (from who build every permutations) are in input? I would remember that a permutation is just one function 1..n->s1...sn injective and on all the set of arrive
$endgroup$
– RosLuP
4 hours ago













$begingroup$
@JonathanAllan: That's what I meant, yes. I try to clarify.
$endgroup$
– ბიმო
2 hours ago




$begingroup$
@JonathanAllan: That's what I meant, yes. I try to clarify.
$endgroup$
– ბიმო
2 hours ago












$begingroup$
@EriktheOutgolfer: Yes feel free to edit, I think I made things worse.
$endgroup$
– ბიმო
1 hour ago




$begingroup$
@EriktheOutgolfer: Yes feel free to edit, I think I made things worse.
$endgroup$
– ბიმო
1 hour ago










5 Answers
5






active

oldest

votes


















2












$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
    3 hours ago











  • $begingroup$
    Ah nice observation by Leaky Nun, so -*N+ scores 212
    $endgroup$
    – Jonathan Allan
    3 hours ago










  • $begingroup$
    It wasn't an observation, it was a self-answer to his (now pretty old) challenge. ;-)
    $endgroup$
    – Erik the Outgolfer
    3 hours ago



















2












$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
    3 hours ago










  • $begingroup$
    @JonathanAllan Thanks for notifying. I somehow missed that part. Should be correct now.
    $endgroup$
    – Arnauld
    3 hours 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$




















    0












    $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$




















      0












      $begingroup$

      Haskell, 34 bytes, score 2610



      f(x:y:l)=y:x:f l
      f x=x
      g x=f[1..x]


      Try it online!





      share









      $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

























        5 Answers
        5






        active

        oldest

        votes








        5 Answers
        5






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        2












        $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
          3 hours ago











        • $begingroup$
          Ah nice observation by Leaky Nun, so -*N+ scores 212
          $endgroup$
          – Jonathan Allan
          3 hours ago










        • $begingroup$
          It wasn't an observation, it was a self-answer to his (now pretty old) challenge. ;-)
          $endgroup$
          – Erik the Outgolfer
          3 hours ago
















        2












        $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
          3 hours ago











        • $begingroup$
          Ah nice observation by Leaky Nun, so -*N+ scores 212
          $endgroup$
          – Jonathan Allan
          3 hours ago










        • $begingroup$
          It wasn't an observation, it was a self-answer to his (now pretty old) challenge. ;-)
          $endgroup$
          – Erik the Outgolfer
          3 hours ago














        2












        2








        2





        $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 3 hours ago

























        answered 3 hours ago









        Jonathan AllanJonathan Allan

        52.6k535170




        52.6k535170











        • $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
          3 hours ago











        • $begingroup$
          Ah nice observation by Leaky Nun, so -*N+ scores 212
          $endgroup$
          – Jonathan Allan
          3 hours ago










        • $begingroup$
          It wasn't an observation, it was a self-answer to his (now pretty old) challenge. ;-)
          $endgroup$
          – Erik the Outgolfer
          3 hours 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
          3 hours ago











        • $begingroup$
          Ah nice observation by Leaky Nun, so -*N+ scores 212
          $endgroup$
          – Jonathan Allan
          3 hours ago










        • $begingroup$
          It wasn't an observation, it was a self-answer to his (now pretty old) challenge. ;-)
          $endgroup$
          – Erik the Outgolfer
          3 hours 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
        3 hours 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
        3 hours ago













        $begingroup$
        Ah nice observation by Leaky Nun, so -*N+ scores 212
        $endgroup$
        – Jonathan Allan
        3 hours ago




        $begingroup$
        Ah nice observation by Leaky Nun, so -*N+ scores 212
        $endgroup$
        – Jonathan Allan
        3 hours ago












        $begingroup$
        It wasn't an observation, it was a self-answer to his (now pretty old) challenge. ;-)
        $endgroup$
        – Erik the Outgolfer
        3 hours ago





        $begingroup$
        It wasn't an observation, it was a self-answer to his (now pretty old) challenge. ;-)
        $endgroup$
        – Erik the Outgolfer
        3 hours ago












        2












        $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
          3 hours ago










        • $begingroup$
          @JonathanAllan Thanks for notifying. I somehow missed that part. Should be correct now.
          $endgroup$
          – Arnauld
          3 hours ago















        2












        $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
          3 hours ago










        • $begingroup$
          @JonathanAllan Thanks for notifying. I somehow missed that part. Should be correct now.
          $endgroup$
          – Arnauld
          3 hours ago













        2












        2








        2





        $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 2 hours ago

























        answered 3 hours ago









        ArnauldArnauld

        78.2k795326




        78.2k795326











        • $begingroup$
          but 54^54 is 0
          $endgroup$
          – Jonathan Allan
          3 hours ago










        • $begingroup$
          @JonathanAllan Thanks for notifying. I somehow missed that part. Should be correct now.
          $endgroup$
          – Arnauld
          3 hours ago
















        • $begingroup$
          but 54^54 is 0
          $endgroup$
          – Jonathan Allan
          3 hours ago










        • $begingroup$
          @JonathanAllan Thanks for notifying. I somehow missed that part. Should be correct now.
          $endgroup$
          – Arnauld
          3 hours ago















        $begingroup$
        but 54^54 is 0
        $endgroup$
        – Jonathan Allan
        3 hours ago




        $begingroup$
        but 54^54 is 0
        $endgroup$
        – Jonathan Allan
        3 hours ago












        $begingroup$
        @JonathanAllan Thanks for notifying. I somehow missed that part. Should be correct now.
        $endgroup$
        – Arnauld
        3 hours ago




        $begingroup$
        @JonathanAllan Thanks for notifying. I somehow missed that part. Should be correct now.
        $endgroup$
        – Arnauld
        3 hours 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 1 hour ago









            NeilNeil

            81.5k745178




            81.5k745178





















                0












                $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$

















                  0












                  $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$















                    0












                    0








                    0





                    $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 2 hours ago









                    NeilNeil

                    81.5k745178




                    81.5k745178





















                        0












                        $begingroup$

                        Haskell, 34 bytes, score 2610



                        f(x:y:l)=y:x:f l
                        f x=x
                        g x=f[1..x]


                        Try it online!





                        share









                        $endgroup$

















                          0












                          $begingroup$

                          Haskell, 34 bytes, score 2610



                          f(x:y:l)=y:x:f l
                          f x=x
                          g x=f[1..x]


                          Try it online!





                          share









                          $endgroup$















                            0












                            0








                            0





                            $begingroup$

                            Haskell, 34 bytes, score 2610



                            f(x:y:l)=y:x:f l
                            f x=x
                            g x=f[1..x]


                            Try it online!





                            share









                            $endgroup$



                            Haskell, 34 bytes, score 2610



                            f(x:y:l)=y:x:f l
                            f x=x
                            g x=f[1..x]


                            Try it online!






                            share











                            share


                            share










                            answered 1 min ago









                            Joseph SibleJoseph Sible

                            2175




                            2175



























                                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







                                -code-challenge, code-golf, integer, permutations, sequence

                                Popular posts from this blog

                                Creating 100m^2 grid automatically using QGIS?Creating grid constrained within polygon in QGIS?Createing polygon layer from point data using QGIS?Creating vector grid using QGIS?Creating grid polygons from coordinates using R or PythonCreating grid from spatio temporal point data?Creating fields in attributes table using other layers using QGISCreate .shp vector grid in QGISQGIS Creating 4km point grid within polygonsCreate a vector grid over a raster layerVector Grid Creates just one grid

                                Why is this plane circling around the Lucknow airport every day?Why do aircraft on Flight Radar 24 jump around randomly sometimes?What airport has this walkway over a taxiway?How does Chicago O'Hare's tower sequence aircraft at peak capacity?Which airport is featured in this Delta commercial?After a crash, for how long is the airport closed?Can a passenger plane stand still in the air, or hover at a fixed location above a ground?What are those trucks towing around, and why?What is this airport outside of Cairo, Egypt?Which US airport has the lowest circling MDH?What is this airport video?

                                What is this called? Old film camera viewer?What makes a good film camera?What to do with an old film camera?What should one look for when buying a used film camera?What is the value and age of this pre-1967 Ricoh 35 mm camera?DSLR recommendation, question about old Canon 35mm film Camera & lensesCan anyone identify the silver rangefinder-style camera in this advertisement?What kind of a Polaroid 600-camera is this?Will an old film camera still work even when not used in a very long time?What is this camera / Can I develop the film?How to fit an action camera into antique (bellows) housing?What to check when buying used and old film bodies?