17
votes
9
votes
Detect round trips on a hyperbolic grid
Vyxal, 26 bytes
fC‹\1꘍›ṅ»¬½ẆZ¶ẋḞ≥P»3R2€yøV
Try it Online!
Port of @Neil's Retina answer. Returns a falsey value if the path is closed and truthy otherwise.
...
- 2,096
9
votes
Detect round trips on a hyperbolic grid
Retina 0.8.2, 55 bytes
\d
$*RF
FRRRFRRRF
RFRFR
FRFRF
RRRFRRRFRRR
}`FF|RRRR
^$
Try it online! Takes input as 123 but test suite ...
- 156k
7
votes
We're gonna need a bigger podium!
MATL, 26 24 bytes
xt:Z^!"@tufm?@&=sqz1G=vs
Inputs T, then R. The code takes a ...
- 102k
6
votes
Record Least Uncommon Multiple Counts
Python + SymPy, \$119/47\approx 2.532\$ on my computer
...
- 40.4k
5
votes
5
votes
5
votes
Record Least Uncommon Multiple Counts
J, \$178/48 \approx 3.708 \$
Based on alephalpha's comment, powered by J's fast prime factorisation.
...
- 56.2k
4
votes
Output the sign
Trilangle, 21 bytes
?\<'1(0@'^\.!_@>'0.(#
Try it in the online interpreter!
Unfolds to this:
...
- 2,058
4
votes
Raise integer x to power x, without exponentiation built-ins
Nibbles, 3 2.5 bytes (6 5 nibbles)
`*^$_
Attempt This Online!
Returns the correct answer of \$1\$ for an input of \$0\$, as it is generally accepted that \$0^0=1\$ ...
- 10.9k
4
votes
Canonical form of a cubic Bézier curve
JavaScript (ES6), 55 bytes
-2 thanks to @Neil
Returns \$false\$, \$true\$, \$2\$ or \$3\$ for double, loop, arch and single respectively.
...
- 179k
4
votes
Detect round trips on a hyperbolic grid
Charcoal, 52 bytes
≔⭆SXχ⊕⌕LSRιθW⌊ΦE⪪”←“tU≧*h?λêQ✳x”¶⪪κ №θ⌈κ≔⪫⪪θ⌈ι⌊ιθ¬θ
Try it online! Link is to verbose version of code. Outputs a Charcoal boolean, i.e. ...
- 156k
4
votes
We're gonna need a bigger podium!
PARI/GP, 46 bytes
f(r,t)=Vec(r!/(2-exp(x+O(x^t++))+x)^r-=t-2)[t]
Attempt This Online!
- 40.4k
4
votes
We're gonna need a bigger podium!
R, 105 bytes
(or 91 bytes in in R≥4.1 by exchanging function for \)
...
- 30.1k
4
votes
We're gonna need a bigger podium!
05AB1E, 21 15 bytes
LZãʒÐêāQi¢≠OQ]g
-6 bytes by porting @LuisMendo's MATL answer, so make sure to upvote him as well!
Inputs in the order \$R,T\$.
Try it online or ...
- 116k
4
votes
Record Least Uncommon Multiple Counts
Mathematica 13.2 112/48 113/48 \$\approx 2.35\$
PyCharm 2020 + Python 3.8 was used for run Python code.
Thanks to @alephalpha for the cool math idea, please vote for his answer!
...
- 1,153
3
votes
3
votes
Pseudofactorial
Regex 🐇 (PCRE2 v10.35+), 60 59 54 bytes
^((?*(?=(xx+?)\2*$|)((?=x\2)(?=(x+)(\4+$))\5)*+x+)x)*$
Takes its input in unary, as a ...
- 10.9k
3
votes
3
votes
Detect round trips on a hyperbolic grid
05AB1E, 27 26 (or 23) bytes
Ç<°JΔ•6o₁EAÛr£ð•3B2¡ι`:}õQ
Port of AndrovT's top Vyxal answer, which in turn is a port of @Neil's Retina answer, which in turn is ...
- 116k
2
votes
2
votes
2
votes
Fibonacci reversed!
Japt, 8 bytes
ô!gM è<U
Try it
Original, 9 bytes
Can handle larger inputs than the version above.
nMgV°)©Òß
Try it
- 39.6k
2
votes
Pseudofactorial
Nim, 52 bytes
import math,sequtils
func p[I](n:I):I=lcm toSeq 1..n
Attempt This Online!
- 6,543
2
votes
Hilbert Primes Golf
Raku, 35 bytes
grep {$_%%none 5,9...^$_},(5,9...*)
Try it online!
This is an expression for the lazy, infinite list of Hilbert primes.
...
- 7,246
2
votes
Find the maximum deviation
PowerShell, 70 bytes
(0..(-$d+$v.count)|%{$s=$v[$_..($_+$d-1)]|sort;$s[-1]-$s[0]}|sort)[-1]
Try it online!
- 51
2
votes
2
votes
Raise integer x to power x, without exponentiation built-ins
awk - a LOT of bytes (123 ?, per Deadcode), but it includes the full recursive binary squaring algorithm tailored for ...
2
votes
Raise integer x to power x, without exponentiation built-ins
Thunno D, \$5\log_{256}(96)\approx\$ 4.12 bytes
ZOA*P
Attempt This Online!
Note: the built-in solution would have been just one ...
- 9,446
2
votes
Raise integer x to power x, without exponentiation built-ins
Fortran (GFortran), 73 bytes
integer(selected_int_kind(32))::n
read*,n;print*,product([(n,j=1,n)]);end
Try it online!.
Uses a larger integer type because the ...
- 2,118
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
math × 1709code-golf × 1537
number × 286
sequence × 219
arithmetic × 180
number-theory × 167
geometry × 116
integer × 90
primes × 87
combinatorics × 85
decision-problem × 81
code-challenge × 74
array × 69
matrix × 66
string × 56
polynomials × 55
fastest-code × 48
rational-numbers × 48
abstract-algebra × 40
ascii-art × 36
base-conversion × 35
linear-algebra × 31
open-ended-function × 29
restricted-source × 28
fibonacci × 28