text:
Find the nth digit of Euler's number
Challenge
Given a positive integer n, you must calculate the nth digit of \$e\$, where \$e\$ is Euler's number (2.71828...).
The format of the output can be a number or a string (e.g., 3 or '3')
Example
# e = 2.71828...

nthDigit(3) => 8
nthDigit(1) => 7
nthDigit(4) => 2

Shortest code wins.

Language like "You cannot use any external libraries or constants" is not up to our standards of clarity on this site.  The best way to fix this problem is to remove the restriction, since it doesn't do anything good for your challenge in the first place.

Ok, thanks for the tip! I will keep that in mind for future questions. I would remove the restriction, but the purpose was so that people can't just say something like str(np.e)[:index+1], which would be too easy.

@applemonkey496 It doesn't solve the challenge anyway because a floating-point number doesn't have infinite precision (the output can't be right after 15 digits or so).

Is there an upper bound on $n$ for this challenge?

Even with arbitrary precision, it's not straightforward to get the n-th digit, because it may have been rounded up. For example, e with 4-decimal precision would give you 2.7183, but actually the 4-th decimal is 2, not 3

How I would exploit the rules: push 0, implicit output. Outputs any digit of e rounded to the thousands.

@Wezl  What language is that?

@MitchellSpector It would probably work for 05AB1E for 1 byte but it's just pseudocode.

@Bubbler, good point. I removed the constraint.

05AB1E, 4 bytes
žtsè

Pretty convenient builtin ¯\_(ツ)_/¯
Try it online or verify the first ten digits or output the infinite list of digits.
Explanation:
žt    # Push the infinite list of decimal value of e (including leading 2)
  sè  # And 0-based index the input-integer into it
      # (after which the result is output implicitly)

Python 2, 34 32 bytes
Solution provided by @l4m2
-2 bytes thanks to @xnor
lambda n:`(100**n+1)**100**n`[n]

Try it online!
Very,  very slow.
Verification up to \$166\$ digits. The idea for this verification comes from @l4m2: calculates \$x^{100^n}\$ by calculating x=x**10 repeatedly (\$2n\$ times), each time truncating \$x\$ to a few left most digits (the TIO link uses \$500\$ digits). By changing the truncation to round down or up, we obtain the lower and upper bound for the result. If the lower and upper bound agree to \$n\$ leftmost digits, we know that the exact calculation will also result in those \$n\$ digits.
I have verified that this solution works up to \$n = 333\$, using MAX_DIGITS = 1000.
How
This solution uses the following well known approximation of \$e\$:
$$ e = \lim_{x \to \infty} \left(1 + \frac{1}{x} \right)^{x}$$
Substituting \$x = 100^n\$, we have:
$$ e = \lim_{n \to \infty} \left(1 + \frac{1}{100^n} \right)^{100^n} = \lim_{n \to \infty} \frac{\left(100^n + 1 \right)^{100^n}}{\left(100^n\right)^{100^n}}$$
Since the denominator is a power of \$10\$, we can ignore it entirely.
According to this analysis on Math SE, the worst case error of this approximation is:
$$ \Delta < \frac{3}{x} = \frac{3}{100^n}$$
which means roughly that every time \$n\$ increases by \$1\$, we gains 2 digits of precision.

Is yur code or my optimize wrong?

@l4m2 My solution is wrong unfortunately :( At first I thought your optimization slightly lowered the result due to truncation, e.g ...90... becomes ...89..., but even if I round up after each division, the result is still wrong. Even though my solution's error goes down by a factor of 10 every time n increases, the error can still be large enough to push patterns like ...200... down to ...199....

So can this be wrong? (though it's much slower it's same length)

@l4m2 I have tested it to 133 digits, and there doesn't seems to be a problem. The worst case error is $3 / 100^{n}$, which means that as n increases by 1, your answer gains 2 digits of precision (compare to 1 digit in in my answer). It seems rather unlikely that such small error can influence n previous digits, it would require a really long string of small digits like 9000.... No guarantee though.

@l4m2 May I include your solution in my answer?

My link's for such purpose

Python's exponentiation actually right-associates so you can cut those parens.

dc, 66 bytes
I?dF+k^1sF2sE2sN[q]sR[1lNlF*dsF/d0=RlE+sElN1+sNlLx]dsLx+lE*0k1/I%p

Try it online!
Or print more than 800 digits before TIO times out after a minute.
I've verified these 800 digits against the published value at a NASA web page with 2 million digits of e.
(It may be possible to shorten the code a bit by keeping some of the variables on the stack and accessing them via stack manipulation instead of using dc's registers.)
Explanation
I     # 10.
?     # Input value.
d     # Push on stack for later.
F+k   # Add 15 and make that the number of decimal places to calculate.
^     # 10 ^ input value, saved on stack for use at end.
1sF   # 1!, stored in F.
2sE   # 2 is starting value for e.
2sN   # for (N=2; ... )
[q]sR # Macro R will be used to end loop.
[     # Start loop L.
  1         # Push 1 for later.
  lNlF*dsF  # F = N! and push on stack.
  /d        # 1 / N!, duplicate on stack
  0=R       # If 1/N! == 0 (to the number of decimal places being computed), end loop.
  lE+sE     # Otherwise e += 1/N!
  lN1+sN    # N++
  lLx       # Go back to start of loop L
]dsLx  # End macro, save it in L, and execute it.
+      # Get rid of extra 0 on stack.
lE     # e, computed with sufficient accuracy
*      # Multiply by 10^input value, which was saved on the stack early on.
0k1/   # Truncate to integer.
I%    # Mod by 10 to get desired digit.
p     # Print digit.

Python 3, 146 105 bytes
n=int(input())
N=n+3
q=2
e=[1]*N
exec('q=i=0;exec("q,e[i]=divmod(10*e[i]+q,N-i+1);i+=1;"*N);'*n)
print(q)

Try it online! (thanks to @SurculoseSputum)
This only uses small integers to calculate digits of \$e\$.  With a modification to use a lazy upper bound for N, it uses the algorithm described in

A. H. J. Sale. "The calculation of \$e\$ to many significant digits." The Computer Journal, Volume 11, Issue 2, August 1968, Pages 229–230, https://doi.org/10.1093/comjnl/11.2.229

Essentially, the idea is that \$e\$ can be written in "base-factorial" as \$1.11111\dots\$, where digit \$n\$ has place value \$1/n!\$.  The algorithm repeatedly multiplies this number by 10 to extract digits one at a time.  In fact, if one were to record each value of q in the outer for loop, the result would be the first n digits of \$e\$.
One complexity is that we need to know how many digits in base-factorial to calculate.  In this version, \$n+3\$ is (more than) sufficient.  A previous version of this answer used an estimate from Taylor's theorem, and it looked for a value of N such that \$N!\geq 10^{n}\$, doing so by calculating all factorials until it exceeds this power of ten.

+1 for this spigot algorithm (these algorithms are nice -- they produce one digit at a time as they run).  I did a version in dc based on an algorithm similar to this one; unfortunately it came out to be longer than the dc answer that i posted earlier.  (I golfed it down to 101 bytes, which isn't even close to the 66 bytes in the answer I posted.)

119 bytes by replacing the loops with exec "..loop.."*n, and changing from a function to a program.

If you accept a larger value of N (aka N=n+3), then this can be shorten to 95 bytes.

@SurculoseSputum Thanks! I modified it to be Python 3 compatible, which loses 10 bytes to your 95.

05AB1E, 8 bytes
°D>smI<è

Try it online!
Very, very slow.

SageMath, 35 33 bytes
lambda n:str(N(e,digits=n+9))[-9]

Try it online!
Very, very fast!

Fastest gun or fastest code?

@Λ̸̸  You've got to ask yourself one question: "Do I feel lucky?" Well, do ya, punk? :P

You're lucky because you answered the question just before the question is closed.

@Λ̸̸ Oh wow! I am the lucky one today! :D

@Λ̸̸ That's nothing; I can still answer questions after they're closed!

@Neil So can I, I just can't post them! T_T

@Neil I have the feeling I'm missing something obvious here, but how did you do that? Question is indeed closed 3 hours ago and your answer is from 2 hours ago. Did you became a moderator/admin? ;)

@KevinCruijssen I blame client-side validation.

Python 2, 98 100 72, 71 bytes
f=lambda n,p=1,q=1,k=1:k<n+9and f(n,p*k+1,q*k,k+1)or str(p*100**n/q)[n]

Try it online!
-1 byte, remove unneccesary whitespace.
older answer
f=lambda n,p=1,q=1,k=1:k<n+9and f(n,p*k+1,q*k,k+1) or str(p*100**n/q)[n]

Try it online!
-28 bytes simpler formula
Simpler algorithm based on more usual formula:
$$e = 1 + \frac 1 {1!} + \frac 1 {2!} + \frac 1 {3!} + \frac 1 {4!} + \cdots$$
But re-expressed as sequence of approximations:
$$1, 1+1, \frac{(2(1+1)+1)}2, \frac{(3(2(1+1)+1)+1)}{(3\cdot2)}, \frac{(4(3(2(1+1)+1)+1)+1)}{(4\cdot(3\cdot2))},...$$
These can be expressed as ratio of recurrence relations $\frac {p_k}, where
$$p_0 = q_0 = 1 \\
p_{k+1} = kp_k + 1, q_{k+1} = kq_k, \: \forall k \ge 1$$
old answer
f=lambda n,p=3,q=1,r=19,s=7,b=10,x=1,y=0:x-y and f(n,r,s,r*b+p,s*b+q,b+4,p*100**n//q,x) or str(x)[n]

+2 bytes because I mistakenly omitted f=
Try it online!
This approach is based on continued fractions. Not happy with it yet, but it seems good for a few hundred digits.
Based on the continued fraction:
$$e = 3 - \cfrac 2 {7 + \cfrac 1 {10 + \cfrac 1 {14 + \cfrac 1 {18 + \cfrac 1 {22 + \ddots}}}}}$$
Computed by the recurrence relation:
$$\frac {p_0} {q_0} = \frac 3 1 , \: \frac {p_1} {q_1} = \frac {19} 7 \\
\frac {p_{k+1}} {q_{k+1}} = \frac {p_k (4k+2) + p_{k-1}} {q_k (4k+2) + q_{k-1}}, \: \forall k \ge 1$$
which was arrived at after a first reading of An Essay on Continued Fractions by Leonard Euler.

Jelly, 14 bytes
⁵*³
¢‘µ*¢ŒṘḣ³Ṫ

Try it online!
A monadic link taking a single integer, plus a niladic helper link.
Explained
⁵*³
¢‘µ*¢ŒṘḣ³Ṫ

Link f:
    *(10, input) # 10 * input

Main Link:
    tail(head(str(*(Increment(f()), f())), input)) # str((f() + 1) * (f()))[:input][-1]

Do you mean 2-indexing? Since the question requires the digits after the decimal point.

@Λ̸̸ Well, whatever it is, it's the same as the other answers

Here's how to do the same thing in 8 bytes.

Charcoal, 30 12 bytes
Ｐ←×ψ⁺²Ｎ¤≕EＴ¹

Try it online! Link is to verbose version of code. Inspired by @ASCII-only's comment and his answer to Bake a slice of Pi (compare my answer to Music with pi and e). Explanation:
Ｐ←×ψ⁺²Ｎ

Input n and print n+2 nulls to the left without moving the cursor, so it remains on the last null.
¤≕E

Fill the nulls with the expansion of Euler's number.
Ｔ¹

Trim away everything except the current character.
Previous 30-byte answer calculated the Maclaurin expansion of 100ⁿe to n+10 terms:
Ｎθ≔Ｘχ⊗θη≔⁰ζＦ⁺χθ«≧⁺ηζ≧÷⊕ιη»§Ｉζθ

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

Input n.
≔Ｘχ⊗θη

Start with a term of 100ⁿ.
≔⁰ζ

Initialise the total to 0.
Ｆ⁺χθ«

Repeat n+10 times.
≧⁺ηζ

Add the current term to the total.
≧÷⊕ιη

Divide the term by the number of loop iterations.
»§Ｉζθ

Print the nth digit of the total.

or of course, the cheaty way

@ASCII-only Ah, so I guess you can get Pi that way without Fill()ing it too? Although, it turns out that using Fill is still shorter anyway, so...

yeah, this is just the direct translation of mathematica's N[E, whatever + 1]

@ASCII-only Ah, because for Music with pi and e I did wonder how to get the relevant number of digits, since just trying to stringify GetVariable("E") fails and I didn't know about N[].

Wolfram Language (Mathematica), 21 bytes
Floor[E 10^#]~Mod~10&

Try it online!

Whispers v3, 52 bytes
> Input
> eᵢ
>> ≻1
>> 2ᶠ3
>> 4ⁿ1
>> Output 5

Try it on repl.it!
Run with python3 whispers\ v3.py euler.wisp < input.txt 2> /dev/null
Input is the first line in input.txt.
Euler digits builtin ftw!

bc -l, 37 bytes
scale=s=read();(e(1)*A^s+scale=0)%A/1

Try test cases online!
Input on stdin, output on stdout.


text:
Tile the plane with squashed hexagons
I came across an interesting tiling of the plane using squashed hexagons in a popular math book. All the six edges of the squashed hexagon are the same length. Two opposite corners are right angles and the rest four corners are 135 degrees each. This shape allows four squashed hexagons be arranged so that they meet at a point. Then “concentric rings” of squashed hexagons can outline the resulting cross indefinitely.

Write a full program or a function that accepts an integer 0 < n < 10 and renders n rings of this tessellation. You can rotate the image by 45 dergrees if it's more convenient for your algorithm. You can render directly to the screen, or save the result to a file. In either case, please provide an image demonstrating the the result of your code. You can crop the resulting image so that it contains only the hexagons.
Examples:
n = 1

n = 2

n = 3

n = 4

The shortest code in bytes in each language wins.

Galen do you happen to know if J’s graphing facilities would be capable of this?

@Jonah I'm not familiar with graphics in J, but the book "Fractals Visualization and J" mentions plotting polygons. It says the following addons are needed: graphics/fvj4 and media/imagekit. (I haven't read it, just opened it to check)

It's too bad Hexagony doesn't (as far as I know) have the ability to do graphics - that would be worth some bonus points...

@DarrelHoffman You can output to an image file too (instead of doing "real" graphics), e.g. write a BMP, but I'm not sure if it's worth the hassle :)

@schnaader Having written a BMP parser in Assembly (as a school assignment years ago), that just gave me chills.  Combine that with trying to do anything useful in Hexagony, AND golf it, yeah, definitely not worth it.

JavaScript (ES6), 319 313 bytes

f=
n=>{s=`<svg viewBox=${n*=-12},${n},${n*=-2},${n}><use href=#d transform=rotate(180) /><g id=d><use href=#s transform=rotate(90) /><path id=s fill=none stroke=#000 d=`
for(n/=24;n--;)for(j=0;j<=n;j++)s+=`M${n*5+j*7},${n*12-j*7}h7l5,5v7h-7l-5,-5z`+(j<n?`M${n*12},${n*5-j*10}h7l5,-5l-5,-5h-7l-5,5z`:``)
return s+`>`}
<input type=number min=1 oninput=o.innerHTML=f(this.value)>

Output is an HTML5 SVG, which the snippet inserts into a DOM node so that you can see it. Output is rotated by 45° as allowed by the question. Edit: Saved 3 bytes thanks to @KevinCruijssen.

${n*-12},${n*-12},${n*24},${n*24} and i<n can be ${n*=-12},${n},${n*=-2},${n} and i<n/24 for -2. And for(i=0;i<n;i++) can be for(i=n;i-->0;) for an additional -1.

@KevinCruijssen Then again. this isn't Java, so I don't need the >0, and now I can just use n instead of i, saving another byte.

The output is rotated 45º counter-clockwise. At least it is on Google Chrome. Would be better to specify this in your answer, so others don't think it is wrong.

@IsmaelMiguel OK I'll clarify that.

GFA Basic 3.51 (Atari ST),  187 181 174  171 bytes
A manually edited listing in .LST format. All lines end with CR, including the last one.
PRO f(n)
DR "MA166,94"
t$="FD8LT45PD"
h$=t$+"FD8LT90"+t$+t$+"FD8LT90FD8BK8LT90FD8RT45"
a$=""
F i=1TO n
DR STRING$(4,a$+h$+"LT45BK8"+a$+t$)+"PUFD8RT45"+t$
a$=a$+h$
N i
RET

Expanded and commented
PROCEDURE f(n)
  ' move the pen at (166,94)
  DRAW "MA166,94"
  ' t$ = move forward by 8, left turn of 45 degrees, pen down
  t$="FD8LT45PD"
  ' h$ holds the directives to draw a single hexagon
  ' and get ready to draw a contiguous hexagon
  h$=t$+"FD8LT90"+t$+t$+"FD8LT90FD8BK8LT90FD8RT45"
  ' a$ is used to store a concatenation of hexagons
  a$=""
  ' draw n rings
  FOR i=1 TO n
    ' draw a full ring and move to the next ring
    DRAW STRING$(4,a$+h$+"LT45BK8"+a$+t$)+"PUFD8RT45"+t$
    ' append a new hexagon to a$
    a$=a$+h$
  NEXT i
RETURN
Example output

Logo, 276 245 bytes
to i:n
repeat 2[repeat:n[repeat 2[fd 7
rt 45]fd 7
bk 7
lt 90]rt 90
fd 7
rt 90]end
to j:n
make"m:n
repeat:n[i:m
make"m:m-1
rt 90
repeat 2[fd 7
lt 45]]repeat:n[repeat 2[rt 45
bk 7]lt 90]end
to k:n
repeat 4[j:n
rt 90
fd 7
lt 45
j:n-1
rt 45
bk 7]end

Use k <n> to invoke. Output is rotated by 45° as allowed by the question. Example for n=10: Try it online!

Sadly the link no longer works but you can paste the code into this online interpreter.

Python 3, 361 342 bytes
from turtle import*
def t(a):r(a);fd(9)
def k(i):Q.add((o+i,pos(),heading(),m))
u=45;n=int(input());Q=set((1,(0,0),a*90,a>3)for a in range(8));ht()
while Q:
 o,p,a,m=Q.pop()
 if round(o)>n:continue
 r=(rt,lt)[m];g=not o%1;up();goto(*p);seth(a);pd();t(-u)
 if g:k(1.1)
 t(u)
 if g:k(1)
 t(u);t(-u);k(2+g/3);undo();undo();t(90);t(u);t(u)
done()

Shadertoy (GLSL), 777 710 679 644 630 609 bytes
#define V vec2
#define F float
#define R return
const int n=10;const F Z=2.2/F(n),W=.01*Z,L=.07*Z,K=L/2.,M=K*1.414;F h(V u,V c){u=abs(u-c);
if(u.x>.0&&u.x<K)R abs(u.y-M)<W/1.4?.0:1.;else if(u.x<K+M+W)R abs(u.y-M+u.x-K)<W?.0:1.;R 1.;}
F m(V u,V c){u=abs(u);R h(u,c)*h(u.yx,c);}void mainImage(out vec4 f,in V c){V S=iResolution.xy;V v=c/S-V(.5);
v.y/=S.x/S.y;F b=-atan(1.);mat2 o=mat2(cos(b),-sin(b),sin(b),cos(b));V w=o*v;F s=1.,a=K+M,k=.0,l;int i,j,J;
for(i=0;i<n;i++,k++){J=i/2+1;l=.0;for(j=0;j<J;j++,l++){F z=l*2.*M;if(i%2==1)z+=M;
s*=m(v,V(a+k*(L+M),z));if(i<n-1)s*=m(w,V(a+k*(L+M)+L,z));}}f.xyz=vec3(s);}

Shadertoy link
Happy to finally see this working, the tile layout can be a bit puzzling at first. It automatically "zooms in" for lower n values, but can also be manually adjusted by changing the Z variable because it's not optimal. Something is a bit wrong with the line drawing where diagonal and straight lines meet (which gets more apparent for lower n values), perhaps I'll find a way to get that fixed. There also is an ungolfed version with some comments on how it does things.
Output for n = 10:

I think you can save a bunch of chars by redefining common tokens, e.g #define V vec2 or #define R return. Redundant zeros can be removed from floats, e.g 1. or .1 Also put everything in 1 line to get rid of all new line characters.

JavaScript + HTML + CSS, 82 + 39 + 204 = 325 bytes
JavaScript
Function that takes a number n. An internal function P recursively generates an ASCII pyramid of ⬡ characters, formatted as a CSS string with \a line breaks. On the HTML element with id="X", sets the custom CSS custom properties -- and --- to P(n) and P(n-1), respectively.
n=>X.style=`--:"${(P=n=>(n?P(n-1)+`\\a`:'')+'⬡'.repeat(n))(n-1)}";---:"${P(n)}"`

HTML
8 nested HTML elements whose :after pseudo-elements will contain hexagon pyramids; wrapped in a
 to show line breaks.  ensures pyramids are centered horizontally.

CSS
Applies transform: rotate(45deg) to all elements; the rotation effect compounds for the 8 nested elements. Applies content such that i:after gets the bigger pyramid ---, and center:after and b:after get the smaller pyramid --. Squishes the ASCII hexagon pyramids into a (decently accurate) tile pattern via font-size, line-height, letter-spacing, and transform – results may vary depending on your browser.
*{display:flex;place-content:center;transform:rotate(45deg)}:after{font:150%/.62 auto;letter-spacing:-5px;position:absolute;transform:matrix(.69,0,0,1,-1.75,-5);content:var(--)}i:after{top:-8px;--:var(---

Output for n = 10 (Chromium 81, macOS):

Try it!

f=

n=>X.style=`--:"${(P=n=>(n?P(n-1)+`\\a`:'')+'⬡'.repeat(n))(n-1)}";---:"${P(n)}"`

f(+prompt())
head,script{display:none !important}
body{margin:50vmin}

*{display:flex;place-content:center;transform:rotate(45deg)}:after{font:150%/.62 auto;letter-spacing:-.23em;position:absolute;transform:matrix(.71,0,0,1,-1.75,-5);content:var(--)}i:after{top:-.34em;--:var(---

Can you attach a screenshot? I got the hexagons a bit less squashed in Chrome and that leads to gaps between the "arms".

@GalenIvanov Done.

Thank you! I've already upvoted your solution.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Closest to a square
The task
Given a positive integer c, output two integers a and b where a * b = c and each a and b is closest to sqrt(c) while still being integers.
Test cases
Input: 136
Output: 17 8

Input: 144
Output: 12 12

Input: 72
Output: 9 8

Input: 41
Output: 41 1

Input: 189
Output: 21 9

Rules

a, b and c are all positive integers
You may give a and b in any order, so for the first case an output of 8 17 is also correct
This is code-golf, so lowest byte count wins!

Please notify me if this is a duplicate...

If the input integer is square may we output a single integer or must we repeat it?

@JonathanAllan it is up to you, although I would assume it's easier to repeat it.

This is OIES A033676 (lower number) and A033677 (higher number)

05AB1E, 3 bytes
Given an input \$ c \$, it outputs \$ a \$ and \$ b \$ as a list in increasing order. If \$ c \$ is a square, it outputs a single integer (which according to the OP is allowed).
ÑÅs

Try it online!
Explanation
Ñ     # All divisors
Ås    # Middle elements

I just got the idea when I scrolled past your answer. Clever answer though.

The output should have two integers, but as you can see here, there is only one integer in case of input which is a power of 2.

@JubayerAbdullahJoy The OP mentioned that if the two numbers are the same, it is OK to output just one (see the comments).

oh, ok then. I must say your solution is very elegant :)

JavaScript (ES7), 35 bytes
f=(n,d=n**.5)=>n%d?f(n,-~d):[d,n/d]

Try it online!
How?
If \$n\$ is a square, \$d=\sqrt{n}\$ is an integer which obviously divides \$n\$, so we immediately have an answer. Otherwise, the first -~d will act as \$\lceil{d}\rceil\$ and the next ones as \$d+1\$. Either way, we stop as soon as \$n\equiv 0\pmod{d}\$ which in the worst case (i.e. if \$n\$ is prime) happens when \$d=n\$.

Python 2, 45 bytes
i=n=input()
while(i*i>n)+n%i:i-=1
print n/i,i

Try it online!

Jelly, 8 bytes
ÆDżṚ$SÞḢ

A monadic Link accepting a positive integer which yields a list of two positive integers.
Try it online!
How?
ÆDżṚ$SÞḢ - Link: positive integer, X   e.g. 12
ÆD       - divisors of X                    [1,2,3,4,6,12]
    $    - last two links as a monad:
   Ṛ     -   reverse                        [12,6,4,3,2,1]
  ż      -   zip                            [[1,12],[2,6],[3,4],[4,3],[6,2],[12,1]]
      Þ  - sort by:
     S   -   sum                            [[3,4],[4,3],[2,6],[6,2],[1,12],[12,1]]
       Ḣ - head                             [3,4]

MATL, 9 bytes
Z\J2/)Gy/

Try it online!
Explanation
Z\   % Implicit input. Array of divisors
J2/  % Push imaginary unit, divide by 2: gives 0.5j
)    % Index into the array. When used as an index, the imaginary unit means "end".
     % Thus the index 0.5j for [1 2 3 6] would give the 2nd entry (end=4th entry,
     % end/2 = 2nd entry, indexing is 1-based), whereas for [1 2 3 6 12] it would
     % give the "2.5-th" entry. This index is rounded up, so the result would be
     % the 3rd entry
G    % Push input again
y    % Duplicate second-top element in stack (that is, the selected entry)
/    % Divide
     % Implicitly display stack contents

@Downvoter Any suggestion to improve my annswer?

C (gcc), 51 bytes
i;f(a,c)int*a;{for(i=0;i*i++<c;)c%i||(*a=i);c/=*a;}

Try it online!

Python 2, 47 bytes
f=lambda n,v=1:[n/v,v]*(n/v-v<1>n%v)or f(n,v+1)

A recursive function.
Try it online!

Charcoal, 20 bytes
Ｎθ≔⊕⌈Φ₂θ¬﹪θ⊕ιηＩ⟦÷θηη

Try it online! Link is to verbose version of code. Technically only works up to a=2⁵³, but would be stupidly slow well before then anyway. Explanation:
Ｎθ

Input c.
≔⊕⌈Φ₂θ¬﹪θ⊕ιη

List all of the factors of c that do not exceed its floating-point square root, and take the largest b.
Ｉ⟦÷θηη

Calculate and output a and b.

Julia 54 bytes
Try it
n->begin i=findfirst(x->x^2>=n&&n%x==0,1:n);i,n÷i;end

Python 2, 52 48 bytes
f=lambda c,i=1:i*i>=c>c%i<1and(i,c/i)or f(c,i+1)

Try it online!
Simply increments i until it satisfies
i*i>=c and c%i==0

Then returns the pair (i, c/i).

Retina 0.8.2, 34 bytes
.+
$*
(?<-2>(^(1)+?|\1))+$
$.1 $#1

Try it online! Link includes test cases. Explanation:
.+
$*

Convert c to unary.
(?<-2>(^(1)+?|\1))+$

The (1)+ matches a minimal substring a of 1s individually into the \2 stack, where they are popped off as the entire substring \1 is repeatedly matched b times until it reaches c. This popping mechanism thus prevents b from exceeding a, but as a is minimal it must therefore be the smallest factor not less than the square root. Excitingly, .NET allows you to populate the \2 stack on the first iteration of the (?<-2>) loop. (On the remainder of the loops, the ^ no longer matches, so the \1 alternative is used.)
$.1 $#1

Output a and b.

Erlang (escript), 68 bytes
f(X)->Y=lists:max([I||I<-lists:seq(1,X),X rem I==0,I*I=<X]),[Y,X/Y].

Try it online!

Java (JDK), 52 bytes
n->{int i=n;for(;i*i>n|n%i>0;)i--;return n/i+","+i;}

Try it online!

dc, 39 bytes
[d_3R/fq]sE?ddvd[_3R%0=E1-rd3RdlFx]dsFx

Try it online!
Or verify the test cases.

How it works:
Command  Stack (top on the right)

[        # Macro starts with stack at:
               # n d
               # Prints n/d and d, and then quits.
 d       # n d d
 _3R     # d n d
 /       # d n/d
 f       # Prints stack.
 q       # Quit this macro and the macro which called it.
]sE      # End macro and save it in register E.

?        # n  (Input values and push it on stack.)
dd       # n n n
v        # n n d
         #         d is a potential divisor of n;
         #         it's initialized to int(sqrt(n)).
d        # n n d d
[        # Start macro to be used as a loop.
 _3R     # n d n d
 %       # n d n%d
 0=E     # n d     If d divides n, call macro E to end.
 1-      # n d     New d = d - 1.
 r       # d n
 d       # d n n
 3R      # n n d
 d       # n n d d
         #         The stack is now set up correctly to
         #         go back to the top of the loop, with
         #         d now one step lower.
 lFx     # Call macro F to go back to the top of the loop.
]dsFx    # End macro, save it as F, and execute it.

R, 48 46 45 41 bytes
x=scan();b=1:x;a=b[!x%%b&b^2>=x][1];a;x/a

Try it online!
Finds first ([1]) divisor (which(!x%%b)) that is equal-to or greater than square-root (b^2>=x); returns this & reciprocal (a;x/a).
Previous approach (46 bytes) found divisor closest to centre of list-of-divisors, but couldn't be golfed-down so effectively.

Perl 5 -pa, 37 bytes
$_=0|sqrt;$_--while"@F"%$_;say"@F"/$_

Try it online!

Python 3, 73 60 59 bytes
Not the shortest or best solution by any means, but I think it's a creative approach. Prints the two factors without separator between them and only (consistently) works for inputs up to 1008.
r=range(1000)
f=[a*b*(a*a>=a*b)for a in r for b in r].index

Try it online!
Python 3, 57 bytes
Still not the shortest solution, but it's at least somewhat expressive and clear what's going on.
lambda n:max((x,n/x)for x in range(1,n+1)if n%x<(x*x<=n))

Try it online!

Pyth, 14 12 bytes
fsIJcQTs@Q2J

Try it online!

s@Q2 Starting from the floor of the square root of the input:

f find the first integer \$T\$ such that:
sIcQT \$T\$ divides the input

cQT gives the input divided by \$T\$ (ie. the other divisor) so we assign that value to J
The two divisors T and J are then implicitly printed

13 bytes, different approach: Try it online!

Python 2, 66 bytes
def g(s):x=[[a,s/a]for a in range(1,s)if s%a==0];print x[len(x)/2]

Try it online!

I think it needs to work for 1, right? Also s%a==0 -> s%a<1

It's usually accepted that a person providing the challenge does not answer their own challenge for a few days, letting other people trying to solve the challenge in the most available languages.

@OlivierGrégoire I fail to see how this stops people from posting their own answers. I've been outgolfed on this anyways even before I posted this

SageMath, 63 60 bytes
def f(n):
 d=divisors(n)
 while len(d)>2:d=d[1:-1]
 return d

Try it online!

MathGolf, 7 bytes
─h½§_@/

Try it online!
Explanation
─          get a list of all divisors
 h½§       get the divisor at the middlemost index
           (if length is equal returns the smallest of the two middle elements)
    _      duplicate TOS
     @     rrot3 (pops input again and places it as the second item from the top)
      /    divides the input number by the extracted divisor, giving the other divisor

C++ (gcc), 108 bytes 103 bytes
#import<iostream>
int n,a,b,i;main(){for(std::cin>>n;i*i++<=n;)n%i<1?a=i,b=n/i:0;std::cout<<a<<' '<<b;}

Try it online!
Thanks to callingcat, for -5  bytes

Thank you, updated :)

Suggest b=n%i?b:n/(a=i) instead of n%i<1?a=i,b=n/i:0

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Write a microwave timer!
You are an employee of Microteque, a leading Silicon Valley startup creating smart microwave ovens for all kinds of strange places. Your customers can get their microwaves printed with patterns to match their kitchens, campers, man caves; even the kitchens of large nation-state facilities have shiny new branded microwave ovens.
Due to the cutting-edge nature of your microwave control board technology, you've ended up having to use the programming language MicrowaveX* and you're working out how to program the time counter. Your counter looks like this:

Your goal is to write a program that takes the input time and translates it into the number of seconds that the microwave needs to run.
As input, the function must take a string in the format ##:## (including the colon at position 3) and return an integer.
Please note that it should also be able to handle more than 60 seconds in the seconds slot.
Finally, due to some pesky regulations, you cannot have your microwave oven run for more than 100 minutes (6,000 seconds)
Sample inputs and outputs:
01:30 --> 90 seconds
00:66 --> 66 seconds
01:99 --> 159 seconds
02:39 --> 159 seconds
99:99 --> 6,000 seconds (capped at 100 minutes due to aforementioned regulations)
*: MicrowaveX happens to be identical to your programming language of choice, but Microteque has rebranded it to sound more appealing to their investors.

What's the scoring criteria? Code Golf?

Sorry! Yes, that's it!

Can we output 6000.0?

99:99 = 99 min 99 sec is 100 min 39 sec. 100 minutes exactly is 99:60. Is this test case 99:99 intentional or not? (I see it says it would be capped to 100min due to regulations.)

I'd love to program in MicrowaveX for this challenge. Care to link to the website of the language?

This reminds me of an old Car Talk 'puzzler' .   60 > 30,  90 > 60,  but  100 = 60   :-)

@ Λ̸̸  I think this might be it... https://scratch.mit.edu/

I once had a microwave that, if you entered 00:60 instead of 01:00, it would say "Error" instead of actually starting the timer. I have no idea why, and I've never seen another one like that since.

Bash + GNU utilities, 33 bytes
dc<<<[6000]sL${1/:/ 60*}+dlLx\<Lp

Try it online!
Or try the test suite.
The input string is passed as an argument, and the output is on stdout.

How it works
First bash expands ${1/:/ 60*} by taking argument 1 and replacing the : with 60* (there's a space before the 60 that StackExchange isn't displaying here).  For example, if the input is 01:30, the expansion is 01 60*30.
Also, \< gets used as the character < without its special meaning in the shell.
So what happens is that dc is run with
[6000]sLminutes60*seconds+dlLx<Lp
as its program (where "minutes" and "seconds" refer to the actual two-digit numbers).
This carries out the following operations:
[6000]               Definition of a macro which pushes 6000 on the stack.
sL                   Save the macro in register L.
minutes 60*seconds+  Compute minutes*60+seconds,
                        which is the total number of seconds.
d                    Duplicate the total number of seconds on the stack.
lLx                  Run macro L, which pushes 6000 on the stack.
                     The stack now looks like:
                        #seconds #seconds 6000
                        (top of stack on the right).
<L                   Pop 6000 and #seconds from the stack;
                        if 6000 < #seconds,
                          then run macro L to push 6000 on the stack again.
                     At this point, the item at the top of the stack is:
                        #seconds, if #seconds <= 6000,
                        6000, if #seconds > 6000.
p                    Print the top of the stack.

I'd love to see an explanation

@Jonah Explanation posted!

${1/:/ 60*} Devilish use of parameter expansion <3

Python 2, 42 bytes
lambda t:min(int(t[:2])*60+int(t[3:]),6e3)

Try it online!

I think the first one doesn't work for anything with 08 or 09 because of octal interpretation.

@Jason You are right :)

JavaScript (ES6), 42 bytes
s=>Math.min(6e3,+([m]=s.split`:`)[1]+m*60)

Try it online!
Commented
s =>               // s = input string
  Math.min(        // return the minimum of ...
    6e3,           //   ... 6000 and the following result ...
    +(             //   coerce to integer:
      [m] =        //     store into m the number of minutes
        s.split`:` //     which is the first term of the array obtained
                   //     by splitting s on ':'
    )[1] +         //   yield the seconds (2nd term of the above array)
    m * 60         //   and add the seconds multiplied by 60
  )                // end of Math.min()

Retina 0.8.2, 27 24 bytes
\d+
$*
+`1:
:60$*
6000`1

Try it online!
Explanation
I'll use the input 01:30 as an example.
\d+
$*

Convert minutes and seconds to unary. For example, 01:30 would become 1:111111111111111111111111111111.
+`1:
:60$*

Loop over each digit preceding the :, move it to the right of the :, and repeat the digit 60 times. The 01:30 example would now be :1111111111111111111... (90 ones)
6000`1

Count the first 6000 ones.

Google Sheets, 32 16 bytes
Saved 16 bytes thanks to Chronocidal straight up commenting a better answer.
=240*MIN(25,6*A1

Sheets will automatically add two trailing parentheses when you exit the cell. Input is in A1.

This could also be written as Min(6000,86400*TimeValue("0:"&A1)) if we wanted to fully expand it and be precise. As it is, we take advantage of the fact that Sheets will interpret a string that looks like a time to be in the format hh:mm by default and treat it as a number of days. For instance, =1*"12:00" would return 0.5 and =1*"6:00" would return 0.25. We can then divide by 60 to convert from hh:mm to mm:ss. If that's the only simplification we used, it would look like this:
=Min(6000,1440*A1

Dividing both 6000 and 1440 by 240 saves us 5 bytes inside the Min() function at a cost of only 4 bytes outside of it.

Would treating it as "HH:MM" and multiplying by 1440 be better than treating it as "MM:SS" and multiplying by 86400? i.e. =240*MIN(6*A1,25

I mean, yeah, by a lot! Great idea.

C (gcc), 61 50 bytes
Saved a whopping 11 bytes thanks to dingledooper!!!
s;f(char*t){s=atoi(t)*60+atoi(t+3);s=s<6e3?s:6e3;}

Try it online!

Python 3, 82 72 62 61 57 bytes
def f(s):x,y=map(int,s.split(":"));return min(x*60+y,6e3)

Try it online!

-10 bytes by using min().
-10 bytes from Arnauld!
-1 byte from nope!
-4 bytes from Chas Brown!

62 bytes

61 bytes

57 bytes

J, 21 19 bytes
6e3<.60#.[:".' '2}]

Try it online!

[:".' '2}] Convert the : to a space, then evaluate the string as a list of numbers.
60#. Interpret result in base 60.
6e3<. Minimum of that and 6000.

perl -MList::Util=min -plF: -E, 25 bytes
$_=min 60*$F[0]+$F[1],6E3

Try it online!

Nice! You can save a few bytes using $_ instead of $F[0] (since Perl will ignore the content after the non-numeric character when treating as a number) and if you split on -F/\d\d:/ you can just use "@F" so save another byte vs. $F[1]. Also, $= is pre-initialised to 60 so you can avoid the space using that too!

Try it online!

Batch, 55 bytes
@set/ps=
@cmd/cset/a"(s=%s::=*60+%)+(s-=6000)*(-s>>13)

Takes input on STDIN. Explanation: %s::=*60+% substitutes *60+ for the : in the input, resulting in an arithmetic expression that converts the time into seconds. Since Batch has no minimum function, I then have to compute this via right-shifting the the difference which results in 0 or -1 which is then used to adjust the seconds, which are then automatically output thanks to the use of cmd/c.

What's the lone double quote for?

@SomethingDark Batch doesn't require the trailing quote. The string needs to be quoted because it contains >> which would otherwise be interpreted as output redirection.

Japt, 12 bytes
Feel like I'm missing a trick here ...
q': ì60 m6e3

Try it
q': ì60 m6e3     :Implicit input of string
q':              :Split on ":"
    ì60          :Convert to integer from base-60 digit array
        m6e3     :Minimum with 6000

MathGolf, 14 bytes
2<i╟*l2>i+6♪*╓

Try it online.
Explanation:
                #  i.e. input = "99:80"
2<              # Take the first two characters of the (implicit) input-string
                #  STACK: ["99"]
  i             # Convert it from string to integer
                #  STACK: [99]
   ╟*           # Multiply it by 60
                #  STACK: [5940]
     l          # Push the input-string again
                #  STACK: [5940,"99:80"]
      2>i       # Leave its last two characters, and also cast it to an integer
                #  STACK: [5940,80]
         +      # Add them together
                #  STACK: [6020]
          6♪*   # Push 6*1000: 6000
                #  STACK: [6020,6000]
             ╓  # Only leave the smallest value of the top two values on the stack
                #  STACK: [6000]
                # (after which the entire stack joined together is output implicitly)

I found another 14-byter, I noticed that you could extract both parts of the clock using 2‼><, but it didn't save me any bytes in the end.

Whitespace, 167 bytes
[S S S T    S T T   T   S T T   T   S S S S N
_Push_6000][S N
S _Duplicate_6000][S N
S _Duplicate_6000][S N
S _Duplicate_6000][T    N
T   S _Read_STDIN_as_char][T    T   T   _Retrieve][S S S T  T   S S S S N
_Push_48][T S S T   _Subtract][S S S T  S S T   S T T   S S S N
_Push_600][T    S S N
_Multiply][S N
S _Duplicate][S N
S _Duplicate][T N
T   S _Read_STDIN_as_character][T   T   T   _Retrieve][S S S T  T   S S S S N
_Push_48][T S S T   _Subtract][S S S T  T   T   T   S S N
_Push_60][T S S N
_Multiply][T    S S S _Add][S N
S _Duplicate][T N
T   S _Read_STDIN_as_character][S N
S _Duplicate][S N
S _Duplicate][T N
T   T   _Read_STDIN_as_integer][T   T   T   _Retrieve][T    S S S _Add][S N
T   _Swap_top_two][T    S S T   _Subtract][S N
S _Duplicate][N
T   T   N
_If_negative_jump_to_Label_PRINT][S N
S _Duplicate][T S S T   _Subtract][N
S S N
_Create_Label_PRINT][T  S S S _Add][T   N
S T _Print_as_integer]

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.
Try it online (with raw spaces, tabs and new-lines only).
Explanation in pseudo-code:
Unfortunately Whitespace is unable to read an integer when there is anything other than a newline (or nothing) behind it. Because of this, the minute-digits has to be read loose as characters, and seconds can be read as an integer..
Integer m1 = Read STDIN as character
m1 = m1 - 48
m1 = m1 * 600
Integer m2 = Read STDIN as character
m2 = m2 - 48
m2 = m2 * 60
Integer m = m1 + m2
Read STDIN as character (the ':', which we simply ignore)
Integer s = Read STDIN as integer
Integer total_seconds = m + s
If(total_seconds - 6000 < 0):
  Print total_seconds as integer to STDOUT
Else:
  Print 6000 as integer to STDOUT

Befunge-93, 35 bytes
&~$"<"*&+:v
v!`*"<""d"<
_"d""<"*.@.

Try it online!
Reads a number, read a character (:) and discard it, multiply the read number with 60 (ASCII character 60 equals "<"), read the second number, and add it to the product (this gives the number of seconds). Dub the number of seconds; push 6000 (6000 = 60 * 100 = "<" * "d") on the stack and compare. If 6000 is less than the number of seconds, push another 6000 on the stack and print it. Else, print the number of seconds (which is now the top of the stack).

You can save bytes by putting together "<" and "d" in the same string Try it online!

Building on Leos suggestion, everything on a single line is a little shorter: https://tio.run/##S0pNK81LT/3/X61ORclGSUtN20rJJkVJK0HZQVFZL14pBSim5/D/v4GhlaUlAA

Jelly, 10 bytes
ṣ”:Vḅ60«6ȷ

A monadic Link accepting a list of characters which yields an integer.
Try it online!
How?
ṣ”:Vḅ60«6ȷ - Link: list of characters, T
 ”:        - character ':'
ṣ          - split T at ':'
   V       - evaluate as Jelly code -> [m,s]
     60    - sixty
    ḅ      - convert from base -> 60*m+s
        6ȷ - 6*10^3 = 6000
       «   - minimum

C++ (gcc), 92 bytes
#import<iostream>
main(){int m,s;char x;std::cin>>m>>x>>s;std::cout<<std::min(m*60+s,6000);}

Try it online!
Special Thanks to math junkie.
Special Thanks to ceilingcat for the educative suggestion.

Hello and welcome to CGCC! You actually need to include your imports and usings in your byte count. It looks like your answer has quite a bit of unnecessary whitespace as well. Here is a version of your code with whitespace removed, endl removed, and a shorter import :)

Thank you, math junkie, for the correction :)

Thank you ceilingcat, I have made the change :)

Ruby, 41 bytes
->i{[i[0,2].to_i*60+i[3,2].to_i,6e3].min}

Try it online!
16 bytes saved thanks to math-junkie

You can save quite a few bytes using slicing instead of split and inject: Try it online!

Thanks, I was looking for something way too complicated!

x86-16 machine code, 30 bytes
Binary:
00000000: 33d2 e806 00b2 3cf6 e292 acad 2d30 3086  3.....<.....-00.
00000010: c4d5 0a03 c2ba 7017 3bc2 7e01 92c3       ......p.;.~...

Listing:
33 D2           XOR  DX, DX         ; zero DX
E8 0006         CALL CONV           ; get minutes into AX
B2 3C           MOV  DL, 60         ; multiplier 60 sec/min
F6 E2           MUL  DL             ; AX = AL * 60
92              XCHG AX, DX         ; save seconds in DX
AC              LODSB               ; skip ':' char
            CONV:
AD              LODSW               ; load next two ASCII chars into AX
2D 3030         SUB  AX, '00'       ; ASCII convert
86 C4           XCHG AL, AH         ; endian convert
D5 0A           AAD                 ; BCD to byte convert
03 C2           ADD  AX, DX         ; add minutes to seconds
BA 1770         MOV  DX, 6000       ; set up max comparison
3B C2           CMP  AX, DX         ; is result > 6000?
7E 01           JLE  DONE           ; if not, return current value
92              XCHG AX, DX         ; otherwise 6000
            DONE:
C3              RET                 ; return to caller

Input string in [SI], output number of seconds in AX.
Sample I/O using test program:

Should it be E8 0006 in the inline disassembly?

@anatolyg - indeed is does. Good eye!

Charcoal, 13 bytes
Ｉ⌊⟦↨Ｉ⪪Ｓ:⁶⁰×⁶φ

Try it online! Link is to verbose version of code. Explanation:
      Ｓ         Input string
     ⪪ :        Split on literal `:`
    Ｉ           Cast each part to integer
   ↨    ⁶⁰      Convert from base 60
           ⁶    Literal 6
          ×     Multiplied by
            φ   Predefined variable 1000
 ⌊⟦             Take the minimum
Ｉ               Cast to string
                Implicitly print

05AB1E, 11 bytes
':¡60β6₄*)W

Try it online!
Coincidental port of most answers.
Explained
':¡60β6₄*)W

min(lhs: base10(number: split(string: input, character: ":"), from: 60), rhs: times(lhs: 6, rhs: 1000))

':  | Push the character ":"
¡   | Split the input upon ":"s -> [mins, seconds]
60β | Convert the list from base 60 to base 10
6₄* | Push the number `6000`
)W  | Wrap the converted input and 6000 into a list and find the smallest.

Perl 5 with -plF/((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((\d+)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))):(\d+)/ -MList::Util+sum,min, 16 bytes
Not competing with @Abigail's answer which is not 'cheaty' like this one.
$_=min 6e3,sum@F

Try it online!
Explanation
Using the -F flag, the left part of the input is replicated 60 times and the right part is extracted once, into @F. These are summed to yield the number of seconds and we use min to ensure it's not over 6000.

Tcl, 54 bytes
proc f {a} {scan $a %d:%d a b
expr min(60*$a+$b,6000)}

Try it online!
Explanation
Sadly, the times with leading zeroes mess up string interpolation directly into expr (using ternaries) because Tcl thinks they are octal, so I had to settle for using scan to force interpretation as decimal. Also, if 6000.0 is allowed as output, I can save 1 byte.

52 bytes: https://tio.run/##JcnRCoIwFMbx685TnEAhq4tjwuDsVcSL6bYSbA5dFIw9@zK7@fjx/cMw5eyXeUCLCuM6KIeFwlLLUm9HD@bjF3yO7iToXKhL0V8FEVUpvx/jZDAeWzNbXIMeXZcwwsG/woqtxfZuNvxDBynXJBsCqvclKcTPzEA32TAw72ZJ/AU

51 bytes: https://tio.run/##JcnRCsIgFMbx63yKE2zQqouzBsLxVWQXbmoNlpNpFIjPbmvdfPz4/nGcS/HrMoIFBSmMykGloNai1tsxMPPxKzwnd@J4rtSlGq7cdE0u78c0G0hHaRYLIerJ9RkSO/hXDCAtyLvZ8A89y6VF0SHDdl8UnP9MxPAmOmJEu0kgfQE

K (ngn/k), 14 bytes
Solution:
6000&60/.'":"\

Try it online!
Explanation:
6000&60/.'":"\ / the solution
          ":"\ / split string on ":"
        .'     / value (convert "12" => 12)
     60/       / from base-60
6000&          / min of result and 6000

Rust, 82 bytes
|s:&str|6000.min(60*s[..2].parse::<u32>().unwrap()+s[3..].parse::<u32>().unwrap())

Try it online!
Unfortunately type inference for parse is very restricted and the turbofish must be used every time.
I also made some versions using fold instead of parse, but they are longer:
With a tuple accumulator and a closure to combine minutes and seconds:
|s:&[u8]|6000.min((|(a,b)|60*a+b)(s.iter().fold((0,0),|(a,b),x|match x{58=>(b,0),_=>(a,10*b+*x as i32-48)})))

Using a [i32;2] accumulator and .iter().sum()
|s:&[u8]|6000.min(s.iter().fold([0,0],|[a,b],x|match x{58=>[60*b,0],_=>[a,10*b+*x as i32-48]}).iter().sum())

And then there's this ungodly abomination using std::ops::Range<i32> as an accumulator, with -60*minutes as the start and seconds as the end. Eww.
|s:&[u8]|6000.min(s.iter().fold(0..0,|a,x|match x{58=>-60*a.end..0,_=>a.start..10*a.end+*x as i32-48}).len())

APL+WIN, 20 bytes
Prompts for time as string:
6E3⌊60⊥(⍎2↑n),⍎3↓n←⎕

Try it online! Courtesy of Dyalog Classic

Burlesque, 19 bytes
ps1RAp^60.*.+6000<.

Try it online!
Explanation:
ps                  # Parses input string as block: mm:ss => { mm ":" ss }
  1RA               # Removes element at index 1 from block: { mm ss }
     p^             # Splits block to stack
       60.*         # Multiply top element by 60
           .+       # Sum both elements
             6000<. # Return the minimum of the calculated value or 6000

Husk, 13 bytes
y6000B60mrx":

Try it online!
Explanation
          x":    Split on colons
        mr       Convert from string form
     B60         Interpret in base 60
y6000            Minimum with 6000

Java (JDK), 67 bytes
t->Math.min(6e3,new Long((t=t[0].split(":"))[0])*60+new Long(t[1]))

Try it online!
Credits

-4 bytes thanks to Kevin Cruijssen by changing the input type to an array of Strings.

Way longer than what I'd have expected at first.

67 bytes by taking the input wrapped in an array, which is allowed by default according to the meta.

CJam, 17 bytes
q':/:i~\60*+6e3e<

Try it online!
q':/:i~\60*+6e3e<  e# Whole program
q                  e# Read input          [e.g "99:98"]
 ':/               e# Split on :          [e.g ["99" "98"]]
    :i             e# Convert to integers [e.g [99 98]]
      ~\           e# Dump and swap       [e.g 98 99]
        60*        e# Multiply by 60      [e.g 98 5940]
           +       e# Add                 [e.g 6038]
            6e3e<  e# Get minimum to 6000 [e.g 6000]
                   e# Implicit output

Befunge-93 (FBBI), 25 bytes
"<|`*"<d":+&*&
@.<
*"<d@.

Try it online!
Explanation:
The program consists of three parts (lines), the first one processes the input:
"<|`*"<d":+&*&    Stack                              IP direction

                  empty                              east
"<|`*"          push everything between the two quotes
                  42, 96, 124, 60                    east
      <         turn west
                  42, 96, 124, 60                    west
"<|`*"          push everything between the two quotes
                  60, 124, 96, 42, 42, 96, 124, 60   west
            *&  take an integer (minutes), convert to seconds
                  60*m, 124, ...                     west
          +&    take the next int, add to the total
                  60*m+s, 124, ...                   west
         :      duplicate TOS
                  60*m+s, 60*m+s, ...                west
    *"<d"       push 60*100 = 1000
                  6000, 60*m+s, 60*m+s, ...          west
   `            is greater than?
                  6000 > 60*m+s, 60*m+s, ...         west
  |             north-south if
                  60*m+s, ...                        north / south

If the total number of seconds is smaller or equal to 6000, the IP moves south and enters the second line:
@.<               Stack                              IP direction

                  60*m+s, ...                        south
  <             turn west
                  60*m+s, ...                        west
 .              print integer
                  124, ...                           west
@               Stop

If the number of second is greater than 6000, the IP moves north and enters the last line:
*"<d@.            Stack                              IP direction

                  60*m+s, ...                        north
  <             turn west
                  60*m+s, ...                        west
*"              push everything up to the next quote ...
 "<d@.          ... which is actually the same one.
                  60, 100, 64, ...                   west
*               Stop
                  6000, 64, ...                      west
     .          print 6000
                  64, ...                            west
    @           Stop

Pyth, 16 15 bytes
hS,6000ivcQ\:60

Try it online!
hS,6000ivcQ\:60   Implicit: Q=input()
         cQ\:     Split Q on ":"
        v         Convert each from string to integer
       i     60   Convert from base 60
  ,6000           Pair with 6000
 S                Sort
h                 Take the first element (i.e. smallest)
                  Implicit print

Edit: Previous version: hS,6000isMcQ\:60

Julia 54 53 52 bytes
f(x)=((i,j)=parse.(Int,split(x,":"));min(60i+j,6e3))

try it online
A single line solution for Julia.
A couple neat tricks here, we use f(x)=, a generic function declaration so we don't have to use the return end or function keywords.
We then use a compound expression like this (code;code;...).
Unfortunately, when using tuple destructuring i,j=, the tuple here must be wrapped in parenthesis for some reason, which adds two bytes.
Edits:

1 byte improvement using 60i instead of 60*i
1 byte improvement by removing trailing whitespace

C# (.NET Core) 77 bytes
s=>Math.Min(60*int.Parse(s.Substring(0,2))+int.Parse(s.Substring(3,2)),6000);

It assumes that the position of the colon is always 3
Try it online

C# (.NET Core), 76 bytes
s=>Math.Min(s.Split(':').Select(int.Parse).Aggregate((e,i)=>(e*60+i)),6000);

Try it online

Welcome to the site and nice first answer! Be sure to check out our tips for golfing in C# page for any improvements you can find!

Welcome. Nice first answer! You don't have to count the trailing ; for lambda functions in C#/Java, so that can move to the footer in your TIO. As for golfs, the 6000 can be 6e3 for -1 (the return-type changes from int to double though). :) Enjoy your stay, and good luck with future challenges.

PowerShell, 50 48 bytes
-2 bytes thanks to mazzy
$a,$b=$args-split':'
[Math]::min((60*$a+$b),6e3)

Try it online!

welcome back :) Try it online!

@mazzy Thanks, it has been awhile.

Scala, 66 61 bytes
For those who like to live dangerously and assume things beyond a method's contract...
io.StdIn.readLine split ":"map(_.toInt)reduce(_*60+_)min 6000

reduce is not guaranteed to work from left to right, but it seems to do so by default.
Try it in Scastie

V (vim), 18 bytes
f:i*60<Esc>lr+0C<c-r>=<c-r>"
<Esc>

Try it online!

Io, 52 bytes
Port of the Python answer.
method(x,doString(x split(":")join("*60+"))min(6e3))

Try it online!

R, 46 bytes
`:`=c;min(6e3,eval(parse(t=scan(,"")))%*%60:1)

Try it online!
Just redefine : so that we can just use eval to concatenate the hours and minutes together, and do a dot product with c(60,1) to get the seconds.

Dart, 88 bytes
import'dart:math';f(s)=>s.split(":").map(int.parse).reduce((v,e)=>min<num>(v*60+e,6e3));

Try it online!

The types and the unwrap make this longer than it could be otherwise.
Rust, 121 bytes
use std::cmp::min;fn f(s:&str)->i32{let x:i32=s[..2].parse().unwrap();let y:i32=s[3..].parse().unwrap();min(x*60+y,6000)}

Try it online!
Explanation:
6000 had to be used because 6e3 is considered a float. 6e3 as i32 is longer than simply using 6000. In production code I would have written it 6_000 but saving the character is the game.
min is not imported by default. So we have to pay for that import.
parse does the work of other languages type casting. But since it could fail we also need the unwrap. String to int conversions are costly in golf for Rust. Using ? operator could in theory save us the unwrap but then the type for the return needs to be much longer:
Result<i32, std::num::ParseError>. That also means the collect has to know about the Result too. We also have to wrap the final return in Ok(). So not much gain there.
I looked at using split but it ends up being longer due to working to get the tuple back out of the resulting iterator.

Julia, 71 bytes
 function f(x)
        m,s=parse.(Int,split(x,":"))
        return min(m*60+s,6e3)
 end

Try it online!
The part which was most interesting to me here, is the parse.() which parses each element in the array. Note the dot operator before the parentheses.
Could have knocked off one more byte by putting show() in the function instead of return. But, the footer or output box, on tio, wind up a bit of a mess due to the lack of new lines from show.
 function f(x)
        m,s=parse.(Int,split(x,":"))
        show(min(m*60+s,6e3))
 end

Welcome to CGCC! It seems like you can remove some of the whitespace: Try it online!

Thanks @ovs, I spent a little while trying to figure out how to make it one line or maybe use the -> anonymous function. But, I don't know Julia that well (this is honestly the first thing I've ever written in Julia.) This is also my first code golf. Should I put you in as current lead?

Python 3.8 (pre-release), 56 bytes
lambda x:min(int((k:=x.split(":"))[1])+60*int(k[0]),6e3)

Try it online!

Golfscript, 28 bytes
":"/~~\~60*+.6000.@<{\}{}if;

Try it online!

C# (.NET Core) 88 87 bytes
s=>{var x=s.Split(':').Select(int.Parse).ToList();return Math.Min(60*x[0]+x[1],6000);};

Try it online
Removed trailing newline for 1 byte saving

JavaScript (V8), 47 bytes
i=>Math.min(6e3,(i[0]+i[1]-0)*60+(i[3]+i[4]-0))

Call the function with the input string

Go 1.21+, 93 92 bytes
import."fmt"
func f(t string)int{var m,s int
Sscanf(t,"%d:%d",&m,&s)
return min(6e3,m*60+s)}

Attempt This Online!
Uses the brand new builtin min function to save 13 bytes.
Go 1.20.x, 106 104 bytes
import."fmt"
func f(t string)int{var m,s int
Sscanf(t,"%d:%d",&m,&s)
o:=m*60+s
if o>6e3{o=6e3}
return o}

Attempt This Online!

92 bytes

and 104 bytes for the 1.20.x answer

ARBLE, 31 bytes
min(6e3,sub(s,1,2)*60+sub(s,4))

Try it online!

AWK, 30 bytes (27 bytes + 3 penalty for -F:)
$0=6000<(a=$1*60+$2)?6000:a

Try it online!
Pretty straightforward one...  Relies on -F: to shorten the code needed to access mins/secs components of the input.
         a=$1*60+$2          - temp variable w/ simple calc of time
$0=6000<(          )?6000:a  - ternary to cap limit at 6000

Thunno 2, 10 bytes
':/60ḋ«ç⁷Ọ

Try it online!
Explanation
':/60ḋ«ç⁷Ọ  '# Implicit input
':/         '# Split it on ":"
   60ḋ       # Convert from base 60
      «ç⁷    # Push 6000
         Ọ   # Dyadic minimum
             # Implicit output

Python, 95 Bytes
lambda i: f"Lower"if(int(i[0:2])*60)+int(int(i[3:5]))>6000else(int(i[0:2])*60)+int(int(i[3:5]))

Example Input:
76:92 # String input

Example Output:
4652 # Number of seconds

Note: You do have to call the function and print it separately
Try it online!

Welcome to Code Golf, and nice answer!

I believe int(int(i[3:5])) could be shortened to remove the redundant int call, right?

Anonymous functions are allowed, so you can remove the f= part to reduce it by 2 bytes.

Pure Bash, 35 bytes
echo $[s=${1/:/*60+},s>6000?6000:s]

Try it online!
Pure Bash, 36 bytes
echo $[(r=${1/:/*60+})>(b=6000)?b:r]

Try it online!

Itr, 15 bytes
ê©àé2+à©·+6000m
online interpreter
Explanation
ê©àé2+à©·+6000m ; implicit input
ê               ; split input into two parts '##:' and '##'
 ©              ; evaluate the second part to get the number of seconds
  à             ; swap
   é            ; split of the last character ':'
    2+          ; add 2 to ':' (ascii 58) giving 60
      à         ; swap
       ©        ; evaluate the number of minutes
        ·       ; multiply minutes by 60
         +      ; add seconds
          6000  ; literal 6000
              m ; minimum
                ; implicit output

Desmos, 43 bytes
Takes input in the form of a ASCII code array. Use this to convert testcases to ASCII codes.
f(S)=min(total([600,60,0,10,1](S-48)),6000)

Try it on Desmos!

Swift, 63 57 bytes
{min(Int(($0+"").prefix(2))!*60+Int($0.suffix(2))!,6000)}

Assign this closure to something and call it with the time in "##:##" format (or just call it directly).

Since a Swift String can't be indexed using an Int (blame Unicode support, though you'd be surprised just how rare String indexing is in well-written, real-life code), I had to use the prefix(_:) and suffix(_:) methods instead.

PARI/GP, 59 bytes
f(x)={s=strsplit(x,":");min(60*eval(s[1])+eval(s[2]),6000)}

Attempt This Online!

Nibbles, 15 nibbles (7.5 bytes)
[6000+*60$;$

Attempt This Online!
Explanation
      *60$   # multiply first part of input by 60
     +    ;$ # add second part of input
[6000        # return lesser of sum and 6000

YASEPL, 43 bytes
=s=1'±colon!¥0,1*60=m¥1,1!+m}2,6000$6000`1<

explanation:
=s=1'±colon!¥0,1*60=m¥1,1!+m}2,6000$6000`1<           packed
=s                                                    set total time in seconds (S)
  =1'                                                 get user input and set it to var1
     ±colon                                           split it by ":"
           !¥0,1*60                                   set S to var1[0] (minutes) and multiply it by 60
                   =m¥1,1!+m                          set M to var1[1] (seconds) and add it to S
                            }2,6000$6000`1            if S > 6000, set it to 6000
                                          <           print S once done


text:
Make paper snowflakes!
The task
Given a folded and cut in places snowflake, "unwrap" it and output the result
Input
The base folded snowflake, without any cuts, looks like:
|\
| \
|  \
|   \
|    \
|     \
|      \
|       \
|________\

And the input will always resemble this.
No changed or added symbols will go out of the range of this triangle, so
 |\
 | \
-|  \
 |   \  o 0
 |    \
 |     \
 |      \.
 |       \
 |________\

is not a valid input.
Possible changes and additions:

Corner cuts

minimal cut:
 _
| \
|  \
|   \
|    \
|     \
|      \
|_      \
  |_____/

Big, different cuts with cuts in them:

|\_/\
|    \
|     \
|___   \
   _|  _|
  |___/

Side cuts

minimal cuts, in random places on the sides:

|\
| \
|  \
|  |_
|    \
 \    \
 /     \
|       \
|____/\__\

Big, recursive cuts:
|\
| \
 \ \
  \|
  /|
 | |  _
 / |_| \
| |\___ \
|_|    \_\

And, of course, both types can be present at the same time.
Output
An "unfolded" snowflake. Here is an explanation of the unfold:
Say we have a snowflake
 __
|  \
|   \
|    \
 \    \
 /     \
|       /
|______/

Which we will, for the explanation, remake as:

 aa
1  1
2   2
3    3
 b    4
 b     5
1       c
2123456c

Where each uncut piece of sides is numbered from 1 to 9, and each cut has its own letter.
On the first unfold, you will get
    123  12
   a   bb 1
 aaa      2
1         3
2         4
3         5
 b        c
 b       c
1       c
2123456c

Which looks like
    ___  __
   |   \/ |
 __|      |
|         |
|         |
|         |
 \       /
 /      /
|      /
|_____/

Then, on the next unfold, we get:
    123  1221  321
   a   bb    bb   a
 aaa              aaa
1                    1
2                    2
3                    3
 b        cc        b
 b       c  c       b
1       c    c       1
2123456c      c6543212

Which looks like

    ___  ____  ___
   |   \/    \/   |
 __|              |__
|                    |
|                    |
|                    |
 \        /\        /
 /       /  \       \
|       /    \       |
|______/      \______|

If you would want another unfold, the scheme looks fine:

    123  1221  321
   a   bb    bb   a
 aaa              aaa
1                    1
2                    2
3                    3
 b        cc        b
 b       c  c       b
1       c    c       1
2      c      c      2
2      c      c      2
1       c    c       1
 b       c  c       b
 b        cc        b
3                    3
2                    2
1                    1
 aaa              aaa
   a   bb    bb   a
    123  1221  321

Until you actually make it in ascii:

    ___  ____  ___
   |   \/    \/   |
 __|              |__
|                    |
|                    |
|                    |
 \        /\        /
 /       /  \       \
|       /    \       |
|      /      \      |
|      \      /      |
|       \    /       |
 \       \  /       /
 /        \/        \
|                    |
|                    |
|                    |
 __|              |__
   |   /\    /\   |
    ___  ____  ___

So, for this challenge, I have chosen not to go for another unfold.

Here is another example on one of the snowflakes, without the scheme:
|\
| \
|  \
|   \
 \   \
 /    \
|      \
|  /\   \
|_/  \__/

Then, on the first unfold turns to:
____  ____
|   \/    |
|         /
|        /
|        \
 \        \
 /        |
|         |
|  /\    /
|_/  \__/

And then:
 ____  ________  ____
|    \/        \/    |
|         /\         |
|        /  \        |
|        \  /        |
 \        \/        /
 /                  \
|                    |
|  /\            /\  |
|_/  \__________/  \_|

Notice how, on the first unfold, the bottom side of the triangle translates to the right side of the square and, the same, with the left and top side.
Output
The final result, so
 ____  ________  ____
|    \/        \/    |
|         /\         |
|        /  \        |
|        \  /        |
 \        \/        /
 /                  \
|                    |
|  /\            /\  |
|_/  \__________/  \_|

for the example.
This is code-golf, so lowest byte-count wins!

I still don't understand the first unfolding. In your first example (right below the "Output" heading), the bottom edge has 123456, but the unfolded right edge has only 12345. Where does the 6 go?

Why do in the second example the bottom three left-hand side | become four top-right _ after the first unfold?

Also in the second example (second unfold): where did the bottom gap go? Shouldn't the result be this instead? Although in that case I'm also wondering why the two _ at the bottom have become three _ from the first to second unfold.


text:
Reverse factorial function
Given a number n, find x such that x! = n, where both x and n are positive integers. Assume the input n will always be the factorial of a positive integer, so something like n=23 will not be given as input.
Examples: n=1 -> x=1 (0 is not a positive integer), n=24 -> x=4
Shortest code wins.

Btw, we once had a similar challenge but 1) it's pretty old 2) it's over real numbers, not just positive integers 3) it bans factorial-related built-ins, which isn't quite good for our current standards. So I think the challenge itself is fine and not a dupe.

Is there an upper bound on the possible inputs?

What are the bounds on the input? Can we assume that it is no more than 19! (largest factorial that can be fully represented in a 53+11 double precision floating point), no more than 23! (largest factorial that can be accurately represented in a double precision 53+11 floating point), or no more than 170! (largest factorial whose magnitude is less than the maximum of a double precision floating point ~= 10^308)

@JDL I'm not the challenge author, but I'd say "up to the highest number that your language's number type supports (without loss of precision), but the underlying algorithm should work for higher numbers". Related standard loophole.

@Bubbler: the question does not limit the input number in any way except that x and n are positive integers. As such 646077305624121491462330357080396430806673805704796612248389053020040737981389397373513335318926846519441974218777961448245634895440330929720840926954349439434654453860427703550673839109903970520283495061590634864022312082259902655711571689179112428197039756156051147969300077437438615382409042832551650139224687809841080780412598454920634889005911333104355143592477664451230317936640000000000000000000000000000000000000000000000000000000 is a perfectly valid value for n :-)

Python 2, 28 bytes (input \$\leq2^{64}\$)
lambda n:len(`n**8L`)**.6//1

Try it online!
This works on inputs up to \$20! =2432902008176640000 \$ that fall within 64-bit integers.
This uses an approximate fit inspired by Stirling's approximation. However, the constants were estimated manually and it breaks down for larger values. With Python not having a built-in log, we use the digit-length for \$n^8\$ as an approximation for \$c\cdot\log(n)\$. Actually, we use the long value 8L so that the string representations uniformly end in L for "long", which adds one to the lengths.
From there, raising the value to the power of \$0.6\$ and taking the integer part is apparently sufficient to give the correct output up to \$20!\$. It's lucky that the 0.6 is 0.60, since we'd usually need another digit of precision.

I think you should not have posted this before OP replied as we seem to have a consensus that the algorithm must work for all possible inputs in theory.

@mypronounismonicareinstate  It's complicated. There's always been a thorny question in Python 2 whether number inputs fall within the integer type (up to 2^64) rather than the (unbounded) long type. Python accepts inputs larger than this and interprets them as longs, where some other languages just fail.  Pretty much all golfs that use backticks for string representation (which have a trailing L on longs) fail on large inputs. So, a quite a number of Python 2 answers on the site have been making this assumption. Of course, here I use it for a different reason, of a limited approximation.

APL (Dyalog Extended), 2 bytes
¯!

Try it online!
Exactly the same as non-extended APL answer but just with the shorter syntax.
! is factorial function, ¯ prefix gives the inverse function of it.

It reads: inverse factorial

@Λ̸̸ This is a macron (high minus), not a backtick, anyway, TryAPL (which runs a normal Dyalog APL) doesn't support this extension.

Python 2, 32 bytes
f=lambda n,k=2:n and-~f(n/k,k+1)

Try it online!

Jelly, 3 bytes
!€i

Try it online!
  i    The first index (from 1) of the input in
!€     the factorials of every integer from 1 to the input.

My first attempt was Æ!L’, which is just plain silly.

Ruby, 27 bytes
->n,x=0{2>n/=x+=1or redo;x}

Try it online!
Increment the divisor x (initially 0), divide n (initially the input value) by x and store the result as n, repeat until n=1. Then x is the desired output.

Brachylog, 3 bytes
ℕ₁ḟ

Try it online!
A predicate which takes input reversed (i.e., the input is given through the output variable, and the output is given through the input variable). Brachylog more-or-less has a builtin for exactly this, aside from needing to apply the additional constraint of having to output a positive integer, where I say more or less because it's also just the factorial builtin and it works in both directions.

C (gcc), 33 29 28 bytes
Saved a byte thanks to ceilingcat!!!
x;f(n){for(x=0;++x-n;n/=x);}

Try it online!

J, 4 bytes
!inv

Try it online!
Inverse of factorial.

Wolfram Language (Mathematica), 20 bytes
Mathematica has the inverse function of the factorial! It's called InverseFunction@Factorial. I used a pure (Mathematica for "anonymous") function that returns the factorial by using the exclamation mark, as it's shorter.
InverseFunction[#!&]

Try it online!

the output is a Little messed up, but 13 bytes with Solve: https://tio.run/##y00syUjNTSzJTE7872Yb8z84P6csNVrZ1rZCMVbtf0BRZl6Jg1u0oYFi7H8A

@ovs you can use quiet Try it online!

Huh, I didn't know Solve doesn't need a variable. I don't think Quiet is needed, because we normally ignore warnings (and Mathematica errors seem to be only warnings for some reason)

@mypronounismonicareinstate it is only for presentation purposes...

The iterative (For[x=0,x!<#,++x];x)& is only 22 bytes; I wonder if there's a way to golf it below 20.

@GregMartin x&@For[x=0,++x!<#,]& is 20, and 1//.x_/;x!<#->x+1& is 18.

05AB1E, 4 bytes
Å!g<

Try it online!

Retina 0.8.2, 39 bytes
.+
1 $&$*
+`^(1+) (1\1)+$
1$1 $#2$*
\G1

Try it online! Link includes test cases. Actually calculates the largest factorial that divides n. Explanation:
.+
1 $&$*

Set x to 1 and convert n to unary.
^(1+) (1\1)+$
1$1 $#2$*

If x+1 divides n, then increment x and divide n by the incremented x.
+`

Repeat the above until x+1 does not divide n (hopefully because n=1 at this point).
\G1

Convert x to decimal.

R, 29 28 bytes (input ≤170!)
match(scan(),cumprod(1:170))

Try it online!
Input is limited to 170!, which is the largest factorial that can be handled as a floating-point number by R; in any case, at larger values, there is a risk that truncated digits in the internal floating-point encoding will affect the output.  Obviously the second issue will be fixed when run on an imaginary 'unlimited-precision' R implementation, but the input limitation will always be there (or, with slight modification, a limitation to ≤999!).  So...
R, 38 34 bytes
n=scan();while(n>(T=T*(F=F+1)))n;F

Try it online!
Edit: -4 bytes thanks to tip from Giuseppe
This version is still subject to the precision limitations of the R implementation, but could (in principle) be run with unlimited input.
Edit: Obviously the large increase in program length to achieve the unimplemented ability to run on unlimited input is rather unsatisfying, so...
R, 30 29 bytes
match(n<-scan(),cumprod(1:n))

Try it online!
Only one-byte longer than the input-limited attempt.  Unfortunately, on all current R implementations, it is rather slow and is likely to crash with anything but small input values, but - in the words of Osgood Fielding III - 'well, nobody's perfect'

65 bytes using the gmp package's arbitrary precision integers -- match does something weird with bigz, I'm afraid.

First of all: thanks for the T as a variable idea!  I will immediately incorporate this, and the obvious follow-up...

And secondly: I think you should post the arbitrary-precision gmp solution: I didn't know about this at all until you showed it to me.  I think it can be reduced a little, too: https://tio.run/##dYtLbsJQEAT33MI7O0joTc/nTWOZpU/AASAoIkjEisIiEpc37wLUrlVdf@t66k7T9ed3vz8/dp@363Ncpu5xOS/9MP5/3@5f/XLoj9Pxo5@nedvJMAzLOK9URUDcTGkmjkgJEprpgYhairFUcUYiTJuFWKQTDE06pDobCpDiUZLWDsoabbkkMuAarERJVECrJ1wkW1sokWHlDZv1BQ

(& how do you include a link in the comments with a chosen name, instead of the entire http... ?)

You use [link name](link). I think the little "help" at the bottom right of the comment box, below "Save Edits" (on desktop) will expand out some comment formatting tips.

The first one is limited to 22!, not 170! — take a look at cumprod(1:23) — the last entry is 25852016738884978212864 which isn't actually 23 factorial. It saves you a byte so it's good news!

@JDL - This is what I meant by "truncated digits in the internal floating-point encoding will affect the output".  This would be ameliorated (or avoided entirely) by an implementation of base R that used higher- (or unlimited-)precision numbers, though, so I think it's different to the code-defined limit to 170!  Anyway, I admit that for both these reasons it's not perfect; hence the alternatives...

@JDL - After running a quick test, it seems that (probably by luck, not skill) the first one actually outputs the correct values all the way up to 170!.

fair enough — I'm still not certain exactly how it works (possibly match doing a character match instead of a numeric one?) but there's no arguing with those results :)

Pyth, 4 bytes
.I*F

Try it online!
Explanation
.I*F
.I    : Inverse function of
  *F  : factorial

Pyth, 6 5 bytes
fqQ*F

Try it online!
-1 byte thanks to @FryAmTheEggman
Explanation
fqQ*F
f      : First positive integer value where
  Q    : input
 q     : is equal to
   *F  : factorial of value

Rearranging can save you a byte: fqQ*F.

dc, 22 bytes
0?[r1+d_3R/d1<F]dsFx/p

Try it online!
Input on stdin, and output on stdout.
Works for arbitrarily large inputs (up to the available memory).  The TIO sample run is for 200!.
How it works
The description below presumes that the input is a factorial (so all the divisions have no remainder).
0
?     # Stack is now (top of stack on right):
      #    x n
      #    where x = 0 and n is the input number.
[     # Define a macro (to be used as a loop).
      #    If we write the stack as
      #    x n
      #    then we assert the following loop invariant at this point in the cycle:
      #       n = input / x!
  r      # Swap.        Stack: n x
  1+     # Increment.          n x+1
  d      # Duplicate.          n x+1 x+1
  _3R    # Rotate 3 steps clockwise.
         #                     x+1 n x+1
  /      # Divide.             x+1 n/(x+1)
  d1<F   # If n/(x+1) > 1, go back to the beginning of the loop.
         #    Note that the loop invariant is once again true,
         #    as it should be at the beginning of a new loop iteration.
]dsFx # End macro, call it F, and execute it.
      # When we leave the loop, we know the following, where 'x n' is the current stack:
      #   (1) the loop termination condition was false, so n <= 1,
      #       and we must actually have
      #       n = 1
      #       because the input was a factorial;
      #   and
      #   (2) the loop invariant is true, so n = input / x!
      #
      #   It follows that x! = the input, and the stack is now:
      #                              x 1
/     # Divide (to pop the 1).       x
p     # Print top of stack.

[MATLAB/Octave], 35 34 26 bytes
f=@(n)nnz(cumprod(1:n)<=n)

Thanks @David for the feedback! I added the f= to have way to call the function for 2 bytes.

I tried values up to 10^7. It took about 40 seconds but it does work!

This doesn't work in Matlab. I think it returns n not x, it calculates factorial(1:24) then finds the last entry less than or equal to n, instead you want the last index where A<=n. It's also not Matlab code. Instead, in Matlab, you could do nnz(factorial(1:n)<=n) (or sum instead of nnz). You can replace factorial(1:n) by cumprod(1:n) to save 2 chars, so nnz(cumprod(1:n)<=n) works for 20 bytes, but convention here is that answers should be programs, you can't use the stored value n. So this should work: @(n)nnz(cumprod(1:n)<=n) in Matlab at least for 24 bytes.

Thanks for the comment, I guess I missed that. I'm using Octave so the result may vary slightly.

I believe you don't actually need the two bytes for the f= as the result get automatically assigned to the value ans. Hence 24

SWI-Prolog, 50 bytes
:-[library(clpfd)].
c(F,N):-F#=1,N#=1;c(F//N,N-1).

Try it online!
c(F,N) recursively defines factorials, either F = N = 1, or F/N is (N-1)!. To save bytes we used integer division, so the answer is only valid if F is actually a factorial. Prolog infers the correct value for N if not specified.
Algorithm should work for all inputs, although it isn't particularly fast. Tested up to 128!.

Welcome to the site!  I love seeing prolog.  We have a tips page for prolog here which you can read or contribute on.

Clojure, 73 bytes
(defn f[n](loop[x 1](if(= n(reduce *'(range 2(inc x))))x(recur(+ x 1)))))

Ungolfed:
(defn find-fact [n]  ; n = x!. Find x
  (loop [x 1]
    (if (= n (reduce *' (range 2 (inc x))))
      x
      (recur (+ x 1)))))

Tested out to 1234!, which is the 3281 digit number 51084981466469576881306176261004598750272741624636207875758364885679783886389114119904367398214909451616865959797190085595957216060201081790863562740711392408402606162284424347926444168293770306459877429620549980121621880068812119922825565603750036793657428476498577316887890689284884464423522469162924654419945496940052746066950867784084753581540148194316888303839694860870357008235525028115281402379270279446743097868896180567901452872031734195056432576568754346528258569883526859826727735838654082246721751819658052692396270611348013013786739320229706009940781025586038809493013992111030432473321532228589636150722621360366978607484692870955691740723349227220367512994355146567475980006373400215826077949494335370591623671142026957923937669224771617167959359650439966392673073180139376563073706562200771241291710828132078928672693377605280698340976512622686207175259108984253979970269330591951400265868944014001740606398220709859461709972092316953639707607509036387468655214963966625322700932867195641466506305265122238332824677892386098873045477946570475614470735681011537762930068333229753461311175690053190276217215938122229254011663319535668562288276814566536254139944327446923749675156838399258655227114181067181300031191298489076680172983118121156086627360397334232174932132686080901569496392129263706595509472541921027039947595787992209537069031379517112985804276412719491334730247762876260753560199012424360211862466047511184797159731714330368251192307852167757615200611669009575630075581632200897019110165738489288234845801413542090086926381756642228872729319587724120647133695447658709466047131787467521648967375146176025775545958018149895570817463048968329692812003996105944812538484291689075721849889797647554854834050132592317503861422078077932841396250772305892378304960421024845815047928229669342818218960243579473180986996883486164613586224677782405363675732940386436560159992961462550218529921214223556288943276860000631422449845365510986932611414112386178573447134236164502410346254516421812825350152383907925299199371093902393126317590337340371199288380603694517035662665827287352023563128756402516081749705325705196477769315311164029733067419282135214232605607889159739038923579732630816548135472123812968829466513428484683760888731900685205308016495533252055718190142644320009683032677163609744614629730631454898167462966265387871725580083514565623719270635683662268663333999029883429331462872848995229714115709023973771126468913873648061531223428749576267079084534656923514931496743842559669386638509884709307166187205161445819828263679270112614012378542273837296427044021252077863706963514486218183806491868791174785424506337810550453063897866281127060200866754011181906809870372032953354528699094096145120997842075109057859226120844176454175393781254004382091350994101959406590175402086698874583611581937347003423449521223245166665792257252160462357733000925232292157683100179557359793926298007588370474068230320921987459976042606283566005158202572800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Rust, 41 32 bytes
|mut y|(1..).find(|x|{y/=x;y<2})

Try it online!
The .unwrap() was unnecessary (Meta post), saving 9 bytes

Factor + math.factorials, 41 32 bytes
Saved 9 bytes thanks to @Bubbler!
[ dup [1,b] [ n! = ] with find ]

Try it online!
Factor, 50 34 bytes
Saved 16 bytes thanks to @Bubbler!
[ 1 over [1,b] [ * 2dup = ] find ]

Try it online!
There's probably a better idiom for this, but I can't find it right now.

If you decide to use math.factorials, n! is a golfier synonym of factorial. Also, using with seems to be slightly shorter here.

Also, the quotation used in sequence functions can access the items under it, so something like this is possible.

@Bubbler Thanks, I should have noticed n!. with looks like a pretty interesting function.

Husk, 4 bytes
€mΠN

Try it online!
€     the index of implicit input in ...
 mΠ   ... map factorial over ...
   N  ... the natural numbers

Erlang (escript), 45 bytes
Quite similar with ovs's Python answer.
f(1.0,Y)->Y;f(X,Y)->f(X/Y,Y+1).
f(X)->f(X,2).

Try it online!

COW, 108 bytes
oomMOoMOOMoOMMMOOOmoOMMMmoOMoOmOoMOOmoOMMMmoOMMMMOOMOomOomOoMOomoOmoOmoomOomOomOoMoOmoOmoomOoMOomoomoOmoOOOM

Try it online!
Explanation
moo ]    mOo <    MOo -    OOO *    OOM o
MOO [    moO >    MoO +    MMM =    oom ^

[0]: n/(i!)     [1]: n/((i-1)!)     [2]: i     [3]: i_temp

^-                   ;  Read i in [0] and decrement it
[                    ;  Loop while [0] is non zero ( n/(i!)-1 is checked )
    +=*>=            ;      [0] is incremented and cut/copied in [1]
    >+<              ;      [2] is incremented
    [                ;      Loop while [1] is non zero ( repeated subtraction begins )
        >=>=         ;          Copy [2] in [3]
        [            ;          Loop while [3] is non zero
            -<<->>   ;              [3] and [1] are decremented ( [1] is guaranteed to be divisible by [3] )
        ]            ;
        <<<+>        ;          [0] is incremented
    ]                ;      [0] is now the product of the biggest x-i factor of n
    <-               ;  [0] is decremented so iff [0] = 1 the loop ends
]                    ;
>>o                  ;  Print [2] x

Excel, 29 bytes
=MATCH(A1,FACT(ROW(1:170)),0)

APL (Dyalog Unicode), 4 bytes
I was just copying Bubbler's solution. I didn't write it, so it's community wiki.

!⍣¯1

Try it online!
Explanation
 ⍣¯1 The inverse of this function:
!    Factorial function

Charcoal, 17 bytes
Ｎθ⊞υ¹Ｗ‹Πυθ⊞υＬυＩ⌈υ

Try it online! Link is to verbose version of code. Actually calculates the lowest factorial not less than n. Explanation:
Ｎθ

Input n.
⊞υ¹

Push 1 to the predefined empty list.
Ｗ‹Πυθ

Repeat while the product of the list is less than n.
⊞υＬυ

Push the length of the list to the list. (This means that the list has an extra 1 in it, but conveniently that doesn't affect the product.)
Ｉ⌈υ

Output the largest element of the list (which is also the last element; either operation works.)

SimpleTemplate, 72 bytes
Not exactly the smallest, but works.
Uses a naive approach to calculate the factorial up to the chosen number, returning the value if found.
{@setf 1}{@forfrom 1toargv.0}{@set*f f,_}{@iff is equalargv.0}{@return_}

Notice that this is a REAL {@return}! The compiler method will give you this value.
To be used as a function, simply wrap it in {@fn invert_factorial} [...] {@/}.

Ungolfed version
This should be easy to understand
{@set factorial 1}
{@for i from 1 to argv.0}
    {@set* factorial factorial, i}
    {@if factorial is equal to argv.0}
        {@return i}
    {@/}
{@/}

The line {@set* factorial factorial, i} simply stores ,in factorial, the result of multiplying the value factorial to i.

You can test this on:
http://sandbox.onlinephpfunctions.com/code/61cc7101a868a71d0a7a85cdde57f946bcb2586e

Rust, 57 bytes
fn f(mut y:i32)->i32{let mut x=1; while y>1{x+=1;y/=x;}x}

Try it online!

R, 56 52 bytes
function(n){while(n>(T=T*(F=F+gmp::as.bigz(1))))1;F}

Try it online!
Thanks to Dominic van Essen for the golfs and bug catch!
Takes input as a string.

Why do you need the extra ;n at the end?  All it seems to do is print back the input...?

@DominicvanEssen oops! I was testing my scan() theory to see about double loss of precision and forgot to take it out. Thanks for the catch!

On my installation of R3.6.2, the following 52 byte function works function(n){while(n>(T=T*(F=F+gmp::as.bigz(1))))1;F}, and accepts either numeric input or a string for big numbers (factorial(gmp::as.bigz(200))).  But for some reason that I don't understand, it won't run on 'Try it online'...

I don't know what I was doing wrong; it seems to work ok now

@DominicvanEssen that's clever! I think the fact that > coerces its arguments' types would be worth adding as a tip!

What happened to the byte count...?

@Bubbler it's been a long week.

Julia, 36 bytes
Try it!
julia> f=n->findfirst(x->factorial(x)==n,1:n)

julia> @benchmark f(121645100408832000)
BenchmarkTools.Trial:
  memory estimate:  0 bytes
  allocs estimate:  0
  --------------
  minimum time:     32.801 ns (0.00% GC)
  median time:      33.246 ns (0.00% GC)
  mean time:        33.661 ns (0.00% GC)
  maximum time:     56.452 ns (0.00% GC)
  --------------
  samples:          10000
  evals/sample:     993

Welcome to Code Golf, and nice first answer. You can use Try it online! to let people try your code online. It also calculates the byte count and generates the SE answer for you. You can use it like this. You can exclude the f= part from the byte count since it works as an anonymous inline function.

You can also switch to an older Julia version and save a few bytes by using gamma instead of factorial: 34 bytes

@Bubbler Thanks for the tips, I'm new to the community and looking forward to contribute.

Burlesque, 17 bytes
b01{+.}{?!.>}w!it

Try it online!
Explanation:
b0                # Parse input as base 10 integer
  1               # Push counter to the stack
   {+.}      w!   # Increment counter while
       {?!.>}     # The input is greater than the factorial of the counter
               it # Return just the counter

PowerShell, 34 bytes
param($n)for(;++$x-$n;$n/=$x){};$x

Try it online!

nice. PS allows you to skip the ; after the operators for, if, param and etc. Try it online!

05AB1E, 5 bytes
∞.Δ!Q

Try it online!

Python 2, 73 bytes
lambda x:[n for n in range(1,x)if reduce(lambda a,b:a*b,range(1,n+1))==x]

Try it online!

Keg, 10 bytes
&1{:¡⑻≠|1+

Try it online!

JavaScript (V8), 29 bytes
f=(n,i=1)=>n/i^1?f(n/i,++i):i

Try it online!

yes, your are right

@Arnauld f(1) required to be 1, your function output false.

@tsh My bad. Here is another 28 that works for n=1.

Prolog (SWI), 62 55 bytes
X-N-N:-A is N/D,A==1,X is D;X-N/D-(D+1).
f(X,N):-X-N-1.

Try it online!
If N equals D, sets X to D, otherwise, it calls itself with N/D and D+1.

HP‑41C series, 18 B
The \$x\$ in \$x! = n\$ can be determined by repeatedly dividing \$n\$ by an incrementing divisor (first \$1\$, then \$2\$, then \$3\$ and so forth) until the quotient equals the (next) divisor.
The program works correctly up to and including \$x = 39\$.
01♦LBL "S"         5 Bytes    global label requires 4 + (length of string) Bytes
   NULL            1 Byte     invisible Null byte before numbers
02 1               1 Byte     place 1 on top of stack; X ≔ 1 ; Y ≔

03 LBL 00          2 Bytes    mark head of this loop with (local) label 00 ──┐
                                                                             │
04 X=Y?            1 Byte     if X = Y ──┐                                   │
05 RTN             1 Byte                └── then return                     │
                                                                             │
06 ∕               1 Byte     lastX ≔ X ;  X ≔ Y ∕ X                         │
                                                                             ↑
07 LASTX           1 Byte     put lastX back on top of stack again           │
   NULL            1 Byte     invisible Null byte before numbers             │
08 1               1 Byte     place 1 on top of stack                        │
09 +               1 Byte     sum X and Y, stack drops by one item           │
                                                                             │
10 GTO 00          2 Bytes    go to (local) label 00  ───────────────────────┘

Since this is pretty abstract, let’s consider a trace of the stack in the case \$n = 6 = 3! = x!\$.
The step “sees” data from one row above, the result of a step follows in the same row.
Empty cells are not relevant to the program.

step
X
Y
Z
T
LastX

6

1
1
6

X=Y?
〃
〃

∕
6

1

LASTX
1
6

〃

1
1
1
6

〃

+
2
6

1

GTO 00
〃
〃

〃

X=Y?
〃
〃

〃

∕
3

2

LASTX
2
3

〃

1
1
2
3

〃

+
3
3

1

X=Y?
〃
〃

〃

RTN
〃
〃

〃

Note that GTO searches for a local label downward in program memory and wraps to the beginning of the currently executed program.
To inhibit local label search, append an END command (3 Bytes).
The above program presumes there are no other programs (following) in program memory, so the permanent (= always there) END is sufficient.

Add++, 23 bytes
D,f,@,R¦*BK=
L,dBkRÞ{f}

Try it online!
This is what happens when there's no "find index" or "first n where" or auto-vectorisation.
Explained
D,f,@,R¦*BK= # Helper function f
      R      #    range 1...n
       ¦*    #    reduce by multiplication
         BK= #    does that equal the global register?
L,dBkRÞ{f}   # main lambda
  dBk        #    place the input into the global register.
     R       #    range 1...input
      Þ{f}   #    filter by helper function f

Vyxal 3 G, 5 bytes
K!=Þκ

Try it Online!

authors: Bob Jarvis - Слава Україні


text:
Can I trade today?
Back in 2018, there has been introduced new law in Poland to ban trading on sundays,
but certain exceptions have been made (listed below). The task today is to determine,
can one trade on the sunday provided by the user (according to these rules).
Rules
You can trade only if one of the following is satisfied:

The day is the last sunday of 1st, 4th 6th and 8th month.
The day is one of the two sundays preceding Christmas.
The day is the sunday preceding Easter

Simplifications
Obviously one can't trade on certain holidays, but you can omit the check for them in your code.
The only exclusion to this rule is Easter or Christmas (for obvious reasons).
For example, if the rules above allowed trading on 6th of January and albeit in reality you can't
trade due to a holiday, you don't need to take that on the account (and assume that one can trade
on 6th of January).
I/O rules
You can take the date in any reasonable format - "DDMMYYYY", "MMDDYYYY" and so on.
The output should be a truthy or falsy value (answering the question - can you trade on this sunday?)
You can assume the input date to always be a sunday.
Examples
A few examples:

You can trade on 27 January of 2019, due to rule 1.
You can't trade on 13 January of 2019.
You can't trade on 21 April of 2019 - it's Easter.
You can trade on 14 April of 2019, due to rule 3.
You can trade on 28 April of 2019, due to rule 1.
You can trade on 15 December of 2019, due to rule 2.
You can trade on 22 December of 2019, due to rule 2.

Obvious clarifications

You'll have to calculate the date of Easter and Christmas in the process.
Your program has to work correctly with any other year than 2019.
You MUST take on the account that you can't trade on Easter or Christmas, even if the conditions are satisfied.
You don't need to check for other holidays.

Scoring criterion
The shortest code (in bytes) wins.

Because it's Poland, that's why the law is complex. If they banned all sundays, citizens would simply take the politicians out on a wheelbarrow from the Parliament.

Is Easter 3/21 or 4/21?

This may help: https://math.stackexchange.com/questions/896954/decoding-gauss-easter-algorithm

Seems a complicated enough problem just to calculate easter

Mathematica has Default, GovernmentBond, NASDAQ, NERC, NYSE calendars for United States, but, unfortunately, only a normal-ish calendar for Poland :(

streetster is correct - this is a chameleon challenge unless we can accept two dates: the date of the Sunday to check; and the date of Easter Sunday on that same year.

Chameleon challenge is a challenge where one of it's parts is nearly as hard as the challenge itself. In this case, simply calculating the date of Easter is considerably easier than solving the challenge above. You've literally got a formula for this, it spans around 4 lines, what's hard in this? I can't seem to understand the problem with the challenge

JavaScript (ES6),  173  172 bytes
Takes input as (year, month, day). Returns 0 or 1.
As anticipated by @streetster, computing Easter is the biggest part.
(y,m,d)=>169>>--m&(D=new Date(y,m,d+7)).getMonth()!=m|m>10&(d+3)/14|+D==+new Date(y,2,56-(c=(y%19*351-~((b=(a=y/25>>2)>>2)+a*29.32+13.54)*31.9)/33%29|0)-~(a-b+c-24-y/.8)%7)

Try it online!
How?
Last Sunday
We use the binary mask 0b10101001 (or 169 in decimal) to encode the 0-indexed months for which it's allowed to trade on the last Sunday. We make sure that m-1 is one of these months and that adding 7 days brings us to the next month.
169 >> --m & (D = new Date(y, m, d + 7)).getMonth() != m

Christmas
We simply test whether the month is December and the day is more than 10 and less than 25.
m > 10 & (d + 3) / 14

All possible cases are summarized in the following table:
 Mo Tu We Th Fr Sa | Su | Mo Tu We Th Fr Sa | Su | Mo Tu We Th Fr Sa | Su | Mo Tu We
-------------------+----+-------------------+----+-------------------+----+----------
  8  9[10]11 12 13 | 14 | 15 16 17 18 19 20 | 21 | 22 23 24[25]26 27 | 28 | 29 30 31
  7  8  9[10]11 12 | 13 | 14 15 16 17 18 19 | 20 | 21 22 23 24[25]26 | 27 | 28 29 30
  6  7  8  9[10]11 | 12 | 13 14 15 16 17 18 | 19 | 20 21 22 23 24[25]| 26 | 27 28 29
  5  6  7  8  9[10]| 11 | 12 13 14 15 16 17 | 18 | 19 20 21 22 23 24 |[25]| 26 27 28
  4  5  6  7  8  9 |[10]| 11 12 13 14 15 16 | 17 | 18 19 20 21 22 23 | 24 |[25]26 27
  3  4  5  6  7  8 |  9 |[10]11 12 13 14 15 | 16 | 17 18 19 20 21 22 | 23 | 24[25]26
  2  3  4  5  6  7 |  8 |  9[10]11 12 13 14 | 15 | 16 17 18 19 20 21 | 22 | 23 24[25]
Easter
We test whether D (computed above) is equal to Easter. The algorithm was taken from this page (function ShortGregorianEaster1). It returns a day in March which may be greater than 31, in which case Date() quietly converts into a day in April.
+D == +new Date(y, 2, some_long_and_boring_formula)

Python 2 + dateutil, 163 157 bytes
Possibly could be golfed some more. Even using a library function, calculating the date for Easter still takes up almost half of the code.
-6 bytes thanks to @Arnauld
from dateutil.easter import*
y,m,d=input()
e=easter(y)
print(e.month==m)*((e.day==d+7)-(e.day==d)*(m*d>99))+m/12*(d<25)*(d>10)+(m in[4,6])*d/24+(m%7==1)*d/25

Try it online!
Accepts input in the form YYYY, (M)M, (D)D. Returns 1 if trading is allowed, 0 otherwise.

@Arnauld Thanks! I was able to use the same trick in a couple more places too

05AB1E, 109 103 101 bytes
т÷©>3*4÷DV¹19%DU19*15O®8*13+25÷-30%DX11÷+29÷-23+DY-¹D4÷++7%(91O31‰R»9bS30+6ÝδαεŽ5ÂNèδ»}˜12ÐÝ+sδ»«sª²å

Input as year, day\nmonth (multi-line string).
Try it online or verify a few more test cases.
(68 bytes are used to calculate Easter Sunday.)
Explanation:
Calculate the week before Easter Sunday, using @PeterTaylor's formula in his GolfScript answer here:
т÷             # Integer-divide the (implicit) input-year by 100
  ©            # Store it in variable `®` (without popping)
>              # Increase it by 1
 3*            # Multiply it by 3
   4÷          # Integer-divide it by 4
     DV        # Store a copy in variable `Y`
¹19%           # Push the input-year modulo-19
    DU         # Store a copy in variable `X`
19*            # Multiply the year-modulo-19 by 19
   15          # Push 15
     O         # Sum the three values on the stack together:
               #  year/100*3/4 + year%19*19 + 15
®8*            # Push variable `®` and multiply it by 8
   13+         # Add 13
      25÷      # Integer-divide it by 25
         -     # Subtract it from the earlier calculated number
          30%  # Modulo-30
             D # Duplicate it
X11÷           # Push `X` integer-divided by 11
    +          # Add it to top copy
     29÷       # Integer-divide it by 29
        -      # Subtract it from the other copy
         23+   # Add 23
            D  # Duplicate it
Y-             # Subtract `Y` from the top copy
  ¹D           # Push the input-year two times
    4÷         # Integer-divide to top year by 4
      +        # Add it to the year
       +       # Add it to the earlier number
        7%     # Modulo-7
          (    # Negate it
91             # Push 91 (three purposes: it adds 97; adds an additional 1 to make the
               #  day 1-based; subtracts 7 since we want the week before Easter Sunday)
  O            # Sum the three values on the stack
  31‰          # Divmod it by 31 to extract the 1-based month and day
     »         # And join those by newlines

Calculate all the other dates that could potentially be a truthy Sunday:
9              # Push 9
 bS            # Convert it to a binary-list: [1,0,0,1]
   30+         # Add 30 to each: [31,30,30,31]
      6Ý       # Push list [0,1,2,3,4,5,6]
        δ      # Apply double-vectorized:
         α     #  Take the absolute difference
               # [[31,30,29,28,27,26,25],[30,29,28,27,26,25,24],[30,29,28,27,26,25,24],[31,30,29,28,27,26,25]]
ε              # Map each to:
 Ž5Â           #  Push compressed integer 1468
    Nè         #  Index the map-index into it
      δ»       #  And join it to each individual day with a newline delimiter
}˜             # After the map: flatten the list
  12Ð          # Push 12 three times to the stack
     Ý         # Pop one, and push list [0,1,2,3,4,5,6,7,8,9,10,11,12]
      +        # Add each to 12: [12,13,14,15,16,17,18,19,20,21,22,23,24]
       s       # Swap so the third 12 is at the top of the stack
        δ»     # Join it to each individual day with a newline delimiter
          «    # And merge these to the earlier flattened list

Merge it together to a single list:
sª             # Add the earlier calculated Easter Sunday - 7 to the list

I.e. for the year 2019, we now have the following dates that are potentially a truthy Sunday:
["31\n1","30\n1","29\n1","28\n1","27\n1","26\n1","25\n1", # January 31 to 25
 "30\n4","29\n4","28\n4","27\n4","26\n4","25\n4","24\n4", # April 30 to 24
 "30\n6","29\n6","28\n6","27\n6","26\n6","25\n6","24\n6", # June 30 to 24
 "31\n8","30\n8","29\n8","28\n8","27\n8","26\n8","25\n8", # August 31 to 25
 "12\n12","13\n12","14\n12","15\n12","16\n12","17\n12","18\n12","19\n12","20\n12","21\n12","22\n12","23\n12","24\n12",
                                                          # December 12 to 24
 "24\n3"]                                                 # Sunday week before Easter

And we check if the second input is in this list to complete the program:
  ²å           # And check if the second input-string is in this list
               # (after which the result is output implicitly)

See this 05AB1E tip of mine (section How to compress large integers?) to understand why Ž5Â is 1468.