Given an input, print all exponents where all the bases and powers all up to the input











up vote
5
down vote

favorite












So this is my first challenge on this site.



What this challenge is is that you input a number, and your code spits out numbers which can be calculated as an exponent. The sum of the exponent and base in the number must equal the input.
The numbers must start from $1^{n-1}$ to $(n)^0$.



Example



Given input 5, the program will print:



1  
8
9
4
1


$1^4$ is 1 and $1+4=5$
$2^3$ is 8 and $2+3=5$ and so on



Input and Output



Input will be in the form of an integer.
Output will be a list of numbers, delimited by either commas or new lines.



This is code-golf, so shortest code wins.










share|improve this question









New contributor




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
















  • 2




    the comma/newline detail should be omitted, it is normal practice around here to let output of lists be in any convenient format, including as a list/array object being returned by a function
    – Sparr
    1 hour ago






  • 3




    Is the input always greater than 0 or do we have to deal with 0 and negatives?
    – Veskah
    1 hour ago










  • Inputs will always be positive
    – Embodiment of Ignorance
    45 mins ago










  • What do I do if there are two answers with the same length, and they both are the shortest?
    – Embodiment of Ignorance
    36 mins ago










  • Two equally short answers doesn't matter. If you feel like accepting an answer, choose the earliest posted one. However I strongly recommend waiting at least a few days, and would suggest never accepting an answer (to encourage more submissions).
    – Οurous
    24 mins ago

















up vote
5
down vote

favorite












So this is my first challenge on this site.



What this challenge is is that you input a number, and your code spits out numbers which can be calculated as an exponent. The sum of the exponent and base in the number must equal the input.
The numbers must start from $1^{n-1}$ to $(n)^0$.



Example



Given input 5, the program will print:



1  
8
9
4
1


$1^4$ is 1 and $1+4=5$
$2^3$ is 8 and $2+3=5$ and so on



Input and Output



Input will be in the form of an integer.
Output will be a list of numbers, delimited by either commas or new lines.



This is code-golf, so shortest code wins.










share|improve this question









New contributor




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
















  • 2




    the comma/newline detail should be omitted, it is normal practice around here to let output of lists be in any convenient format, including as a list/array object being returned by a function
    – Sparr
    1 hour ago






  • 3




    Is the input always greater than 0 or do we have to deal with 0 and negatives?
    – Veskah
    1 hour ago










  • Inputs will always be positive
    – Embodiment of Ignorance
    45 mins ago










  • What do I do if there are two answers with the same length, and they both are the shortest?
    – Embodiment of Ignorance
    36 mins ago










  • Two equally short answers doesn't matter. If you feel like accepting an answer, choose the earliest posted one. However I strongly recommend waiting at least a few days, and would suggest never accepting an answer (to encourage more submissions).
    – Οurous
    24 mins ago















up vote
5
down vote

favorite









up vote
5
down vote

favorite











So this is my first challenge on this site.



What this challenge is is that you input a number, and your code spits out numbers which can be calculated as an exponent. The sum of the exponent and base in the number must equal the input.
The numbers must start from $1^{n-1}$ to $(n)^0$.



Example



Given input 5, the program will print:



1  
8
9
4
1


$1^4$ is 1 and $1+4=5$
$2^3$ is 8 and $2+3=5$ and so on



Input and Output



Input will be in the form of an integer.
Output will be a list of numbers, delimited by either commas or new lines.



This is code-golf, so shortest code wins.










share|improve this question









New contributor




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











So this is my first challenge on this site.



What this challenge is is that you input a number, and your code spits out numbers which can be calculated as an exponent. The sum of the exponent and base in the number must equal the input.
The numbers must start from $1^{n-1}$ to $(n)^0$.



Example



Given input 5, the program will print:



1  
8
9
4
1


$1^4$ is 1 and $1+4=5$
$2^3$ is 8 and $2+3=5$ and so on



Input and Output



Input will be in the form of an integer.
Output will be a list of numbers, delimited by either commas or new lines.



This is code-golf, so shortest code wins.







code-golf math arithmetic






share|improve this question









New contributor




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











share|improve this question









New contributor




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









share|improve this question




share|improve this question








edited 45 mins ago









user202729

13.6k12550




13.6k12550






New contributor




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









asked 1 hour ago









Embodiment of Ignorance

824




824




New contributor




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





