g | x | w | all
Bytes Lang Time Link
028Periodically250506T194000Zmadeforl
014Juby250506T024323ZJordan
006Thumb2 assembly 12 bytes250506T023434Zpetroleu
24664bit Aarch64 assembly250506T022151Zpetroleu
011TIBASIC TI83 Plus250424T163625Zmadeforl
046Swift 6250425T183101ZmacOSist
016CASIO BASIC CASIO fx9750GIII250424T160245Zmadeforl
015Raku Perl 6 rakudo250424T142620Zxrs
072Java250328T132217Zmarco
044Tcl250301T194437Zsergiol
024AWK250325T204755Zxrs
054SAKO250325T191213ZAcrimori
148Bespoke250308T044807ZJosiah W
040Tcl250301T223642Zsergiol
071Tcl250301T204007Zsergiol
050Tcl170708T010223Zsergiol
052Tcl170708T004728Zsergiol
004Uiua230927T180221Zchunes
002Nekomata230705T030856Zalephalp
003Thunno 2230607T171626ZThe Thon
026Rust230606T203058ZStarwort
004BQN230606T025559Zchunes
051Go230404T140046Zbigyihsu
020PowerShell230404T123546ZJames Fl
nan230324T023633ZRARE Kpo
003vemf230328T222724Z
017Julia 1.0230329T143122ZMarcMush
008Rattle230327T223432Zd01
005Nibbles230327T012546ZDeadcode
017Desmos230326T200514ZYouserna
013Regex 🐇 ECMAScript+?^*RME220723T235557ZDeadcode
036Nibbles230326T201544ZDominic
004APL Dyalog170509T222756ZAdá
073Fortran GFortran230324T150826Zroblogic
nan230324T072558ZThe Thon
016Arturo230324T023040Zchunes
082C gcc with lgmp230324T014626ZErikF
094Aussie++230324T010053ZBbrk24
055ReRegex230323T232805ZATaco
014FunStack alpha230323T232444ZDLosc
045C++ clang220724T220005Zc--
002Vyxal220724T005217ZnaffetS
018Factor + math.unicode220724T093235Zchunes
037Python 2220724T020007ZEric Xue
009Keg200813T223232Zlyxal
062Rockstar200916T145059ZShaggy
026Rust200814T173318Zmadlaina
431Java JDK200813T134846Zmindover
024Google Sheets200813T134832ZGeneral
022MAWP200812T105040ZRazetime
0241+200812T133321ZTwilight
017Perl 5 + p200813T115429ZDom Hast
037Rust200813T103753ZTehPers
008Arn200812T141012ZZippyMag
005Integral200812T140652Zuser9649
016Flurry200812T081249ZBubbler
005Pushy171218T195603ZFlipTack
010x86_64 machine language for Linux170708T223205Zceilingc
044PHP170725T063433ZTitus
016Ly170725T062639ZLyricLy
005J170725T061843ZJonah
034Excel VBA170712T141807ZTaylor R
183><>170712T133648ZTeal pel
018x86 machine code Linux170708T152207Zბიმო
040Common Lisp170708T220225Zceilingc
004Japt170708T225651ZJustin M
032Python170709T221330ZuserNaN
018Julia 0.6170710T015048ZTanj
00205AB1E170709T222106ZDatboi
037Python 2.7170709T212754ZKoishore
023MATLAB/Octave170709T124548ZBatman
024JavaScript ES6170509T222509ZShaggy
036PowerShell170709T022141Zroot
009TIBasic TI84 Plus CE170708T014742Zpizzapan
148brainf*ck170510T211600ZGraviton
021Haskell170511T113711Zsudee
016Pari/GP170512T131320Zalephalp
004Pyth170516T031537ZDigital
009Pyth170515T023156Zclapp
042Standard ML170511T191608Zmusicman
044Java 9 JShell170513T004927ZDavid Co
00305AB1E170510T131732ZRiley
026Scala170512T083827Zmusicman
018MacOS Bash170510T194750ZDigital
010Stacked170511T171601ZConor O&
033Aceto170511T142837ZL3viatha
038PHP170509T223551ZJör
046Retina170510T161616Zuser4180
076BrainFlak170511T041557ZDJMcMayh
056S.I.L.O.S170510T212733ZRohan Jh
022R170510T182115ZGiuseppe
013Alice170510T200055ZMartin E
018Ruby170509T230521ZValue In
058Batch170510T194230ZNeil
043Pure bash170510T165420ZDigital
019Cubix170510T190121ZMickyT
024Groovy170510T185305Zstaticme
022dc170510T151306ZMax Mikh
017Röda170510T181301Zfergusq
022Clojure170510T164703ZNikoNyrh
051Python170510T164201ZWondercr
019Fourier170510T161257ZBeta Dec
006CJam170510T155309ZLuis Men
005MATL170509T224641ZLuis Men
013Perl 6170510T154604ZSean
034C gcc170510T140435ZSteadybo
033PowerShell170510T133932ZAndrei O
007CJam170510T132548ZBusiness
016Mathematica170510T130521ZMartin E
012QBIC170510T113519Zsteenber
006Brachylog170510T113324ZFatalize
003Jelly170509T221658ZJonathan
025Python170509T225640Zxnor

Periodically, 28 bytes

this lang doesn't even have an exponent function or anything related.

HHHTi(ICa)2OOBCIIF[BINO]0ICl

explanation:

HHHTi(ICa)2OOBCIIF[BINO]0ICl     packed
HHH                              init 3 numbers in tape
   Ti                            get input (put it to var[0])
     (ICa)2                      copy var[0] to var[1] and var[2]
           OOB                   subtract 2 from arg[0] and decrement var[0]
              CIIF               add 2 to arg[1]
                  [    ]0        while var[0] != 0...
                   B                 decrement var[0]
                    INO              multiply var[1] by var[2]
                         ICl     print final result

J-uby, 14 bytes

~:*%-[I]|:/&:*

Attempt This Online!

Explanation

~:* % -[I] | :/ & :*
~:* % -[I] |          # Construct an array with a single element, n, and multiply it by n, then
             :/ & :*  # Reduce with multiplication

Thumb-2 assembly; 12 bytes, 6 insns

f:
    subs   r1, r0, #1  // 2: 0x1e41
    mov    r2, r0      // 2: 0x4602
