g | x | w | all
Bytes Lang Time Link
024AWK250307T191926Zxrs
020Arturo230815T035232Zchunes
005Thunno 2230812T171722ZThe Thon
052Gambit Scheme gsi181212T221032Zsporkl
047C clang181212T173920Zuser3604
039PowerShell181206T215757ZVeskah
022Pari/GP181204T173429Zalephalp
004Jelly181129T222218ZErik the
071SAS181129T215017ZJosh Ell
056C++ clang181128T130622ZARandomG
059Java181128T155733Zisaace
005APL Dyalog Unicode181128T141601ZJ. Sall&
022APLNARS181129T081254Zuser5898
052C gcc lm181129T063012ZErikF
nanAheui esotope181128T065018Zcobaltp
018Octave181128T053259Ztsh
005MATL181128T184931ZLuis Men
021Perl 5 n181128T180424ZXcali
046C# Visual C# Interactive Compiler181128T160331Zdana
032JavaScript Node.js181128T041523ZShieru A
042F# .NET Core181128T151828Zdana
033QBasic181128T084907Zsteenber
035Retina181128T120624ZNeil
055C# Visual C# Interactive Compiler181128T115901Zauhmaan
009Charcoal181128T114945ZNeil
032PHP181128T114348ZTitus
019Perl 6181128T043422ZJo King
022R181128T110219ZJDL
041Lua181128T100137Zouflak
00505AB1E181128T104255ZKevin Cr
005Japt181128T075939ZShaggy
010J181128T091148ZGalen Iv
027Ruby181128T070658ZG B
040Python 2181128T055850ZVedant K
023Haskell181128T050015Znimi
006MathGolf181128T050008ZJo King
005Pyth181128T044303Zlirtosia
034R181128T044233ZGiuseppe
018Wolfram Language Mathematica181128T043114ZShieru A
037Clean181128T041220ZΟurous
005Jelly181128T041639Zlirtosia

AWK, 24 bytes

{for(;$1--;)print++i^$1}

Attempt This Online!

Feels like there has to be a sneaky idiomatic way to do it shorter.

Arturo, 20 bytes