New contributor





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






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








  • 2




    the comma/newline detail should be omitted, it is normal practice around here to let output of lists be in any convenient format, including as a list/array object being returned by a function
    – Sparr
    1 hour ago






  • 3




    Is the input always greater than 0 or do we have to deal with 0 and negatives?
    – Veskah
    1 hour ago










  • Inputs will always be positive
    – Embodiment of Ignorance
    45 mins ago










  • What do I do if there are two answers with the same length, and they both are the shortest?
    – Embodiment of Ignorance
    36 mins ago










  • Two equally short answers doesn't matter. If you feel like accepting an answer, choose the earliest posted one. However I strongly recommend waiting at least a few days, and would suggest never accepting an answer (to encourage more submissions).
    – Οurous
    24 mins ago
















  • 2




    the comma/newline detail should be omitted, it is normal practice around here to let output of lists be in any convenient format, including as a list/array object being returned by a function
    – Sparr
    1 hour ago






  • 3




    Is the input always greater than 0 or do we have to deal with 0 and negatives?
    – Veskah
    1 hour ago










  • Inputs will always be positive
    – Embodiment of Ignorance
    45 mins ago










  • What do I do if there are two answers with the same length, and they both are the shortest?
    – Embodiment of Ignorance
    36 mins ago










  • Two equally short answers doesn't matter. If you feel like accepting an answer, choose the earliest posted one. However I strongly recommend waiting at least a few days, and would suggest never accepting an answer (to encourage more submissions).
    – Οurous
    24 mins ago










2




2




the comma/newline detail should be omitted, it is normal practice around here to let output of lists be in any convenient format, including as a list/array object being returned by a function
– Sparr
1 hour ago




the comma/newline detail should be omitted, it is normal practice around here to let output of lists be in any convenient format, including as a list/array object being returned by a function
– Sparr
1 hour ago




3




3




Is the input always greater than 0 or do we have to deal with 0 and negatives?
– Veskah
1 hour ago




Is the input always greater than 0 or do we have to deal with 0 and negatives?
– Veskah
1 hour ago












Inputs will always be positive
– Embodiment of Ignorance
45 mins ago




Inputs will always be positive
– Embodiment of Ignorance
45 mins ago












What do I do if there are two answers with the same length, and they both are the shortest?
– Embodiment of Ignorance
36 mins ago




What do I do if there are two answers with the same length, and they both are the shortest?
– Embodiment of Ignorance
36 mins ago












Two equally short answers doesn't matter. If you feel like accepting an answer, choose the earliest posted one. However I strongly recommend waiting at least a few days, and would suggest never accepting an answer (to encourage more submissions).
– Οurous
24 mins ago






Two equally short answers doesn't matter. If you feel like accepting an answer, choose the earliest posted one. However I strongly recommend waiting at least a few days, and would suggest never accepting an answer (to encourage more submissions).
– Οurous
24 mins ago












10 Answers
10






active

oldest

votes

















up vote
1
down vote














Clean, 37 bytes



import StdEnv
$n=[i^(n-i)\i<-[1..n]]


Try it online!



Defines $ :: Int -> [Int] taking an integer and returning the list of results.



$ n                // function $ of n
= [i ^ (n-i) // i to the power of n minus i
\ i <- [1..n] // for each i in 1 to n
]