loop:
    muls   r0, r0, r2  // 2: 0x4350
    subs   r1, r1, #1  // 2: 0x1e49
    cbnz   r1, loop    // 2: 0xbb9b
    bx     lr          // 2: 0x4770

This is a fairly straightforward translation of another answer I just posted but using the Thumb-2 32-bit instruction set. It likewise follows a normal calling convention and can be called from regular C code as if it were extern int f(int n); where it returns the exponentiated number.

This is a mixed-width instruction set, with instructions either 2 or 4 bytes wide; all instructions used here are in their 2-byte variants.

I haven't tested it on hardware, but it should work fine for n <= 9 (since log₂(10^10) > 32).

64-bit Aarch64 assembly, 24 bytes / 6 insns

f:
    sub   x1, x0, #1
    mov   x2, x0
loop:
    mul   x0, x0, x2
    sub   x1, x1, #1
    cbnz  x1, loop
    ret

It follows a normal calling convention and can be called from regular C code as if it were extern int f(int n); where it returns the exponentiated number. No interesting tricks here to explain.

All Aarch64 instructions are 4 bytes/32 bits long, so byte count = instruction count * 4 for all instructions. I haven't tested it on hardware, but it should work fine for n <= 16 (since 16^16 is 2^64)

TI-BASIC (TI-83 Plus), 11 bytes

