[Question]
  [
Here's a simple challenge, so hopefully lots of languages will be able to participate.
Given a positive integer \$n\$, output \$A076039(n)\$ from the [OEIS](http://oeis.org/A076039).
That is, start with \$a(1)=1\$. Then for \$n>1\$:
$$a(n)=\left\{ \begin{array}{ll} n\cdot a(n-1), & \text{if } n>a(n-1) \\ \lfloor a(n-1)/n \rfloor, & \text{otherwise.}\end{array} \\ \right. $$
### Test cases:
```
1 -> 1
2 -> 2 (2 > 1, so multiply)
3 -> 6 (3 > 2, so multiply)
4 -> 1 (4 < 6, so divide and take the integer part)
5 -> 5 
6 -> 30
17 -> 221
99 -> 12
314 -> 26
```
More test cases can be found on the OEIS page.
Per usual [sequence](/questions/tagged/sequence "show questions tagged 'sequence'") rules, you can input and output in a generally accepted manner: 1- or 0-based indexing, output an infinite sequence, output the first \$n\$ values, output only the \$n^\text{th}\$ value, and so forth, but specify that in your answer.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest code in bytes in each language wins!
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 6 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
R×:<?/
```
A monadic Link accepting a positive integer, \$n\$, which yields a positive integer, \$a(n)\$.
**[Try it online!](https://tio.run/##y0rNyan8/z/o8HQrG3v9////GxuaAAA "Jelly – Try It Online")** Or see the [test-suite](https://tio.run/##y0rNyan8/z/o8HQrG3v9/0f3HG5/1LTG/f//aEMdBSMdBWMdBRMdBVMdBTMdBUNzHQVLS6CYoUksAA "Jelly – Try It Online").
### How?
```
R×:<?/ - Link:
R      - range -> [1..n]
     / - reduce by (i.e. evaluate f(f(...f(f(f(1,2),3),4),...),n) with this f(a,b):
    ?  -   if...
   <   -   ...condition: (a) less than (b)?
 ×     -   ...then: multiply -> a×b
  :    -   ...else: integer divide -> a//b
```
---
Output the sequence up to \$a(n)\$ with:
```
R×:<?\
```
[Answer]
# Scratch 3.0, ~~29~~ 27 blocks/~~234~~ 167 bytes
[![enter image description here](https://i.stack.imgur.com/WvLEx.png)](https://i.stack.imgur.com/WvLEx.png)
As SB Syntax:
```
define f(n)
if<(n)=(1)>then
add(1)to[v v
else
f((n)-(1
set[d v]to(item(length of[v v])of[v v
if<(n)>(d)>then
add((n)*(d))to[v v
else
add([floor v] of ((n)/(d)))to[v v]
end
end
when gf clicked
delete all of [v v
ask()and wait
f(answer)
```
[Try it on scratch](https://scratch.mit.edu/projects/454951272/)
I'm a little unsure of some input/output methods, so I thought I'd be safe and just make it a full program with a helper function.
Answering this allowed my account to be promoted from "new" to "standard", so that's always fun.
*-67 bytes thanks to @att*
[Answer]
# [Shakespeare Programming Language](https://github.com/TryItOnline/spl), 221 bytes
```
,.Ajax,.Puck,.
Act I:.Scene I:.[Enter Ajax and Puck]
Ajax:You cat.
Scene V:.
Puck:You is the sum ofYou a cat.
Ajax:Open heart.Is I nicer you?If notYou is the quotient betweenyou I.
      If soYou is the product ofyou I.Let usScene V.
```
[Try it online!](https://tio.run/##TY7NCsIwEIRfZR6g5AF6EQ8eAoKCIIh4iOmW1p/d2mxQnz4mtYfeZme/GSYMj5Qqs765T2X20d@z9gpbm4MnpiLOG1YaURA4blCoS7nqk0R4pzN6rKeCye0DtCOE@IS0xXATOKV2AzE6cqMaG2DBvc/1X4kr24JFF/lXFO2JFVfSNxFnCNZkLMiCGkZpYh4t7f@/JUUM8yiT0g8 "Shakespeare Programming Language – Try It Online")
Outputs the infinite list. Note however that there is no separator between the output values, so the output is somewhat difficult to read.
My best attempt at adding a separator (a null byte) comes down as
# [Shakespeare Programming Language](https://github.com/TryItOnline/spl), 297 bytes
```
,.Ajax,.Puck,.Page,.
Act I:.Scene I:.
[Enter Ajax and Puck]
Ajax:You cat.
Scene V:.[Exit Puck][Enter Page]
Ajax:Speak thy.
Page:You is the sum ofYou a cat.
Scene X:.[Exit Page][Enter Puck]
Ajax:Open heart.Is I nicer you?If notYou is the quotient betweenyou I.
      If soYou is the product ofyou I.Let usScene V.
```
[Try it online!](https://tio.run/##TY/NCsIwDIBfJQ8w@gC7iAcPBUFhIIp4qF3m5rSpa4rb09d2m2OXkJ8vX4izrxAysX2qPhNHr9sY1QNjRzPIXBQaDabkujOMHSQQlCkhsbdU5RfyoBXP6CmhfcMTMG8l5QQXFlULXA/jmXG3cbFGcP4NVKWGWunOiy4p/rrl9sGigRpVx0I6kGAaHecD@Y2swBCv/B9P3KBhuCN/EU2EQIqIOVpRtqPSx9epmuZ7ZPBufk2E8AM "Shakespeare Programming Language – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), ~~47~~ ~~43~~ 39 bytes
Saved 4 bytes thanks to [xnor](https://codegolf.stackexchange.com/users/20260/xnor)!!!  
Saved 4 bytes thanks to [Neil](https://codegolf.stackexchange.com/users/17602/neil)!!!
```
r=i=1
while 1:r=r/i or r*i;print r;i+=1
```
[Try it online!](https://tio.run/##K6gsycjPM/r/v8g209aQqzwjMydVwdCqyLZIP1Mhv0ihSCvTuqAoM69Eocg6U9vW8P9/AA "Python 2 – Try It Online")
Prints \$\{a(n)\mid n \in \mathbb{N}\}\$ as an infinite sequence.
[Answer]
# [R](https://www.r-project.org/), ~~43~~ 39 bytes
-4 bytes thanks to Giuseppe.
```
for(i in 1:scan())T=T%/%i^(2*(i<T)-1);T
```
[Try it online!](https://tio.run/##K/r/Py2/SCNTITNPwdCqODkxT0NTM8Q2RFVfNTNOw0hLI9MmRFPXUNM65L@xocl/AA "R – Try It Online")
Outputs the \$n\$th term, 1-indexed.
Initializing the sequence with \$a(0)=1\$ also works, as the formula then gives \$a(1)=1\$ as desired. The variable `T` is coerced to the integer `1`, and we apply repeatedly a more compact version of the formula:
$$a(n)=\left\lfloor \frac{a(n-1)}{n^{2\mathbb{I\_{n<a(n-1)}} -1}}\right\rfloor $$
(with \$\mathbb I\$ the indicator function). This covers both cases of the original definition.
[Answer]
# [Haskell](https://www.haskell.org/), 40 bytes
```
a#n|n>a=a*n|1>0=a`div`n
a=scanl1(#)[1..]
```
[Try it online!](https://tio.run/##HcuxDoIwFAXQ3a94gQWsELvbfoFOjoTIjZrQWK6NRUlI/70mjGc4I@Lr6X3OKJloYbBn0vZoMDzcb@AOJt5Br6uy7nTb9nmCoxiZEC43Cd/5On/OlC6O70WoVCGNlUKpzUgVD6hPzerCttHnPw "Haskell – Try It Online")
* Outputs infinite sequence.
Infix operator # computes next term, we use it to fold all positive integers [1..] but using scanl1 instead which gives us all steps.
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 18 bytes (SBCS)
```
{⍺>⍵:⍺×⍵⋄⌊⍵÷⍺}/⌽ö⍳
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT/9/eNujtgnVj3p3gdFWCKr9DxKxA7KsgPTh6SDR7pZHPV1AxuHtQKFa/Uc9e4Faezf/TwPqf9Tb96ir@dB640dtEx/1TQ0OcgaSIR6ewf/TDq0AKjIDAA "APL (Dyalog Unicode) – Try It Online")
A barely-golfed but safe function that outputs the nth element of the sequence.
---
# [APL (Dyalog Unicode)](https://www.dyalog.com/), ~~15~~ 14 bytes (SBCS)
*Saved 1 byte thanks to @[Adám](https://codegolf.stackexchange.com/users/43319/ad%c3%a1m)*
```
(⌊⊢×⊣*∘×-)/⌽ö⍳
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT/9/eNujtgnVj3p3gdFWCKr9r/Gop@tR16LD0x91LdZ61DHj8HRdTf1HPXuByns3/08D6nnU2/eoq/nQeuNHbRMf9U0NDnIGkiEensH/0w6tACoyAwA "APL (Dyalog Unicode) – Try It Online")
Outputs the nth element of the sequence. I just realized that this won't work if \$n = a(n-1)\$ because it raises n to the power of \$n - a(n-1)\$ and multiplies that by \$a\$, although [as far as I can tell](https://tio.run/##SyzI0U2pTMzJT/9/eNujtgnVj3p3gdFWCKr9DxKxBbKsHvVNBSpQd8lPLVbIyy9RKM8vylZ/1N0ClNd41NP1qGvR4emPuhZrPeqYcXi6riZIs/6jnr1AY3s3/08Dan3U2/eoq/nQeuNHbROBhgUHOQPJEA/P4P9pCoYGQAAA), this function works until at least n=2,000,000.
```
(⌊⊢×⊣*∘×-)/⌽ö⍳
              ⍳  ⍝ Make a range to n
           ⌽ö   ⍝ Then reverse it and
(⌊⊢×⊣*∘×-)/      ⍝ reduce it with a train:
   ×             ⍝ Multiply
  ⊢             ⍝ a(n-1) with
    ⊣           ⍝ n
     *∘×        ⍝ to the power of the sign of
        -       ⍝ n - a(n-1)
⌊                ⍝ Floor it
```
[Answer]
# [Forth (gforth)](http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/), 82 bytes
```
: f 2dup 2dup > if * else swap / then dup . swap drop swap 1+ swap recurse ;
1 1 f
```
[Try it online!](https://tio.run/##S8svKsnQTU8DUf//WymkKRillBZACDuFzDQFLYXUnOJUheLyxAIFfYWSjNQ8BZCcHkQkpSi/AMIy1IbQRanJpUVADdZchgqGCmn//wMA "Forth (gforth) – Try It Online")
Outputs an infinite sequence, separated by spaces.
[Answer]
# [Python 3.8+](https://docs.python.org/3.8/), ~~45~~ 39 bytes
-2 thanks to [xnor](https://codegolf.stackexchange.com/users/20260) (`while print(...)!=0:` → `while[print(...)]:`)  
-4 thanks to [Neil](https://codegolf.stackexchange.com/users/17602/neil) (`[a*n,a//n][a>n]` → `a//n or a*n`)
```
a=n=1
while[print(a:=a//n or a*n)]:n+=1
```
A full program which prints \$a(n)\$ for all natural numbers.
**[Try it online!](https://tio.run/##K6gsycjPM7YoKPr/P9E2z9aQqzwjMyc1uqAoM69EI9HKNlFfP08hv0ghUStPM9YqT9vW8P9/AA "Python 3.8 – Try It Online")**
---
As a recursive function, 49:
```
f=lambda v,n=1,a=1:a*(v<n)or f(v,n+1,a//n or a*n)
```
[Answer]
# [R](https://www.r-project.org/), 41 bytes
```
for(m in 1:scan())T=`if`(m>T,T*m,T%/%m);T
```
[Try it online!](https://tio.run/##dc3RCsIgFIDh@/MUB2KgIYQUhRvrKbzfxClJU4e6IKJnt26CIHqA//tTrTYm4tEF5G3WKhBKZT86OxJ/lkxuPZPNrvG0k1UIgA1OxrpgUGVUaNegi4sBS0R9MfqKxeSCWmWTW0ieSAp@nYtb5vsQ0zC5m5tM/8lIoA/4@od/a3gCZLW8FaIJb4@Mn5gQbM8PlP36tL4A "R – Try It Online")
Forced myself not to look at [Robin Ryder's R answer](https://codegolf.stackexchange.com/a/215618/95126) before having a go at this. Happily we came up with different approaches to each other, although ~~both seem (so far) to be exactly the same length in bytes~~ sadly for me his one is now 2 bytes shorter...
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 35 bytes
Takes a 1-based starting index and returns the nth sequence value.
```
f(i,j){i=i?i>(j=f(i-1))?j*i:j/i:1;}
```
[Try it online!](https://tio.run/##HY1BDoIwFET3/xQ/GExrQK2gBip4ETektfgJFgOoC8LVrdXdzLyXjIprpZwzjKKGT1TQmUrWFL7HgvNzs6K82VAu5OwWZFX71Fc8DaOmbn0rAciOeK/IsldHmuMEiL@JJPhkup5JHFRlDQtCHUS4JF5uJfcM8dF78w@wKDHUF@sFitBfcy5hdgJ2kEAKeziAOEKWQSLSjzJtVQ8ufn8B "C (gcc) – Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/) `-Minteger` `-061`, ~~36~~, 27 bytes
-9 bytes thanks to @Abigail and @Sisyphus.
outputs an infinite sequence
```
say$/while$/=$//++$i||$/*$i
```
[Try it online!](https://tio.run/##K0gtyjH9/784sVJFvzwjMydVRd9WRV9fW1sls6ZGRV9LJfP//3/5BSWZ@XnF/3V9M/NKUtNTi4AsUz0Dw/@6BmaGAA "Perl 5 – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~38~~ 35 bytes
*Saved 3 bytes thanks to @Neil*
Returns the \$n\$-th term, 1-indexed.
```
f=(n,k=i=1n)=>i++<n?f(n,k/i||k*i):k
```
[Try it online!](https://tio.run/##FYzLDoIwEADvfMUeOHStj5AYD8LKr9AgNWvJrgHjpfTbS71NJpN5u59bx4U/35Poc8rZk5FjIKZGkB5sbSe9/6sLb1s4MN5D9roYAYKmBYGO4HYtYC1CrABGlVXn6TzrywzO1FESlraO5YJpwLZKeQc "JavaScript (Node.js) – Try It Online")
[Answer]
# [Factor](https://factorcode.org/), 45 bytes
```
[ [1,b] 1 [ 2dup < [ * ] [ /i ] if ] reduce ]
```
[Try it online!](https://tio.run/##NY4xTwJBEIX7@xVPEhoj6IIJAYytoaEhVucV4@4ctwH21tnZghB/@7letPnem8mbvGnJai/D@2G3f9uAROia0PZyIVUfjjixBD6jjN2IuVA4ckLir8zBFheFVa9RfFBsq91@g2SF1HZVdQflpPAhZk2VeUJtHj4b3GBWWK@xNM/4BsXIwcHlONR/AYMai7LASzH3aAoffRHfFgi7bBnNcKH439BnHStqTKZLh9krpu4jTDB@9Xu0YLId7JlJhh8 "Factor – Try It Online")
Straightforward reduction. Takes 1-based index and returns the n-th term.
```
[                         ! anonymous lambda
  [1,b] 1 [ ... ] reduce  ! reduce {1..n} by the following, starting with 1:
    2dup <                !   ( an n -- an n an<n)
    [ * ] [ /i ] if       !   ( a_n+1 ) multiply if an < n, int-divide otherwise
]
```
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), ~~22~~ 20 bytes
```
{_x*(1%y;y)y>x}/1+!:
```
[Try it online!](https://tio.run/##y9bNz/7/P82qOr5CS8NQtdK6UrPSrqJW31Bb0ep/mrqhgpGCsYKJgqmCmYKhuYKlpYKxocl/AA "K (oK) – Try It Online")
Rather than using `$[y>x;y;1%y]`, indexes into the list `(1%y;y)` using the boolean condition `y>x` to save a couple bytes.
[Answer]
# [Husk](https://github.com/barbuz/Husk), 11 bytes
```
Fμ?*`÷<¹³)ḣ
```
[Try it online!](https://tio.run/##ATUAyv9odXNr/23igoH/Rs68Pypgw7c8wrnCsynhuKP///9bMSwyLDMsNCw1LDYsMTcsOTksMzE0XQ "Husk – Try It Online")
```
F               # Fold a function over
          ḣ     # sequence from 1..input;
 μ?*`÷<¹³)      # function with 2 arguments:
  ?             # if
      <¹³       # arg 2 is smaller than arg 1
   *            # arg 1 times arg 2
    `÷          # else arg 1 integer divided by arg 2
```
[Answer]
# [Perl 5](https://www.perl.org/) `-Minteger -p`, 35 bytes
```
map$.=$_>$.?$.*$_:$./$_,2..$_;$_=$.
```
[Try it online!](https://tio.run/##BcFRCoAgEAXAy7yvyBcFERTWCTzD0oeEULqY52@b0Vjv2ew5FfSQHTzADrKCA6SfSMgG8aDZuHxFWyr5NRdSbvGK1Zz@ "Perl 5 – Try It Online")
Takes `n` as input and prints the `n``th` item in the list.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~12~~ 10 bytes
Prints the infinite sequence.
```
λN>₁N›i÷ë*
```
[Try it online!](https://tio.run/##yy9OTMpM/f//3G4/u0dNjX6PGnZlHt5@eLXW//8A "05AB1E – Try It Online")
**Commented**:
```
λ              # infinite list generation
               # implicitly push a(n-1) (initially 1)
 N>            # push n, since N is 0-indexed, this needs to be incremented
   ₁N›         # is a(n-1) > n-1?
      i÷       # if this is true, integer divide a(n-1) by n
        ë*     # else multiply a(n-1) and n
```
[Answer]
# [Forth (gforth)](http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/), 51 bytes
```
: f 1+ 1 tuck ?do i 2dup <= if * else / then loop ;
```
[Try it online!](https://tio.run/##FYxLDoIwFEXnXcUJQw01BT9BUBcDrRAJbUpZf30dnNyb3I/zMc311xXJ@YnDnDGkY/zxmTwLzXQEhheL44Rdd8uFNNuN1ftAL5tAqbToiK6gflPJj2aM9MoQVCO0wlW4CXeZKPMQ13UlMhLkPw "Forth (gforth) – Try It Online")
### Code Explanation
```
: f        \ start word definition
  1+       \ add 1 to n
  1 tuck   \ set up accumulator and loop parameters
  ?do      \ loop from 1 to n (if n > 1)
    i 2dup \ set up top two stack values and duplicate 
    <= if  \ if a(n-1) <= n
      *    \ multiply
    else   \ otherwise
      /    \ divide
    then   \ end if
  loop     \ end loop
;          \ end word definition
```
[Answer]
# [Java (JDK)](http://jdk.java.net/), 52 bytes
```
n->{int i,a=i=1;for(;i++<n;)a=i>a?i*a:a/i;return a;}
```
[Try it online!](https://tio.run/##ZU67DoJAEOz5ii3BxxkqE0@wM7GwsjQWKwJZPBdyt0diCN@Op6Fzm5nMTHamwR7XzeM5df5uqIDCoHNwRmIYIoBZdYISoAlh5YWMqjwXQi2r40z2J5ayLu0KZpJDBdnE63wgFqAVZpSlumptrGm53LNOgpLjgRa4ww1pW4q3DKjHCcLpUP7X37f0gFfYFl/EEtfXG6CtXfKbCnB5OylfqvWiumCL4bhS2HXmHafbJPm@HKNx@gA "Java (JDK) – Try It Online")
Note: Thanks @RedwolfPrograms for -1 Byte and @user for -10(?) bytes.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 11 bytes
```
1’ß×:>@?$Ị?
```
[Try it online!](https://tio.run/##ATEAzv9qZWxsef//MeKAmcOfw5c6PkA/JOG7ij//MTBSOzE3LDk5LDMxNCA7w4ck4oKsIEf/ "Jelly – Try It Online")
## How it works
```
1’ß×:>@?$Ị? - Main link f(n). Takes n on the left
          ? - If statement:
         Ị  -   If: n ≤ 1
1           -   Then: Yield 1
        $   -   Else:
 ’          -     n-1
  ß         -     f(n-1)
       ?    -     If statement:
     >@     -       If: n > f(n-1)
   ×        -       Then: n × f(n-1)
    :       -       Else: n : f(n-1)
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 10 bytes
```
⟦₁{÷ℕ₁|×}ˡ
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/pfXa6koGunoFRu/6htw6Ompoe7Omsfbp3w/9H8ZY@aGqsPb3/UMhXIqDk8vfb0wv//ow11jHSMdUx0THXMdAzNdSwtdYwNTWIB "Brachylog – Try It Online")
Gives the singleton list `[1]` instead of `1` for n = 1, but nothing out of the ordinary otherwise.
```
         ˡ    Reduce
⟦₁            1 .. n
  {     }     by:
   ÷          integer division
    ℕ₁        if the result is 1 or greater,
      |×      multiplication if not.
```
[Answer]
# [Gaia](https://github.com/splcurran/Gaia), 9 bytes
```
┅⟪<₌×/?⟫⊢
```
[Try it online!](https://tio.run/##AR0A4v9nYWlh///ilIXin6o84oKMw5cvP@Kfq@KKov//MQ "Gaia – Try It Online")
Basically the same as the shorter Jelly answer. 1-indexed, prints `a(n)`, although `⊢` could be swapped with `⊣` to get the first `n` elements instead.
```
		# implicit input n
┅		# push 1...n
 ⟪      ⟫⊢	# reduce the list by the following function:
  <₌		# push an extra copy of a(i-1) and i and check if less than?
    × ?		# if true, then multiply
     /		# else integer divide
		# implicitly print top of stack
```
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), 58 bytes
```
K`_ _
"$+"+L$`(^_+|_)(?<=(\1)+) (\1)+
_$`$1 $#3*$#2*
r`_\G
```
[Try it online!](https://tio.run/##K0otycxLNPz/3zshXiGeS0lFW0nbRyVBIy5euyZeU8PexlYjxlBTW1MBTHHFqySoGCqoKBtrqSgbaXEVJcTHuP//b2kJAA "Retina – Try It Online") No test suite because of the way the script uses history. Explanation:
```
K`_ _
```
Replace the input with a pair of 1s (in unary). The first is the loop index while the second is the output.
```
"$+"+
```
Loop `n` times.
```
L$`(^_+|_)(?<=(\1)+) (\1)+
```
Divide both the output and the loop index by the loop index, or by 1 if the division would be zero.
```
_$`$1 $#3*$#2*
```
Increment the loop index and multiply the two quotients together. This results in `output/index*index/index` or `output/1*index/1` respectively.
```
r`_\G
```
Convert the final output to decimal.
[Answer]
# [PHP](https://php.net/), 57 bytes
```
function a($n){return$n?($n>$x=a($n-1))?$x*$n:$x/$n|0:1;}
```
[Try it online!](https://tio.run/##TY5Ba4NAEIXv/opHGNAtW5o1TUq0RnJIaSBQwWNbyiIGe1lFN2BI8tvNji0hl@GbN@/NTFM1w2vauLo/mML@1gY6ICNObWkPrSGTum5FfcLqoxIipf6BTET9E5nzNFLxZSBbdrZDgk8PUEhWUNJRyBQyzZgWTM@36ZxpLuFwwTibsqpexlA4WpbL0f23Qo3R0G35jj1vX7elLqoA/7d1BzJsoCMETi5QFlXtNInJl51IkHb/6YBd4l5LOJHCz9Z57iOC/7be7nyJ7D372XzsYu8yXAE "PHP – Try It Online")
[Answer]
# [cQuents](https://github.com/stestoltz/cQuents), 14 bytes
```
=1:$>Z?$Z:Z_/$
```
[Try it online!](https://tio.run/##Sy4sTc0rKf7/39bQSsUuyl4lyioqXl/l/39DcwA "cQuents – Try It Online")
## Explanation
```
=1             first term is 1
  :            mode sequence: given n, output nth term; otherwise, output indefinitely
               each term equals:
   $>Z?  :     if n > seq(n - 1)                else
       $Z                        n * seq(n - 1)
          Z_/$                                       seq(n - 1) // n
```
[Answer]
# [Racket](https://racket-lang.org/), 66 bytes
```
(λ(n)(foldl(λ(x y)((if(< y x)* quotient)y x))1(range 1(+ 1 n))))
```
[Try it online!](https://tio.run/##NYxBCsIwFET3OcVQF/6vuPgoiCBeRF0Em0iw/NYQod30Yt7BK8W06FvNwMyL9vZwKS8aq3fEuRiqnQ/q4DN93qRMvm3qZso9BiYKno4Y0PMKz1ebgtPEU2WhWDQOQmsIlAuZTblH0FlBtuuc1v8RRNjgx5Jkj8MBW9kxXxkG1MWgyaMaLTYnjPaiFYrEz@L8BQ "Racket – Try It Online")
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 40 bytes
```
a@1=1;a@n_:=If[#<n,n#,⌊#/n⌋]&@a[n-1]
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78/z/RwdDW0DrRIS/eytYzLVrZJk8nT1nnUU@Xsn7eo57uWDWHxOg8XcPY/wFFmXklCvoOifoO1YY6RjrGOiY6pjpmOobmOpaWOsaGJrX//wMA "Wolfram Language (Mathematica) – Try It Online")
-2 bytes from @att
[Answer]
# [J](http://jsoftware.com/), 21 bytes
```
[:(]<.@*[^*@-)/1+i.@-
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/o600Ym30HLSi47QcdDX1DbUz9Rx0/2tyKXClJmfkK2hYp2kqaWsYmitYWioYG5po6tSBlJj9BwA "J – Try It Online")
A [J](http://jsoftware.com/) port of @user 's [APL solution](https://codegolf.stackexchange.com/a/215615/75681) - don't forget to upvote it!
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf/blob/master/math_golf.txt), ~~11~~ 9 [bytes](https://github.com/maxbergmark/mathgolf/blob/master/code_page.py)
```
1k{î`<¿*/
```
-2 bytes thanks to *@ovs*.
Outputs the \$n^{th}\$ value.
[Try it online.](https://tio.run/##y00syUjPz0n7/98wu/rwugSbQ/u19IEcLiMuYy4TLlMuMy5Dcy5LSy5jQxMA)
**Explanation:**
```
1         # Push 1
 k{       # Loop the input amount of times:
   î      #  Push the 1-based loop index
    `     #  Duplicate the top two items
     <¿   #  If the current value is smaller than the 1-based loop index: a(n-1)<n:
       *  #   Multiply the value by the 1-based loop index
          #  Else:
       /  #   Integer-divide instead
          # (after the loop, the entire stack joined together is output implicitly)
```
]