share|improve this answer






























    up vote
    1
    down vote














    Wolfram Language (Mathematica), 24 20 18 bytes



    (x=Range@#)^(#-x)&


    Try it online!



    -4 thanks @lirtosiast.






    share|improve this answer






























      up vote
      1
      down vote














      Pyth, 5 bytes



      _m^-Q


      Try it online!



      Optimally encoded this would be 4.106 bytes.



      _                reverse of the following list:
      m map the following lambda d:
      ^ (N-d)**d
      -Qd
      d
      Q over [0,...,N-1]





      share|improve this answer






























        up vote
        1
        down vote














        MathGolf, 6 bytes



        rx╒m#


        Try it online!






        share|improve this answer




























          up vote
          1
          down vote













          Haskell, 23 bytes



          f i=[x^(i-x)|x<-[1..i]]


          Try it online!



          Alternative version, also 23 bytes:



          f i=(^)<*>(i-)<$>[1..i]





          share|improve this answer




























            up vote
            0
            down vote














            JavaScript (Node.js), 36 bytes





            f=(n,i=1)=>n--?[i++**n,...f(n,i)]:


            Try it online!




            JavaScript (Node.js), 37 bytes





            n=>[...Array(n)].map(x=>++i**--n,i=0)


            Try it online!






            share|improve this answer




























              up vote
              0
              down vote














              Jelly, 5 bytes



              R*ḶU$


              Try it online!



              R                [1,...,n]
              * to the power of
              ḶU$ [0,...,n-1] reversed





              share|improve this answer






























                up vote
                0
                down vote














                Perl 6, 19 bytes





                {^$_+1 Z**[R,] ^$_}


                Try it online!



                Anonymous code block that takes a number and returns a list. Zip multiplies the range 1 to input and the range input-1 to 0






                share|improve this answer




























                  up vote
                  0
                  down vote














                  R, 34 bytes





                  x=1:scan();cat(x^rev(x-1),sep=',')


                  Try it online!






                  share|improve this answer




























                    up vote
                    0
                    down vote














                    Octave, 21 bytes





                    @(n)(1:n).^(n-1:-1:0)


                    Try it online!






                    share|improve this answer





















                      Your Answer





                      StackExchange.ifUsing("editor", function () {
                      return StackExchange.using("mathjaxEditing", function () {
                      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
                      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
                      });
                      });
                      }, "mathjax-editing");

                      StackExchange.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',
                      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
                      });


                      }
                      });






                      Embodiment of Ignorance is a new contributor. Be nice, and check out our Code of Conduct.










                       

                      draft saved


                      draft discarded


















                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f176666%2fgiven-an-input-print-all-exponents-where-all-the-bases-and-powers-all-up-to-the%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown

























                      10 Answers
                      10






                      active

                      oldest

                      votes








                      10 Answers
                      10






                      active

                      oldest

                      votes









                      active

                      oldest

                      votes






                      active

                      oldest

                      votes








                      up vote
                      1
                      down vote














                      Clean, 37 bytes



                      import StdEnv
                      $n=[i^(n-i)\i<-[1..n]]


                      Try it online!



                      Defines $ :: Int -> [Int] taking an integer and returning the list of results.



                      $ n                // function $ of n
                      = [i ^ (n-i) // i to the power of n minus i
                      \ i <- [1..n] // for each i in 1 to n
                      ]





                      share|improve this answer



























                        up vote
                        1
                        down vote














                        Clean, 37 bytes



                        import StdEnv
                        $n=[i^(n-i)\i<-[1..n]]


                        Try it online!



                        Defines $ :: Int -> [Int] taking an integer and returning the list of results.



                        $ n                // function $ of n
                        = [i ^ (n-i) // i to the power of n minus i
                        \ i <- [1..n] // for each i in 1 to n
                        ]





                        share|improve this answer

























                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote










                          Clean, 37 bytes



                          import StdEnv
                          $n=[i^(n-i)\i<-[1..n]]


                          Try it online!



                          Defines $ :: Int -> [Int] taking an integer and returning the list of results.



                          $ n                // function $ of n
                          = [i ^ (n-i) // i to the power of n minus i
                          \ i <- [1..n] // for each i in 1 to n
                          ]





                          share|improve this answer















                          Clean, 37 bytes



                          import StdEnv
                          $n=[i^(n-i)\i<-[1..n]]


                          Try it online!



                          Defines $ :: Int -> [Int] taking an integer and returning the list of results.



                          $ n                // function $ of n
                          = [i ^ (n-i) // i to the power of n minus i
                          \ i <- [1..n] // for each i in 1 to n
                          ]






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited 1 hour ago

























                          answered 1 hour ago









                          Οurous

                          5,86311032




                          5,86311032






















                              up vote
                              1
                              down vote














                              Wolfram Language (Mathematica), 24 20 18 bytes



                              (x=Range@#)^(#-x)&


                              Try it online!



                              -4 thanks @lirtosiast.






                              share|improve this answer



























                                up vote
                                1
                                down vote














                                Wolfram Language (Mathematica), 24 20 18 bytes



                                (x=Range@#)^(#-x)&


                                Try it online!



                                -4 thanks @lirtosiast.






                                share|improve this answer

























                                  up vote
                                  1
                                  down vote










                                  up vote
                                  1
                                  down vote










                                  Wolfram Language (Mathematica), 24 20 18 bytes



                                  (x=Range@#)^(#-x)&


                                  Try it online!



                                  -4 thanks @lirtosiast.






                                  share|improve this answer















                                  Wolfram Language (Mathematica), 24 20 18 bytes



                                  (x=Range@#)^(#-x)&


                                  Try it online!



                                  -4 thanks @lirtosiast.







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited 1 hour ago

























                                  answered 1 hour ago









                                  Shieru Asakoto

                                  2,350314




                                  2,350314






















                                      up vote
                                      1
                                      down vote














                                      Pyth, 5 bytes



                                      _m^-Q


                                      Try it online!



                                      Optimally encoded this would be 4.106 bytes.



                                      _                reverse of the following list:
                                      m map the following lambda d:
                                      ^ (N-d)**d
                                      -Qd
                                      d
                                      Q over [0,...,N-1]





                                      share|improve this answer



























                                        up vote
                                        1
                                        down vote














                                        Pyth, 5 bytes



                                        _m^-Q


                                        Try it online!



                                        Optimally encoded this would be 4.106 bytes.



                                        _                reverse of the following list:
                                        m map the following lambda d:
                                        ^ (N-d)**d
                                        -Qd
                                        d
                                        Q over [0,...,N-1]





                                        share|improve this answer

























                                          up vote
                                          1
                                          down vote










                                          up vote
                                          1
                                          down vote










                                          Pyth, 5 bytes



                                          _m^-Q


                                          Try it online!



                                          Optimally encoded this would be 4.106 bytes.



                                          _                reverse of the following list:
                                          m map the following lambda d:
                                          ^ (N-d)**d
                                          -Qd
                                          d
                                          Q over [0,...,N-1]





                                          share|improve this answer















                                          Pyth, 5 bytes



                                          _m^-Q


                                          Try it online!



                                          Optimally encoded this would be 4.106 bytes.



                                          _                reverse of the following list:
                                          m map the following lambda d:
                                          ^ (N-d)**d
                                          -Qd
                                          d
                                          Q over [0,...,N-1]






                                          share|improve this answer














                                          share|improve this answer



                                          share|improve this answer








                                          edited 58 mins ago

























                                          answered 1 hour ago









                                          lirtosiast

                                          15.5k436105




                                          15.5k436105






















                                              up vote
                                              1
                                              down vote














                                              MathGolf, 6 bytes



                                              rx╒m#


                                              Try it online!






                                              share|improve this answer

























                                                up vote
                                                1
                                                down vote














                                                MathGolf, 6 bytes



                                                rx╒m#


                                                Try it online!






                                                share|improve this answer























                                                  up vote
                                                  1
                                                  down vote










                                                  up vote
                                                  1
                                                  down vote










                                                  MathGolf, 6 bytes



                                                  rx╒m#


                                                  Try it online!






                                                  share|improve this answer













                                                  MathGolf, 6 bytes



                                                  rx╒m#


                                                  Try it online!







                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered 46 mins ago









                                                  Jo King

                                                  19.5k245102




                                                  19.5k245102






















                                                      up vote
                                                      1
                                                      down vote













                                                      Haskell, 23 bytes



                                                      f i=[x^(i-x)|x<-[1..i]]


                                                      Try it online!



                                                      Alternative version, also 23 bytes:



                                                      f i=(^)<*>(i-)<$>[1..i]





                                                      share|improve this answer

























                                                        up vote
                                                        1
                                                        down vote













                                                        Haskell, 23 bytes



                                                        f i=[x^(i-x)|x<-[1..i]]


                                                        Try it online!



                                                        Alternative version, also 23 bytes:



                                                        f i=(^)<*>(i-)<$>[1..i]





                                                        share|improve this answer























                                                          up vote
                                                          1
                                                          down vote










                                                          up vote
                                                          1
                                                          down vote









                                                          Haskell, 23 bytes



                                                          f i=[x^(i-x)|x<-[1..i]]


                                                          Try it online!



                                                          Alternative version, also 23 bytes:



                                                          f i=(^)<*>(i-)<$>[1..i]





                                                          share|improve this answer












                                                          Haskell, 23 bytes



                                                          f i=[x^(i-x)|x<-[1..i]]


                                                          Try it online!



                                                          Alternative version, also 23 bytes:



                                                          f i=(^)<*>(i-)<$>[1..i]






                                                          share|improve this answer












                                                          share|improve this answer



                                                          share|improve this answer










                                                          answered 46 mins ago









                                                          nimi

                                                          30.9k31985




                                                          30.9k31985






















                                                              up vote
                                                              0
                                                              down vote














                                                              JavaScript (Node.js), 36 bytes





                                                              f=(n,i=1)=>n--?[i++**n,...f(n,i)]:


                                                              Try it online!




                                                              JavaScript (Node.js), 37 bytes





                                                              n=>[...Array(n)].map(x=>++i**--n,i=0)


                                                              Try it online!






                                                              share|improve this answer

























                                                                up vote
                                                                0
                                                                down vote














                                                                JavaScript (Node.js), 36 bytes





                                                                f=(n,i=1)=>n--?[i++**n,...f(n,i)]:


                                                                Try it online!




                                                                JavaScript (Node.js), 37 bytes





                                                                n=>[...Array(n)].map(x=>++i**--n,i=0)


                                                                Try it online!






                                                                share|improve this answer























                                                                  up vote
                                                                  0
                                                                  down vote










                                                                  up vote
                                                                  0
                                                                  down vote










                                                                  JavaScript (Node.js), 36 bytes





                                                                  f=(n,i=1)=>n--?[i++**n,...f(n,i)]:


                                                                  Try it online!




                                                                  JavaScript (Node.js), 37 bytes





                                                                  n=>[...Array(n)].map(x=>++i**--n,i=0)


                                                                  Try it online!






                                                                  share|improve this answer













                                                                  JavaScript (Node.js), 36 bytes





                                                                  f=(n,i=1)=>n--?[i++**n,...f(n,i)]:


                                                                  Try it online!




                                                                  JavaScript (Node.js), 37 bytes





                                                                  n=>[...Array(n)].map(x=>++i**--n,i=0)


                                                                  Try it online!







                                                                  share|improve this answer












                                                                  share|improve this answer



                                                                  share|improve this answer










                                                                  answered 1 hour ago









                                                                  Shieru Asakoto

                                                                  2,350314




                                                                  2,350314






















                                                                      up vote
                                                                      0
                                                                      down vote














                                                                      Jelly, 5 bytes



                                                                      R*ḶU$


                                                                      Try it online!



                                                                      R                [1,...,n]
                                                                      * to the power of
                                                                      ḶU$ [0,...,n-1] reversed





                                                                      share|improve this answer



























                                                                        up vote
                                                                        0
                                                                        down vote














                                                                        Jelly, 5 bytes



                                                                        R*ḶU$


                                                                        Try it online!



                                                                        R                [1,...,n]
                                                                        * to the power of
                                                                        ḶU$ [0,...,n-1] reversed





                                                                        share|improve this answer

























                                                                          up vote
                                                                          0
                                                                          down vote










                                                                          up vote
                                                                          0
                                                                          down vote










                                                                          Jelly, 5 bytes



                                                                          R*ḶU$


                                                                          Try it online!



                                                                          R                [1,...,n]
                                                                          * to the power of
                                                                          ḶU$ [0,...,n-1] reversed





                                                                          share|improve this answer















                                                                          Jelly, 5 bytes



                                                                          R*ḶU$


                                                                          Try it online!



                                                                          R                [1,...,n]
                                                                          * to the power of
                                                                          ḶU$ [0,...,n-1] reversed






                                                                          share|improve this answer














                                                                          share|improve this answer



                                                                          share|improve this answer








                                                                          edited 1 hour ago

























                                                                          answered 1 hour ago









                                                                          lirtosiast

                                                                          15.5k436105




                                                                          15.5k436105






















                                                                              up vote
                                                                              0
                                                                              down vote














                                                                              Perl 6, 19 bytes





                                                                              {^$_+1 Z**[R,] ^$_}


                                                                              Try it online!



                                                                              Anonymous code block that takes a number and returns a list. Zip multiplies the range 1 to input and the range input-1 to 0






                                                                              share|improve this answer

























                                                                                up vote
                                                                                0
                                                                                down vote














                                                                                Perl 6, 19 bytes





                                                                                {^$_+1 Z**[R,] ^$_}


                                                                                Try it online!



                                                                                Anonymous code block that takes a number and returns a list. Zip multiplies the range 1 to input and the range input-1 to 0






                                                                                share|improve this answer























                                                                                  up vote
                                                                                  0
                                                                                  down vote










                                                                                  up vote
                                                                                  0
                                                                                  down vote










                                                                                  Perl 6, 19 bytes





                                                                                  {^$_+1 Z**[R,] ^$_}


                                                                                  Try it online!



                                                                                  Anonymous code block that takes a number and returns a list. Zip multiplies the range 1 to input and the range input-1 to 0






                                                                                  share|improve this answer













                                                                                  Perl 6, 19 bytes





                                                                                  {^$_+1 Z**[R,] ^$_}


                                                                                  Try it online!



                                                                                  Anonymous code block that takes a number and returns a list. Zip multiplies the range 1 to input and the range input-1 to 0







                                                                                  share|improve this answer












                                                                                  share|improve this answer



                                                                                  share|improve this answer










                                                                                  answered 1 hour ago









                                                                                  Jo King

                                                                                  19.5k245102




                                                                                  19.5k245102






















                                                                                      up vote
                                                                                      0
                                                                                      down vote














                                                                                      R, 34 bytes





                                                                                      x=1:scan();cat(x^rev(x-1),sep=',')


                                                                                      Try it online!






                                                                                      share|improve this answer

























                                                                                        up vote
                                                                                        0
                                                                                        down vote














                                                                                        R, 34 bytes





                                                                                        x=1:scan();cat(x^rev(x-1),sep=',')


                                                                                        Try it online!






                                                                                        share|improve this answer























                                                                                          up vote
                                                                                          0
                                                                                          down vote










                                                                                          up vote
                                                                                          0
                                                                                          down vote










                                                                                          R, 34 bytes





                                                                                          x=1:scan();cat(x^rev(x-1),sep=',')


                                                                                          Try it online!






                                                                                          share|improve this answer













                                                                                          R, 34 bytes





                                                                                          x=1:scan();cat(x^rev(x-1),sep=',')


                                                                                          Try it online!







                                                                                          share|improve this answer












                                                                                          share|improve this answer



                                                                                          share|improve this answer










                                                                                          answered 1 hour ago









                                                                                          Giuseppe

                                                                                          16.1k31052




                                                                                          16.1k31052






















                                                                                              up vote
                                                                                              0
                                                                                              down vote














                                                                                              Octave, 21 bytes





                                                                                              @(n)(1:n).^(n-1:-1:0)


                                                                                              Try it online!






                                                                                              share|improve this answer

























                                                                                                up vote
                                                                                                0
                                                                                                down vote














                                                                                                Octave, 21 bytes





                                                                                                @(n)(1:n).^(n-1:-1:0)


                                                                                                Try it online!






                                                                                                share|improve this answer























                                                                                                  up vote
                                                                                                  0
                                                                                                  down vote










                                                                                                  up vote
                                                                                                  0
                                                                                                  down vote










                                                                                                  Octave, 21 bytes





                                                                                                  @(n)(1:n).^(n-1:-1:0)


                                                                                                  Try it online!






                                                                                                  share|improve this answer













                                                                                                  Octave, 21 bytes





                                                                                                  @(n)(1:n).^(n-1:-1:0)


                                                                                                  Try it online!







                                                                                                  share|improve this answer












                                                                                                  share|improve this answer



                                                                                                  share|improve this answer










                                                                                                  answered 13 mins ago









                                                                                                  tsh

                                                                                                  8,05011346




                                                                                                  8,05011346






















                                                                                                      Embodiment of Ignorance is a new contributor. Be nice, and check out our Code of Conduct.










                                                                                                       

                                                                                                      draft saved


                                                                                                      draft discarded


















                                                                                                      Embodiment of Ignorance is a new contributor. Be nice, and check out our Code of Conduct.













                                                                                                      Embodiment of Ignorance is a new contributor. Be nice, and check out our Code of Conduct.












                                                                                                      Embodiment of Ignorance is a new contributor. Be nice, and check out our Code of Conduct.















                                                                                                       


                                                                                                      draft saved


                                                                                                      draft discarded














                                                                                                      StackExchange.ready(
                                                                                                      function () {
                                                                                                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f176666%2fgiven-an-input-print-all-exponents-where-all-the-bases-and-powers-all-up-to-the%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

                                                                                                      Create new schema in PostgreSQL using DBeaver

                                                                                                      Deepest pit of an array with Javascript: test on Codility

                                                                                                      Fotorealismo