Input N
prod(randInt(N,N,N

doesn't actually do any randomness, it just creates a list of N with length N.

Swift 6, 46 bytes

let p={{repeatElement}()($0+0,$0).reduce(1,*)}

This is the first time I've ever actually used repeatElement(_:count:) in a Swift golf. You'd think it'd be more useful...

CASIO BASIC (CASIO fx-9750GIII), 16 bytes

?→N
Prod Seq(N,K,1,N,1

simple!

Raku (Perl 6) (rakudo), 15 bytes

{[*] $^a xx$^a}

Attempt This Online!

Creates a list of $^as with $^a number of elements and then folds multiplication.

Java, 72 bytes

Java is a bit verbose for this problem, but I'll state a solution anyway.

long p(int x,int...n){int e=n.length>0?n[0]:x;return e==0?1:x*p(x,e-1);}

formatted with tests:

public class Main {
    public static void main(String[] args) {
        final Main main = new Main();
        for (int x = 1; x <= 10; x++) {
            System.out.println(x + ":\t" + main.p(x));
        }
    }

    long p(int x, int... n) {
        int e=n.length>0 ? n[0] : x;
        return e==0 ? 1 : x*p(x,e-1);
    }
}

Try it online!

Output

1:  1
2:  4
3:  27
4:  256
5:  3125
6:  46656
7:  823543
8:  16777216
9:  387420489
10: 10000000000

Or a more efficient but longer version:

long p(int x, int...n) {
    int e=n.length>0 ? n[0] : x;
    return e==0 ? 1 : (e&1)==0 ? p(x*x, e>>1) : x*p(x, e-1);
}

Tcl, 44 bytes

proc P n {tcl::mathop::* {*}[lrepeat $n $n]}

Try it online!

AWK, 24 bytes

{for(x=$0;++i<x;)$0*=x}1

Attempt This Online!

Doesn't handle negatives, but it's around 100 bytes shorter than the previous AWK answer.

{for(x=$0   # set x to input
;++i<x;)    # repeat until x
$0*=x}      # default output times-equals original input
1           # always print default output

SAKO, 54 bytes

PODPROGRAM:P(N)
R=1
*)R=R×N
POWTORZ:I=1(1)N
P()=R
WROC

Full programme version, 64 bytes

CZYTAJ:N
R=1
*1)R=R×N
POWTORZ:I=1(1)N
DRUKUJ(9,0):R
STOP1
KONIEC

Bespoke, 148 bytes

POWER
I am very rich
I assumed control over all of these plebians
influence is simple,actually;anything we read(even you)we may believe
who reigns?I

Uses a CONTROL DOWHILE loop to repeatedly multiply the inputted number with 1.

Bespoke does have an exponentiation builtin (STACKTOP POW); if this were allowed, the program would be 37 bytes:

POWER
I am very powerful
who reigns?I

Tcl, 40 bytes

proc P n {expr [join [lrepeat $n $n] *]}

Try it online!

Tcl, 71 bytes

proc P {n m\ -1} {if $m<0 {set m $n}
expr {$m?$n*[P $n [expr $m-1]]:1}}

Try it online!

Had to try recursive exponentiation for this, but I failed to oulgolf myself!

Tcl, 50 bytes

proc P n {time {lappend L $n} $n;expr [join $L *]}

Try it online!

Tcl, 52 bytes

proc P n {incr p;time {set p [expr $p*$n]} $n;set p}

Try it online!

Uiua, 4 bytes

/×▽.

Try it!

  ▽.  # list of N Ns
/×    # product

Note: can also do /×↯.

Nekomata, 2 bytes

ř∏

Attempt This Online!

ř   Replicate
 ∏  Product

Thunno 2, 3 bytes

⁻{×

Attempt This Online!

Wọp

Attempt This Online!

Explanation

⁻{×  # Implicit input
⁻    # Decrement the input
 {   # Repeat that many times:
  ×  #  Multiply TOS with input
     # Implicit output
Wọp  # Implicit input
W    # Wrap the input in a list
 ọ   # Repeat it input number of times
  p  # Product of this list
     # Implicit output

Rust, 29 26 bytes

Saved 3c

|x|(0..x).fold(1,|a,_|a*x)
|x|(0..x).map(|_|x).product()

BQN, 4 bytes

×´⥊˜

Try it

  ⥊˜ # a list of N Ns
×´   # product

Go, 53 51 bytes

func(n int)int{p,i:=1,0
for;i<n;i++{p*=n}
return p}

Attempt This Online!

PowerShell, 20 bytes

@($n)*$n-join"*"|iex

Try it online!

Explanation

@($n)*$n-join"*"|iex    # full command
@($n)                   # array consisting of single element
*$n                     # multiply the array element x times
-join"*"                # joins all elements with * separating (3*3*3)
|iex                    # executes the provided expression 

UPDATE 2 ::

and finally, the super overskill version that uses binary squaring algorithm, safely catches division by zero, and properly handles negative integer bases and negative integer exponents — that's quite a nifty bit of data sanity checking and edge case handling for 3 lines of code that has no hard-coded constants at all, plus avoiding use of the exponentiation operator (^ or **)

Center column is function output, and right most column is reference output.

It could even handle some extremely large magnitude negative exponents, like x^x for :

-16777213  ^  ()  -5.53904374025776e-121210664
                  -5.53904374025776e-121210664

-log(!_) exists within the function merely to return +inf

for __ in -3 -2 -1 0 '' -0 1 2 3; do 

    jot 13 -4 | 

    gawk -v PREC=2000 -Mbe '

    func ____(___,__,_){return(__+=(_="")<__?_:___)<++_\
        ?(!__?_:___?_/____(___,-__):-log(!_)):__<++_?___\
        :(__%_?___:!!_)*____(___*___,int(__/_))

    } BEGIN { CONVFMT = "%.15g"
           _ = ""
    } ($++NF = " ^ (" (___) ")")^_ + \
      ($++NF = "|" ____(__=$!_,___))^_ + \
      ($++NF = "|" __^(_<___?___:__))' ___="$__" 

done 
     1  -4  ^  (-3)  -0.015625            -0.015625
     2  -3  ^  (-3)  -0.037037037037037   -0.037037037037037
     3  -2  ^  (-3)  -0.125               -0.125
     4  -1  ^  (-3)  -1                   -1
     5  0   ^  (-3)  +inf                 +inf
     6  1   ^  (-3)  1                    1
     7  2   ^  (-3)  0.125                0.125
     8  3   ^  (-3)  0.037037037037037    0.037037037037037
     9  4   ^  (-3)  0.015625             0.015625
    10  5   ^  (-3)  0.008                0.008
    11  6   ^  (-3)  0.00462962962962963  0.00462962962962963
    12  7   ^  (-3)  0.00291545189504373  0.00291545189504373
    13  8   ^  (-3)  0.001953125          0.001953125
    14  -4  ^  (-2)  0.0625               0.0625
    15  -3  ^  (-2)  0.111111111111111    0.111111111111111
    16  -2  ^  (-2)  0.25                 0.25
    17  -1  ^  (-2)  1                    1
    18  0   ^  (-2)  +inf                 +inf
    19  1   ^  (-2)  1                    1
    20  2   ^  (-2)  0.25                 0.25
    21  3   ^  (-2)  0.111111111111111    0.111111111111111
    22  4   ^  (-2)  0.0625               0.0625
    23  5   ^  (-2)  0.04                 0.04
    24  6   ^  (-2)  0.0277777777777778   0.0277777777777778
    25  7   ^  (-2)  0.0204081632653061   0.0204081632653061
    26  8   ^  (-2)  0.015625             0.015625
    27  -4  ^  (-1)  -0.25                -0.25
    28  -3  ^  (-1)  -0.333333333333333   -0.333333333333333
    29  -2  ^  (-1)  -0.5                 -0.5
    30  -1  ^  (-1)  -1                   -1
    31  0   ^  (-1)  +inf                 +inf
    32  1   ^  (-1)  1                    1
    33  2   ^  (-1)  0.5                  0.5
    34  3   ^  (-1)  0.333333333333333    0.333333333333333
    35  4   ^  (-1)  0.25                 0.25
    36  5   ^  (-1)  0.2                  0.2
    37  6   ^  (-1)  0.166666666666667    0.166666666666667
    38  7   ^  (-1)  0.142857142857143    0.142857142857143
    39  8   ^  (-1)  0.125                0.125
    40  -4  ^  (0)   1                    1
    41  -3  ^  (0)   1                    1
    42  -2  ^  (0)   1                    1
    43  -1  ^  (0)   1                    1
    44  0   ^  (0)   1                    1
    45  1   ^  (0)   1                    1
    46  2   ^  (0)   1                    1
    47  3   ^  (0)   1                    1
    48  4   ^  (0)   1                    1
    49  5   ^  (0)   1                    1
    50  6   ^  (0)   1                    1
    51  7   ^  (0)   1                    1
    52  8   ^  (0)   1                    1
    53  -4  ^  ()    0.00390625           0.00390625
    54  -3  ^  ()    -0.037037037037037   -0.037037037037037
    55  -2  ^  ()    0.25                 0.25
    56  -1  ^  ()    -1                   -1
    57  0   ^  ()    1                    1
    58  1   ^  ()    1                    1
    59  2   ^  ()    4                    4
    60  3   ^  ()    27                   27
    61  4   ^  ()    256                  256
    62  5   ^  ()    3125                 3125
    63  6   ^  ()    46656                46656
    64  7   ^  ()    823543               823543
    65  8   ^  ()    16777216             16777216
   (trimming out the -0 exponent ones since they're same as +0)
    79  -4  ^  (1)   -4                   -4
    80  -3  ^  (1)   -3                   -3
    81  -2  ^  (1)   -2                   -2
    82  -1  ^  (1)   -1                   -1
    83  0   ^  (1)   0                    0
    84  1   ^  (1)   1                    1
    85  2   ^  (1)   2                    2
    86  3   ^  (1)   3                    3
    87  4   ^  (1)   4                    4
    88  5   ^  (1)   5                    5
    89  6   ^  (1)   6                    6
    90  7   ^  (1)   7                    7
    91  8   ^  (1)   8                    8
    92  -4  ^  (2)   16                   16
    93  -3  ^  (2)   9                    9
    94  -2  ^  (2)   4                    4
    95  -1  ^  (2)   1                    1
    96  0   ^  (2)   0                    0
    97  1   ^  (2)   1                    1
    98  2   ^  (2)   4                    4
    99  3   ^  (2)   9                    9
   100  4   ^  (2)   16                   16
   101  5   ^  (2)   25                   25
   102  6   ^  (2)   36                   36
   103  7   ^  (2)   49                   49
   104  8   ^  (2)   64                   64
   105  -4  ^  (3)   -64                  -64
   106  -3  ^  (3)   -27                  -27
   107  -2  ^  (3)   -8                   -8
   108  -1  ^  (3)   -1                   -1
   109  0   ^  (3)   0                    0
   110  1   ^  (3)   1                    1
   111  2   ^  (3)   8                    8
   112  3   ^  (3)   27                   27
   113  4   ^  (3)   64                   64
   114  5   ^  (3)   125                  125
   115  6   ^  (3)   216                  216
   116  7   ^  (3)   343                  343
   117  8   ^  (3)   512                  512

====================================

UPDATE 1 ::: The shorter version that only does x^x, w/o binary squaring

jot 15 0 | 

gawk 'func ___(__,_){$NF*=(__+=(""~__)*($++_+=!$_))>_?$_ ___(--__):_}!___()'   

1
1
4
27
256
3125
46656
823543
16777216
387420489
10000000000
285311670611
8916100448256
302875106592253
11112006825558016

====================================

awk - a LOT of bytes (123 ?, per Deadcode), but it includes the full recursive binary squaring algorithm tailored for x^x without using any alphanumerics (other than unavoidable keywords like function and return) or the power (^ | **) operator :

jot 14 | 

mawk 'function ____(__,___,_){return(___+=((_="")==___)*__)<(_+=++_)?\
           __+!+__:(___%_?__:!!_)*____(__*__,int(___/_))}$++NF=____($_)'
0 1
1 1
2 4
3 27
4 256
5 3125
6 46656
7 823543
8 16777216
9 387420489
10 10000000000
11 285311670611
12 8916100448256
13 302875106592253
14 11112006825558016

Yes this is code golfing so mine is equivalent to Tiger Woods doing 10 strokes at a par 3 in Augusta, but unlike most other entries, this one scales nicely even for extremely large inputs, AND, also being POSIX-compliant (not that it matters for golfing)

vemf, 6 3 bytes

-3 bytes thanks to language creator

┴‼*

try it online (uses 3 as example)

Explanation:

┴‼*
┴   ' do this function with the same value for both arguments
 ‼  '   repeat each element of [left] the-element-at-the-corresponding-index-of-[right] times
  * ' multiply elements of resulting list

Julia 1.0, 17 bytes

!x=prod(_->x,1:x)

Try it online!

Rattle, 8 bytes

|$+[*~]~

Try it Online!

I posted the 9-byte answer and immediately found a way to improve it. This method uses $ to swap the top of the stack with the existing value in memory (0) then increments to get 1. It otherwise follows the same logic.

Rattle, 9 bytes

|s=1[*~]~

Try it Online!

Explanation

|            parse input
 s           save input to memory
  =1         set top of stack to 1
    [  ]~    loop n times where n is the value in memory
     *~      multiply the top of the stack by the value in memory
             (print implicitly)

Nibbles, 3 2.5 bytes (6 5 nibbles)

`*^$_

Attempt This Online!

Returns the correct answer of \$1\$ for an input of \$0\$, as it is generally accepted that \$0^0=1\$ (even though this challenge doesn't require it, and several of the other answers take advantage of this and return \$0\$, or loop infinitely, for an input of \$0\$).

The ASCII representation uses ^, but in this context it's a Replicate operator, not exponentiation.

Explanation, shown with example input of 7:

`*^$_
    _     # Input coerced to a list: [7]
   $      # Input: 7
  ^       # Replicate: [7, 7, 7, 7, 7, 7, 7]
`*        # Product (returns 1 for an empty list): 823543

The builtin is just 0.5 bytes (1 nibble):

^

Attempt This Online!

Desmos, 19 17 bytes

f(x)=∏_{n=1}^xx

Try it on Desmos!

The ^ is not used for exponentation in this case.
-2 bytes thanks to Aiden Chow.

Regex 🐇 (ECMAScript+(?^*)RME), 13 bytes

^(x(?^*x+))*$

Takes its input in unary, as a string of x characters whose length represents the number. Returns its output as the number of ways the regex can match. (The rabbit emoji indicates this output method. It can yield outputs bigger than the input, and is really good at multiplying.)

Try it on replit.com

This version uses molecular lookinto, a new feature in RegexMathEngine. The basic form (?^*...) matches the expression inside it against the entire input string. (With a parameter, it evaluates it against the contents of a backreference, e.g. (?^5*...) to look into \5.)

On every iteration of the outer loop, there are \$n\$ possible matching states of the inner loop, and at the end of \$n\$ iterations, the match is complete. In a complete match, each iteration can independently be at any one of \$n\$ states, so there are \$n^n\$ total possible matches.

Changing the * at the end to + would make it give a result of \$0\$ for \$n=0\$.

^           # tail = N = input number
(
    x       # tail -= 1
    (?^*    # Non-atomic lookinto - starts with tail = N
        x+  # Create a choice between N possibilities
    )
)*$         # Loop as many times as possible, minimum 0. This will loop N times,
            # because it subtracts 1 from tail on each iteration. The minimum of
            # 0 iterations gives a correct result of 1 for N==0.

The constant-power \$n^k\$ version of this can be seen in Quartic Summation, for which there is also a method that doesn't require non-atomic lookaround. It might be impossible to implement \$n^n\$ without non-atomic lookaround, due to it being impossible to create \$m\$ number of choices (with the value \$m\$ being accessed via a backreference) without the guarantee of having \$O(m)\$ avaiable space.

The constant-base \$k^n\$ version of this would be e.g. ^((.+)*)+ or ^(x(||))*$ for \$3^n\$.

Regex 🐇 (PCRE2 v10.35+), 26 bytes

^(x((?<*(?*^x+|(?2)).)))*$

Attempt This Online!

This solution uses non-atomic recursion, lookahead, and lookbehind to emulate non-atomic variable-length lookbehind. The algorithm used is the same as that of the 13 byte version.

^                           # tail = N = input number
(
    x                       # tail -= 1
    (                       # Define subroutine (?2)
        (?<*                # Non-atomic lookbehind
            (?*             # Non-atomic lookahead
                ^           # If we've reached tail==0, then:
                x+          # create a choice between N possibilities.
            |
                (?2)        # Otherwise, recursively call (?2).
            )
            .               # tail += 1 (Go back 1 character at a time)
        )
    )
)*$                         # Loop as many times as possible, minimum 0. This
                            # will loop N times, because it subtracts 1 from
                            # tail on each iteration. The minimum of 0 iterations
                            # gives a correct result of 1 for N==0.

The equivalent in a hypothetical engine with real (not emulated) non-atomic variable-length lookbehind would be ^(x(?<*^x+.*))*$ (16 bytes).

Regex 🐇 (PCRE2 v10.35+ without lookbehind), 59 bytes

^(?=(x*)\1(x?))(((?*x+(?!\1)()?|\2+$))x(?(?=\2\1)(?4)))*\1$

Attempt This Online!

This demonstrates this to be possible without the use of lookbehind or recursion. It works by emulating operation on \$n\$ within the space of \$n/2\$, using one of those halves as a counter for the outer loop, and the other half for the inner loop.

(I wrote this version on July 29, and am finally posting it now.)

^                         # Anchor to start; tail = N = input number
(?=(x*)\1(x?))            # \1 = floor(N / 2); \2 = N % 2
(
    (                     # Define subroutine (?4):
        (?*
            x+(?!\1)      # Add \1 to possibility count
            ()?           # Double the possibility count of the above
        |
            \2+$          # If \2==1, add 1 to possibility count
        )
    )
    x                     # tail -= 1
    (?(?=\2\1)            # If tail ≥ \2 + \1:
        (?4)              # Call subroutine (?4), to multiply its possibility
                          # count with the above
    )
)*                        # For every possible iteration count, from 0 to the
                          # maximum, add the above to the possibility count
\1$                       # Assert tail == \1

Regex 🐇 (ECMAScript+(?*)RME / PCRE2 v10.35+), 81 bytes

^(?=(x*)\1(x?))((?*x+(?!\1)(|)|\2+$)x((?=\2\1)(?*x+(?!\1)(|)|\2+$)|(?!\2\1)))*\1$

Try it on replit.com - RegexMathEngine
Attempt This Online! - PCRE2 v10.40+

This is a port of the 59 byte version. Basic ECMAScript lacks not only lookbehind, but subroutine calls and conditionals as well. The only feature added to basic ECMAScript is (?*...), molecular lookahead (a.k.a. non-atomic lookahead). Note that (|) must be used instead of ()? due to ECMAScript's no-empty-optional rule.

(I wrote this version on July 29, and am finally posting it now.)

^                         # Anchor to start; tail = N = input number
(?=(x*)\1(x?))            # \1 = floor(N / 2); \2 = N % 2
(
    (?*                   # Define "subroutine":
        x+(?!\1)          # Add \1 to possibility count
        (|)               # Double the possibility count of the above
    |
        \2+$              # If \2==1, add 1 to possibility count
    )
    x                     # tail -= 1
    # Multiply the above possibility count with the following:
    (                     # Emulated conditional, upon whether tail ≥ \2 + \1
        (?=\2\1)          # If yes:
        # Call "subroutine" (duplicates it, since this regex flavor lacks
        # subroutine calls) to multiply with the above possibility count
        (?*
            x+(?!\1)
            (|)
        |
            \2+$
        )
    |
        (?!\2\1)          # If no: Use possibility multiplier of 1
    )
)*                        # For every possible iteration count, from 0 to the
                          # maximum, add the above to the possibility count
\1$                       # Assert tail == \1

Nibbles, 3 bytes (6 nibbles)

/,$*_@
/,$*_@
/           # fold from right over
 ,$         # 1..input
   *        # multiplying
     @      # result-so-far with
    _       # input

enter image description here

APL (Dyalog), 4 bytes

For xx, takes x as left argument and x as right argument.

×/⍴⍨

Try all cases online!

×/ product of

⍴⍨ arg copies arg

And here here is one that handles negative integers too:

×/|⍴|÷1⌊|×⊢

Try all cases!

×/ the product of

| absolute value

repetitions of

| the absolute value

÷ divided by

1⌊ the Lesser of 1 and

| the absolute value

× times

 the argument

The built-in Power primitive is:

x*y

Fortran (GFortran), 73 bytes

integer(selected_int_kind(32))::n
read*,n;print*,product([(n,j=1,n)]);end

Try it online!.

Uses a larger integer type because the implicit integer type overflows doing 10**10. This solution can compute results up to 170141183460469231731687303715884105727.
We make an inline anonymous array of ns : [(n,j=1,n)], take the product(), and print the result.

Thunno D, \$5\log_{256}(96)\approx\$ 4.12 bytes

ZOA*P

Attempt This Online!

Note: the built-in solution would have been just one character: ^ or @ (either would work).

Explanation

ZOA*P # Implicit input
ZO    # Wrap the input in a list
  A*  # Repeat it input times
    P # Take the product of this list
      # Implicit output 

Arturo, 16 bytes

$=>[∏@.of:<=&]

Try it

C (gcc) with -lgmp, 82 bytes

Uses GMP because everyone needs to be able to do 100**100.

#import<gmp.h>
f(x,a,y)int*a;{mpz_init_set_ui(a,y=x);for(;--y;)mpz_mul_ui(a,a,x);}

Try it online!

Aussie++, 94 bytes

Not that there's an exponentiation builtin in the first place.

THE HARD YAKKA FOR f IS(x)<I RECKON a =1;I RECKON _ IS A WALKABOUT FROM[0TO x)a =a *x;BAIL a;>

Tested in commit 9522366. All whitespace included is necessary.

Just a straightforward golf of intPow from Math.aussie.

ReRegex, 55 bytes

#import math
(_+)p(_+)_/$1*($1p$2)/p_\b//#input
p#input

I/O as Unary _'s.

Explanation

Implements exponentiation by repeating the argument itself times. This is done by transforming, for instance ____p__ into ____*(____p_). Decrementing the right, and pulling the left out. Finally, any instance of p_ has the p removed, as x^1==x.

Try it online!

FunStack alpha, 14 bytes

Product Repeat

Try it at Replit!

Explanation

        Repeat  Given one argument N, create a list of N copies of N
Product         Return the product of that list

C++ (clang), 45 bytes

int e(int x,int i=0){return++i<x?x*e(x,i):x;}

Try it online!

Vyxal, 2 bytes

ẋΠ

Try it Online!

Factor + math.unicode, 18 bytes

[ dup <array> Π ]

Try it online!

        ! 5
dup     ! 5 5
<array> ! { 5 5 5 5 5 }
Π       ! 3125

Python 2, 37 bytes

lambda x:reduce(lambda a,b:a*b,[x]*x)

For Python 3, add

from functools import reduce

Keg, 9 bytes

¿(:;|:)∑*

Try it online!

I said I'd count Keg's victories over 1+ as victories for mawp, so it's 2-1 to mawp!

Rockstar, 71 62 bytes

listen to N
X's0
P's1
while N-X
let X be+1
let P be*N-0

say P

Try it here (Code will need to be pasted in)

Rust, 26 bytes

|x|(0..x).fold(1,|a,_|a*x)

Try it online!

Java (JDK), 43+1 bytes

s->{int i=0,t=s;for(;++i<s;t*=s);return t;}

Try it online!

Overflows for 10, so all ints need to be changed to long a the cost of +1. This has been done for the TIO link.

I didn't think I could beat the IntStream though!

Google Sheets, 24

Input A1.

=DECIMAL(1&REPT(0,A1),A1

Is base conversion ok? If not, here's one at 26 (but it's really boring):

=PRODUCT(SEQUENCE(A1,1,A1,

MAWP, 40 25 22 bytes

%@![~!~1A]%1A[1A~W~]%:

-15 from Dion's improved input methods. -3 after modifying first loop to happen x+1 times.

Try it!

Explanation

%@                    Gets multi digit input
![~!~1A]%             x gets cloned x+1 times in the stack
1A[1A~W~]%:           multiplies top 2 numbers x-1 times

1+, 29 27 25 24 bytes

1."1##/"\*\1+\"/^"/<1+#:

This was already shockingly short, given how messy it is to create a halting loop... I did a poor job on stack manipulation, so it can probably be improved.

Special notes on 25 -> 24

Remember that you're programming in brainfuck. It's tempting to avoid confusion and tedium by thinking in terms of higher-level abstractions as much as possible, rather than thinking in brainfuck. This can buy enough control to make a working program, usually at the cost of such inefficiencies as: -excessive pointer movement, sometimes as simple as ">+<->" and sometimes less apparent; often a result of doing things in an intuitively appealing order. -- Daniel B. Cristofani

This applies to 1+ as well. I designed this program with pseudo-code, which results in two consecutive /s - cuz there are only three elements on the stack, replacing it with \ saves one byte.

Perl 5 + -p, 17 bytes

$_=eval"$_*"x$_.1

Try it online!

Rust, 37 bytes

|x|(|mut y|{for _ in 1..x{y*=x}y})(x)

Try it online

This might be able to be shortened once bindings_after_at stabilizes by using |mut y@x| instead.

Arn, 8 bytes

xõPÑ_=>$

Explained

Unpacked: *v{_}\1=>

    \        Fold...
*            ...with multiplication after...
v{           ...mapping with key of v...
  _          ...by replacing with input
}            End map
      1      Literal one
        =>   inclusive range to...
          _  ...input, implied

Integral, 5 Bytes

v↕♦▼e

Try it!

Explanation

v↕    Multiply two items of the stack, to be evaluated
  ♦   Swap the top two items
   ▼  Decrement
    e Evaluate ↕ that many times

Flurry, 16 bytes

<>{{}}<<>()>{}{}

Run example

$ ./flurry -nin -c "<>{{}}<<>()>{}{}" 4
256
$ ./flurry -nin -c "<>{{}}<<>()>{}{}" 5
3125

Multiply n n times to 1. The lambda expression is n (\x. \y. n (x y)) I where \y. n (x y) or n ∘ x is the product of Church numeral of n and x, and its SKIB-transformation is as follows:

n (\x. \y. n (x y)) I
S I (\n. \x. \y. n (x y)) n I
S I (\n. \x. S (K n) x) n I
S I (\n. S (K n)) n I
S I (S ∘ K) n I

So the direct translation of this expression into Flurry gives the code above.

Expanding the S in front gives n ((S ∘ K) n) I, which does not change bytes:

({})[<<>()>{}]{}

If direct exponentiation is allowed, it is 6 bytes: ({}){} (pop n, push n, pop n; evaluates to n n), because n m evaluates to m^n when n and m are Church numerals.

Pushy, 5 bytes

&tCP#

Try it online!

         \ Implicit: Input on stack                       [3]
&tC      \ Push (input - 1) extra copies of input         [3, 3, 3]
   P     \ Calculate product                              [3, 3, 3, 27]
    #    \ Output result                                  PRINT 27

x86_64 machine language for Linux, 14 11 10 bytes

0:   6a 01                   pushq  $0x1
2:   58                      pop    %rax
3:   89 f9                   mov    %edi,%ecx
5:   f7 ef                   imul   %edi
7:   e2 fc                   loop   5
9:   c3                      retq

To Try it online!, compile and run the following C program.

const char h[]="\x6a\1\x58\x89\xf9\xf7\xef\xe2\xfc\xc3";

int main(){
  for( int i = 1; i < 4; i++ ) {
    printf( "%d %d\n", i, ((int(*)())h)(i) );
  }
}

PHP, 44 bytes

<?=array_product(array_fill(1,$argn,$argn));

not the shortest solution; but it might trigger ideas for other languages.

Run as pipe with -R or try it online.

Ly, 16 bytes

ns<l1-[>l*<1-]>u

Being forced to use multiple stacks costs so many bytes...

Try it online!

J, 5 bytes

*/@$~

Try it online!

Excel VBA, 34 Bytes

Anonymous VBE immediate window function that takes input from Range [A1] and outputs [A1^A1] to the VBE immediate window

n=1:For i=1To[A1]:n=n*[A1]:Next:?n

Interesting Version, 40 Bytes

Anonymous VBE immediate window function that takes input from Range [A1] and outputs [A1^A1] by method of worksheet manipulation to the VBE immediate window

[A1].Resize([A1],1)=[A1]:?[PRODUCT(A:A)]

><>, 18 + 3 (-v flag) bytes

:l(?v:
=?v*>l1
n;>

Try it online!

-v flag to put our number on the stack allows for bigger numbers with little over head.

Explination

:l(?v:

:l(     | Copies the stack top, adds the length of the stack then compares.
   ?v:  | Checks if the compare was true,
        |  if not then copy the stack top and loop, else move down.

=?v*>l1 

    >l1 | Move the direction right, add the length of the stack, add 1 to the stack.
=?v*    | Compare the length of the stack to 1,
        |  if the stack is 1 item move down, else multiply the top 2 stack items.

n;>

n;>     | Moves the directions right, then prints the top stack item as a number then ends the program.

x86 machine code (Linux), 18 bytes

31 c0 ff c0 31 db 39 df 74 07 0f af c7 ff c3 eb f5 c3

It expects a C declaration as follows extern int XpowX(int).

Disassembled

XpowX:
  # edi : input register
  # ebx : counter
  # eax : result register
  xor  %eax, %eax    # result  = 0
  inc  %eax          # result += 1
  xor  %ebx, %ebx    # counter = 0
  loop:
    cmp  %ebx, %edi  # if (counter == input)
    je   done        #   return result
    imul %edi, %eax  # result  *= input
    inc        %ebx  # counter += 1
    jmp   loop
  done:
    ret

Common Lisp, 59 42 40 bytes

(lambda(x)(apply'*(fill(make-list x)x)))

Try it online!

Japt, 4 bytes

ÆUÃ×

Try it online!

Explanation

ÆUÃ×       // implicit: U = input integer
Uo{U} r*1  // ungolfed

Uo{ }      // create array [0, U) and map each value to...
   U       //   the input value
      r*1  // reduce with multiplication, starting at 1          
           // implicit output of result

Python, 32 bytes

f=lambda g,z=1:z>g or g*f(g,z+1)

Try it online!

Julia 0.6, 18 bytes

x->prod(x*ones(x))

05AB1E, 2 bytes

G*

Try it online!

Explanation

G*
G  # Do input - 1 times
 *  # Multiply with input

Python 2.7, 37 bytes

Full Program:

s,x=1,input();exec('s*=x;')*x;print s

Try it online!

MATLAB/Octave, 23 bytes

@(n)(prod(n*ones(n,1)))

JavaScript (ES6), 33 28 25 24 bytes

n=>g=(x=n)=>--x?n*g(x):n

Try It

f=
n=>g=(x=n)=>--x?n*g(x):n
o.innerText=f(i.value=3)()
i.oninput=_=>o.innerText=f(+i.value)()
<input id=i min=1 type=number><pre id=o>


History

25 bytes

f=(n,x=n)=>--x?n*f(n,x):n

28 bytes

n=>eval(1+("*"+n).repeat(n))

33 bytes

n=>eval(Array(n).fill(n).join`*`)

PowerShell, 36 bytes

$a="$args";$b=1;1..$a|%{$b=$b*$a};$b

Try it online!

TI-Basic (TI-84 Plus CE), 9 bytes

prod(seq(Ans,A,1,Ans

Input is from Ans, output is stored in Ans.

Run with 5:prgmNAME:Ans (5 or other input) for visual output.

Generates a list of Ans copies of Ans, then finds the product.

brainf*ck, 148 bytes

,[->+>+<<]>>[-<<+>>]++++++++[<------<------>>-]<[->>+>>+<<<<]>>[-<<+>>]>>-[-<<<<<[>[>+>+<<-]>>[<<+>>-]<<<-]>>[-<<+>>]>>>]<<<++++++++[-<<++++++>>]<<.

Try it online!

No built-ins ;)

How it works

,                                       - get ascii input
[->+>+<<]                               - duplicate input
>>[-<<+>>]                              - shift inputs left to start
++++++++[<------<------>>-]             - convert ascii into input numbers
<[->>+>>+<<<<]                          - get loop intervals (same as input #)
>>[-<<+>>]                              - shift input back again
>>-[-<<<<<[>[>+>+<<-]>>[<<+>>-]<<<-]>>  - iterated addition (multiplication)
[-<<+>>]>>>                             - Shift output back into input
]<<<++++++++[-<<++++++>>]<<.            - convert final output to ascii

In a nutshell, this works by multiplying x (the input) by itself x times. (a.k.a. iterating iterated addition). The net result is x^x.

I/O

The program takes a single ASCII input, and processes it as it's ASCII index minus 48. The minus 48 is to normalize inputs of actual numbers (4 becomes 52 -> 52-48 -> 4). To input a number higher than 9, use the next corrosponging ASCII character (: -> 58-48 -> 10). The program ouputs in a similar fashion.

Test I/O

INPUT > PROCESSED INPUT >> OUTPUT > TRANSLATED OUTPUT
1 > 1 >> 1 > 1
2 > 2 >> 4 > 4
3 > 3 >> K > 27

Since there are no printable ASCII characters after an input of 3, it can only print numbers in theory. Though, you can check all inputs do in fact work on visualizers such as this.

Haskell, 24 23 21 bytes

f y=product$y<$[1..y]

Try it online!

Pari/GP, 16 bytes

n->prod(x=1,n,n)

Try it online!

Pyth, 4

This took me a while to figure out in pyth, but I finally got there:

*F*]

Try it online.

Explanation

   ]Q     # create one-item list (of implicit input)
  *  Q    # repeat (implicit input) times
*F        # reduce list over multiplication

Pyth, 9 bytes

u*GH*]QQ1

Try it online!

Standard ML, 42 bytes

fn x=>foldl op*1(List.tabulate(x,fn y=>x))

Try it online!

Explanation:

fn y => x                 (* An anonymous function that always returns the inputted value *)
List.tabulate(x, fn y=>x) (* Create a list of size x where each item is x *)
foldl op* 1               (* Compute the product of the entire list *)    

Java 9 JShell, 44 bytes

x->IntStream.range(0,x).reduce(1,(a,b)->a*x)

Try it online!

Notes:

05AB1E, 3 bytes

.DP

Try it online! or Try all examples

.D  # pop a,b    push b copies of a 
    # 05AB1E implicitly takes from input if there aren't enough values on the stack
    # For input 5, this gives us the array: [5,5,5,5,5]
  P # Take the product of that array
    # Implicit print

Scala, 32 26 bytes

n=>List.fill(n)(n).product

Try it online! (Added conversion to long in the TIO so it wouldn't overflow on n=10.)

MacOS Bash, 18

jot -s* -b$1 $1|bc

Try it online.

Also runs on Linux if you install the jot utility:

sudo apt install athena-jot

Stacked, 10 bytes

{!1[n*]n*}

Try it online!

Two-argument exponentiation for the same size:

{%1[x*]y*}

Both are functions. Repeats a function that multiplies 1 by n n times.

Aceto, 33 bytes

We have quite a bit of wasted space, so I'm sure we could get rid of a few more bytes.

=|
0*v
ds<

 MDL
 &_d
id!L
rDM@xp

The bottom half (except for the xp) reads the input, and puts it that many times on the stack, as an integer, i.e. '3' -> [3, 3, 3]. I really need a builtin for that..

The top half calculates the product by swapping the top two elements, checking if the top element is zero, otherwise multiplying the top two elements, and so on. xp prints.

PHP, 38 Bytes

for($p=1;$i++<$argn;)$p*=$argn;echo$p;

Try it online!

Retina, 49 46 bytes

Golfed 3 bytes thanks to @Neil

.+
1;$&$*1;$&$*1
{`1(?=1*;(1+);.)
$1
}`1$

\G1

Try it online!

Supports positive integers just as stated in the challenge.

Brain-Flak, 76 bytes

(({})){({}<(({}))>[()])}{}{{}({}<>)({<({}[()])><>({})<>}{}<><{}>)([][()])}{}

Try it online!

This is an extremely inefficient algorithm, so don't try inputs larger than 7.

Explanation:

#Duplicate the input
(({}))

#Make *n* copies of the input
{({}<(({}))>[()])}{}

#While the stack has more than one element on it,
{{}

  #Multiply the top two elements
  ({}<>)({<({}[()])><>({})<>}{}<><{}>)

  #Push stack-height minus one to keep the loop running
  ([][()])

#Endwhile
}

#Pop a zero off the main stack, implicitly display the number left on the stack
{}

S.I.L.O.S, 56 bytes

readIO
x=i
readIO
a=i
b=1
lbla
a-1
b*x
if a a
printInt b

Try it online! Loops through repeated multiplication.

R, 22 bytes

reads x from stdin.

prod(rep(x<-scan(),x))

generates a list of x copies of x, then computes the product of the elements of that list. When x=0, the rep returns numeric(0), which is a numeric vector of length 0, but the prod of that is 1, so 0^0=1 by this method, which is consistent with R's builtin exponentiation, so that's pretty neat.

Try it online!

Alice, 13 bytes

/o
\i@/.&.t&*

Try it online!

Explanation

/o
\i@/...

This is a framework for programs that read and write decimal integers and operate entirely in Cardinal mode (so programs for most arithmetic problems).

.    Duplicate n.
&.   Make n copies of n.
t    Decrement the top copy to n-1.
&*   Multiply the top two values on the stack n-1 times, computing n^n.

Ruby, 20 18 bytes

-2 bytes because the spec changed and I no longer need an exponent argument.

->x{eval [x]*x*?*}

Try it online!

Batch, 58 bytes

@set n=1
@for /l %%i in (1,1,%1)do @set/an*=%1
@echo %n%

Only works for single-digit inputs due to 32-bit arithmetic.

Pure bash, 43

echo $[$1<2?1:$[$1<2?2:$1]#`printf 1%0$1d`]

Try it online.

Not sure if this is bending the rules too much - I'm not using any of the listed banned builtins, but I am using base conversion.

Maximum input is 15, because bash uses signed 64-bit integers (up to 231-1).

Cubix, 19 bytes

..@OI:1*s;pu!vqW|($

Try it online!

Step by Step

Expands out onto a cube with side length 2

    . .
    @ O
I : 1 * s ; p u
! v q W | ( $ .
    . .
    . .

Groovy, 24 bytes

{a->r=1;a.times{r*=a};r}

dc, 24 23 26 22 bytes

This is my first attempt writing a recursive macro in dc. I am sure it is a sub-optimal solution which can be improved a lot.

dsr1+[lrr1-d1<F*]dsFxp

Try it online!

Edit: Thanks eush77! -4 bytes.

Röda, 17 bytes

{product([_]*_1)}

Try it online!

It's an anonymous function that takes it's input from the stream.

Explanation:

{product([_]*_1)}
{               } /* An anonymous function */
         [_]      /* An array containing the input value */
            *_1   /* repeated times the input value */
 product(      )  /* Product of all values in the array */

Clojure, 22

#(apply *(repeat % %))

:)

Python, 51 bytes

def f(x,i=0):i=i or x;return x*f(x,i-1)if i>1else x

A little bit more verbose than @xnor's clever way of eval, but uses recursion

Fourier, 19 bytes

1~YI~X(Y*X~Yi^~i)Yo

Try it on FourIDE!

Multiplies Y by the input X number of times and then outputs Y.

FYI, the standard way to do this would be

I~XPXo

Where P is the power function

CJam, 6 bytes

ri_m*,

Try it online!

ri       e# Read integer
  _      e# Duplicate
   m*    e# Cartesian power. The first argument is interpreted as a range
     ,   e# Number of elements. Implicitly display

MATL, 5 bytes

lyX"p

Try it online!

Explanation

Example values with input 4.

l    % Push 1
     % STACK: 1
y    % Implicit input. Duplicate from below
     % STACK: 4, 1, 4
X"   % Replicate along two dimensions. Gives a row vector
     % STACK: [4, 4, 4, 4]
p    % Product of array. Implicitly display.
     % STACK: 256

Perl 6, 13 bytes

{[*] $_ xx$_}

$_ xx $_ evaluates to a list of $_ copies of $_ ($_ being the argument to the anonymous function), and then [*] reduces that list with multiplication.

C (gcc), 34 bytes

i,k;f(x){for(i=k=x;--i;)x*=k;i=x;}

Try it online!

PowerShell, 34 33 bytes

,$n,$p=$args,1;1..$n|%{$p*=$n};$p

Try it online!

Previous version

,$n,$ofs=$args,'*';''+@($n)*$n|iex

CJam, 7 bytes

ri_a*:*

Try it online!

Explanation

ri       e# Read an int from input
  _      e# Duplicate it
   a*    e# Put the copy in the array and repeat it that many times
     :*  e# Take the product of the array

Mathematica, 16 bytes

I've got two solutions at this byte count:

1##&@@#~Table~#&

Here, #~Table~# creates a list of n copies of n. Then the List head is replaced by 1##& which multiplies all its arguments together.

Nest[n#&,1,n=#]&

This simply stores the input in n and then multiplies 1 by n, n times.

QBIC, 12 bytes

:[a|q=q*a}?q

Explanation:

:   Get the integer
[a|     Start a FOR loop, for x iterations
q=q*a   Multiply q (starts out as 1) by our value, then store that in q
}       End loop
?q      Print q

Brachylog, 6 bytes

g;?j₎×

Try it online!

Explanation

          Example input: 5
g         Group: [5]
 ;?       Pair with the Input: [[5], 5]
   j₎     Juxtapose [5] 5 times: [5, 5, 5, 5, 5]
     ×    Multiply

Jelly, 3 bytes

ẋ⁸P

Try it online!

How?

ẋ⁸P - Main link: x             e.g. 4
 ⁸  - link's left argument, x       4
ẋ   - repeat left right times       [4,4,4,4]
  P - product                       256

Python, 25 bytes

lambda n:eval('1'+'*n'*n)

Try it online!