Skip to main content

New answers tagged

1 vote

Infinite ordinals from a well-ordering

Javascript (lim(BMS),375) See this similar answer, which uses the Bashicu Matrix System. This is the code, where comparison is C(x)(y): ...
Patcail's user avatar
  • 516
0 votes

Make the largest infinity that you can!

Javascript, lim(BMS)+999820 points This program uses the Bashicu Matrix System, which is an extremely powerful ordinal notation conjectured to reach the limit of second order arithmetic. This utterly ...
Patcail's user avatar
  • 516
0 votes

Count sums of two squares

Perl 5, 45 + 1 (-a) = 46 bytes $_=!$_+4*grep{$_=sqrt"@F"-$_*$_;!/\./}1..sqrt Try it online!
Xcali's user avatar
  • 15.3k
2 votes

Count sums of two squares

R, 39 bytes \(n)sum(rowSums(merge(-n:n,-n:n)^2)==n) Attempt This Online! I think this is a really compact solution for an R answer. Here, ...
int 21h Glory to Ukraine's user avatar
1 vote

Golf a number bigger than TREE(3)

Japt, 39 Bytes, fPTO(Z2) (32) or BMS[32] This is a port of this answer. T°?UÊ?ßUcUsX=Uo)Ë<XfH ?D:D+UÊ-X:T:ßLÇ%H I made a few golfing edits compared to my ...
Patcail's user avatar
  • 516
2 votes

Sum of square roots (as an algebraic number)

Octave, 56 bytes f=@(x)poly((2*(dec2bin(0:2^numel(x)-1)-'0')-1)*sqrt(x)') Input: a list of integers. Output: a list of coefficients of a polynomial, whose roots ...
Ka Wa Yip's user avatar
  • 181
3 votes

Sum of square roots (as an algebraic number)

Scala + scalaz, 163 bytes ...
corvus_192's user avatar
  • 5,542
1 vote

Find the most isolated point

vemf, 13 bytes, O(n²) Boring quadratic solution as a function that takes two lists of vectors. Could maybe be shorter with complex numbers? ...
taswelll's user avatar
  • 151
2 votes

Sum of square roots (as an algebraic number)

Wolfram Language (Mathematica), 26 bytes MinimalPolynomial@Tr@√#& Try it online! Outputs a pure function representing a polynomial. Extracting the polynomial ...
att's user avatar
  • 20.6k
3 votes

Sum of square roots (as an algebraic number)

JavaScript (ES7), 118 bytes Returns the coefficients in increasing order. ...
Arnauld's user avatar
  • 193k
2 votes

Find the most isolated point

K (ngn/k), \$O(N^2)\$, 22 bytes A function that takes \$P\$ and \$T\$ as its first, and second argument, respectively. ...
akamayu's user avatar
  • 561
3 votes

Sum of square roots (as an algebraic number)

Charcoal, 59 bytes FX²Lθ⊞υΣEθ⎇﹪÷ιX²λ²±₂κ₂κE⊕Lυ﹪%.0fΣEΦEX²Lυ⮌⍘λ²⁼ιΣλΠ∨E⌕Aλ1§υν¹ Try it online! Link is to verbose version of code. Explanation: Originally based on @...
Neil's user avatar
  • 172k
3 votes

Sum of square roots (as an algebraic number)

Vyxal, 13 bytes √:NZΠṠ1v"ƒÞƈ⌊ Try it Online! Takes about 15 seconds for [2, 3, 5], hence the ...
emanresu A's user avatar
  • 38.8k
7 votes

Sum of square roots (as an algebraic number)

05AB1E, 15 bytes tæO·¤;-æ.¡g}POò Attempt This Online! Computes \$(x-\sqrt{a_1}-\sqrt{a_2}-\cdots)(x+\sqrt{a_1}-\sqrt{a_2}-\cdots)(x-\sqrt{a_1}+\sqrt{a_2}-\cdots)(x+...
Command Master's user avatar
4 votes

Sum of square roots (as an algebraic number)

Python + NumPy, 81 bytes lambda l:rint(poly(l**.5@(-1)**(r_[:1<<len(l)]>>c_[:len(l)]))) from numpy import* Attempt This Online! How? Generates what I ...
Albert.Lang's user avatar
  • 2,884
7 votes

Sum of square roots (as an algebraic number)

Python + SymPy, 53 bytes -6 from xnor lambda l:minpoly(sum(map(sqrt,l))) from sympy import* Function taking a list of the integers and returning a SymPy minimal ...
Parcly Taxel's user avatar
  • 3,807
0 votes

Find the most isolated point

Google Sheets, \$O(n^2+)\$, 109 bytes let(d,map(x,y,lambda(x,y,min(map(z,t,lambda(z,t,sumsq(z-x,t-y)))))),index({x,y},+sort(sequence(rows(d)),d,))) This is a named ...
doubleunary's user avatar
  • 1,705
2 votes

Find the most isolated point

Charcoal, 25 bytes, O(n²) ≔Eθ⌊EηΣEλX⁻ν§ιξ²η⭆¹§θ⌕η⌈η Try it online! Link is to verbose version of code. Explanation: ...
Neil's user avatar
  • 172k
1 vote

Find the most isolated point

Python, \$\mathcal{O}(n^2)\$, 72 bytes lambda P,T:max(P,key=lambda p:min((p[0]-X)**2+(p[1]-Y)**2 for X,Y in T)) Using math.dist ...
corvus_192's user avatar
  • 5,542
1 vote

Find the most isolated point

JavaScript (ES7), \$\mathcal{O}(n^2)\$, 90 bytes Expects (P)(T). ...
Arnauld's user avatar
  • 193k
1 vote

Find the most isolated point

APL+WIN, 26 bytes Prompts for T then P as nested vectors of points: P[↑⍒(+/¨((P←⎕)∘.-⎕)*2)*.5] Try it online! Thanks to Dyalog Classic
Graham's user avatar
  • 6,286
2 votes

Last odd digit of power of 2

Go, 115 bytes ...
bigyihsuan's user avatar
  • 9,776
0 votes

Construct the Identity Matrix

Uiua, 4 bytes ⊞=.⇡ Try it online! Read: table of = equality by ...
noodle person's user avatar
1 vote

*Trivial* near-repdigit perfect powers

Pip, 27 bytes W PtPB0P*t*Y489FE1=#t%Y%_+2 Outputs infinitely. Attempt This Online! Explanation This is an interesting challenge. I'm far from certain that this is ...
DLosc's user avatar
  • 39.7k
1 vote

Generate Pascal's triangle

Nibbles, 16 nibbles (8 bytes) <$`.,1!;:0$\@+ Attempt This Online! Explanation ...
DLosc's user avatar
  • 39.7k
1 vote

Crazy Librarian's Arithmetic Sequence of Primes

Vyxal, 25 bytes ₀+æ[λS₅ʀ?vṀ⌊JæA;₁ȯ|`∵Ǒ ƛ£ Try it Online! (first 5) ...
emanresu A's user avatar
  • 38.8k
0 votes

Compute the degree of a string

AWK, 113 bytes ...
C K's user avatar
  • 91
9 votes

Compute the degree of a string

Cubical Agda, 1134 bytes Uses Agda 2.6.4.3, the cubical library 0.7 and the standard library 2.0. ...
Naïm Favier's user avatar

Top 50 recent answers are included