$->n[map n'i->i^n-i]

Try it!

Thunno 2, 5 bytes

RD$_*

Try it online!

Explanation

RD$_*  # Implicit input
R      # Push [1..input]
 D     # Duplicate
  $_   # Subtract from input
    *  # Exponentiate
       # Implicit output

Gambit Scheme (gsi), 52 bytes

(lambda(x)(map(lambda(y)(expt y(-x y)))(iota x 1)))

For some reason this code does not appear to work on TIO. It works fine on my machine.

Explanation:

(lambda(x)(map(lambda(y)(expt y(- x y)))(iota x 1)))    Full program
(lambda(x)                                        )    Anonymous function with arg x
          (map(lambda(y)              )(iota x 1))     Map over the range 1 to input
                        (expt y                        Raises the mapped value to...
                               (- x y)                 The input value minus the mapped value (this powers the list by the reverse)

C (clang), 47 bytes

i;f(a){for(i=a;i;printf("%.f,",pow(i,a-i--)));}

Try it online!

Prints in reverse order, delimited with commas.

PowerShell, 39 bytes

param($n)1..$n|%{"1"+"*$_"*($n-$_)|iex}

Try it online!

Because exponents are expensive in Powershell, this works by using invoke-expression to parse and calculate the string "1*n*n...*n" Works because the first and last entry are always 1.

Pari/GP, 22 bytes

n->[i^(n-i)|i<-[1..n]]

Try it online!

Jelly, 4 bytes

*ạ¥€

Try it online!

SAS, 71 bytes

data a;input n;o=cat(1);do x=1 to n-1;o=catx(',',(n-x)**x,o);end;cards;

Input goes after the cards; statement, separated by newlines, like so:

data a;input n;o=cat(1);do x=1 to n-1;o=catx(',',(n-x)**x,o);end;cards;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Outputs a dataset containing the input n, and comma-separated output string o (and also helper variable x)

+----+------------------------------------------------------------------------------------------+----+
| n  |                                            o                                             | x  |
+----+------------------------------------------------------------------------------------------+----+
¦ 1  ¦ 1                                                                                        ¦ 1  ¦
¦ 2  ¦ 1,1                                                                                      ¦ 2  ¦
¦ 3  ¦ 1,2,1                                                                                    ¦ 3  ¦
¦ 4  ¦ 1,4,3,1                                                                                  ¦ 4  ¦
¦ 5  ¦ 1,8,9,4,1                                                                                ¦ 5  ¦
¦ 6  ¦ 1,16,27,16,5,1                                                                           ¦ 6  ¦
¦ 7  ¦ 1,32,81,64,25,6,1                                                                        ¦ 7  ¦
¦ 8  ¦ 1,64,243,256,125,36,7,1                                                                  ¦ 8  ¦
¦ 9  ¦ 1,128,729,1024,625,216,49,8,1                                                            ¦ 9  ¦
¦ 10 ¦ 1,256,2187,4096,3125,1296,343,64,9,1                                                     ¦ 10 ¦
¦ 11 ¦ 1,512,6561,16384,15625,7776,2401,512,81,10,1                                             ¦ 11 ¦
¦ 12 ¦ 1,1024,19683,65536,78125,46656,16807,4096,729,100,11,1                                   ¦ 12 ¦
¦ 13 ¦ 1,2048,59049,262144,390625,279936,117649,32768,6561,1000,121,12,1                        ¦ 13 ¦
¦ 14 ¦ 1,4096,177147,1048576,1953125,1679616,823543,262144,59049,10000,1331,144,13,1            ¦ 14 ¦
¦ 15 ¦ 1,8192,531441,4194304,9765625,10077696,5764801,2097152,531441,100000,14641,1728,169,14,1 ¦ 15 ¦
+----------------------------------------------------------------------------------------------------+

C++ (clang), 80 bytes, 71 bytes, 63 bytes, 59 bytes, 56 bytes

int n,c=1;cin>>n;for(;c<=n;++c){cout<<pow(c,n-c)<<endl;}

Try it online!

Java, 59 Bytes

for(int i=1;a+1>i;i++)System.out.println(Math.pow(i,a-i));

APL (Dyalog Unicode), 8 5 bytes

⍳*⊢-⍳

Try it online!

Anonymous prefix tacit function. TIO tests for the range [1..10].

Thanks @lirtosiast for 3 bytes.

How:

⍳*⊢-⍳ ⍝ Tacit function
    ⍳ ⍝ Range. ⍳n generates the vector [1..n].
  ⊢- ⍝ Subtracted from the argument. The vector is now [n-1,n-2,...,0]
⍳*    ⍝ Exponentiate using the range [1..n] as base. The result is the vector
      ⍝ [1^(n-1), 2^(n-2), 3^(n-3),...]

APL(NARS), 11 chars, 22 bytes

{⍪⍵*⌽⍵-1}∘⍳

test:

  f←{⍪⍵*⌽⍵-1}∘⍳
  f 5
1
8
9
4
1

C (gcc) (-lm), 52 bytes

f(n,i){for(i=n;i--;printf("%.0f\n",pow(n-i,i)));}

Try it online!

Aheui (esotope), 193 164 bytes (56 chars)

방빠싹받분샥퍼붇바파쟈뿌차샦히망맣여
타빠바푸투반또분뽀뿌서썪삯타삯받반타
석차샦져쌲볼어타토싻삭빠쏛ㅇ또섞썪뻐

Try it online!

Try it on AVIS(Korean); just copy and paste code above, press start button, input a number, see how it moves. To see output, press the >_ icon on left side.


It's not golfed much, but I give it a shot.

Octave, 18 bytes

@(n)(t=1:n).^(n-t)

Try it online!

Thanks Luis Mendo, using internal variable saves 3 bytes.

MATL, 5 bytes

:Gy-^

Try it online!

Explanation

Consider input 5 as an example.

:     % Implicit input. Range
      % STACK: [1 2 3 4 5]
G     % Push input again
      % STACK: [1 2 3 4 5], 5
y     % Duplicate from below
      % STACK: [1 2 3 4 5], 5, [1 2 3 4 5]
-     % Subtract, element-wise
      % STACK: [1 2 3 4 5], [4 3 2 1 0]
^     % Power, element-wise. Implicit display
      % STACK: [1 8 9 4 1]

Perl 5 -n, 21 bytes

say++$\**--$_ while$_

Try it online!

C# (Visual C# Interactive Compiler), 46 bytes

x=>new int[x].Select((_,i)=>Math.Pow(i+1,--x))

Try it online!

JavaScript (Node.js), 33 32 bytes

n=>(g=i=>--n?++i**n+[,g(i)]:1)``

Try it online!

-3 bytes with credits to @Shaggy, and -1 byte by @l4m2!

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!

F# (.NET Core), 42 bytes

let f x=Seq.map(fun y->pown y (x-y))[1..x]

Try it online!

QBasic, 3533 bytes

Thank you @Neil for 2 bytes!

INPUT a
FOR b=1TO a
?b^(a-b)
NEXT

Slightly expanded version on REPL.IT because the interpreter in't entirely up-to-spec.

Output

QBasic (qb.js)
Copyright (c) 2010 Steve Hanov
   
   5
1
8
9
4
1

Retina, 35 bytes

.+
*
_
$$.($.'*$($.>`$*)_¶
%~`^
.+¶

Try it online! Explanation:

.+
*

Convert the input to unary.

_

Match each position. This then sets several replacement variables. $` becomes the left of the match; $>` modifies this to be the left and match; $.>` modifies this to take the length, i.e. the current index. $' meanwhile is the right of the match, so $.' is the length i.e. the current exponent.

$$.($.'*$($.>`$*)_¶

Create a string $.( plus $.' repetitions of $.>`* plus _. For an example, for an index of 2 in an original input of 5, $.' is 3 and $.>` is 2 so the resulting string is $.(2*2*2*_. This conveniently is a Retina replacement expression that caluclates 2³. Each string is output on its own line.

%~`^
.+¶

For each line generated by the previous stage, prefix a line .+ to it, turning it into a replacement stage, and evaluate that stage, thereby calculating the expression.

C# (Visual C# Interactive Compiler), 55 bytes

v=>Enumerable.Range(0,v--).Select(i=>Math.Pow(i+1,v--))

Try it online!

Charcoal, 9 bytes

I⮌ENX⁻θιι

Try it online! Link is to verbose version of code. Explanation:

   N        Input as a number
  E         Map over implicit range
       ι    Current value
     ⁻      Subtracted from
      θ     First input
    X       Raised to power
        ι   Current value
 ⮌          Reverse list
I           Cast to string
             Implicitly print on separate lines

PHP, 32 bytes

while($argn)echo++$i**--$argn,_;

Run as pipe with -nR or try it online.

Perl 6, 19 bytes

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

Try it online!

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

R, 22 bytes

n=scan();(1:n)^(n:1-1)

Fairly self-explanatory; note that the : operator is higher precendence than the - operator so that n:1-1 is shorter than (n-1):0

If we are allowed to start at 0, then we can lose two bytes by using (0:n)^(n:0) avoiding the need for a -1.

Lua, 43 41 bytes

-2 bytes thanks to @Shaggy

s=io.read()for i=1,s do print(i^(s-i))end

Try it online!

05AB1E, 5 bytes

LD<Rm

Port of @lirtosiast's Jelly answer.

Try it online.

Explanation:

L      # List in the range [1, (implicit) input integer]
       #  i.e. 5 → [1,2,3,4,5]
 D<    # Duplicate this list, and subtract 1 to make the range [0, input)
       #  i.e. [1,2,3,4,5] → [0,1,2,3,4]
   R   # Reverse it to make the range (input, 0]
       #  i.e. [0,1,2,3,4] → [4,3,2,1,0]
    m  # Take the power of the numbers in the lists (at the same indices)
       # (and output implicitly)
       #  i.e. [1,2,3,4,5] and [4,3,2,1,0] → [1,8,9,4,1]

Japt, 5 bytes

õ_p´U

Try it

õ         :Range [1,input]
 _        :Map
  p       :  Raise to the power of
   ´U     :  Input decremented

J, 10 bytes

(>:^|.)@i.

Try it online!

If we really need to separate the numbers by a newline:

J, 13 bytes

,.@(>:^|.)@i.

Try it online!

Ruby, 27 bytes

->n{(1..n).map{|r|r**n-=1}}

Try it online!

Python 2, 40 bytes

lambda n:[i**(n-i)for i in range(1,n+1)]   #Outputs a list

Try it online!

Python 2, 41 bytes

n,i=input(),0
exec"print(n-i)**i;i+=1;"*n   #Prints in reversed order

Try it online!

Haskell, 23 bytes

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

Try it online!

Alternative version, also 23 bytes:

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

MathGolf, 6 bytes

rx\╒m#

Try it online!

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]

R, 34 bytes

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

Try it online!

Wolfram Language (Mathematica), 24 20 18 bytes

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

Try it online!

-4 thanks @lirtosiast.

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
   ]

Jelly, 5 bytes

R*ḶU$

Try it online!

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