text:
Is my triangle right?
Given a, b, c the length of the three sides of a triangle, say if the triangle is right-angled (i.e. has one angle equal to 90 degrees) or not.
Input
Three positive integer values in any order
Output
Either a specific true output (true, 1, yes, ...) or a specific false output (false, 0, no, ...)
Example
5, 3, 4        --> yes
3, 5, 4        --> yes
12, 37, 35     --> yes
21, 38, 50     --> no
210, 308, 250  --> no

Rules

The input and output can be given in any convenient format.
In your submission, please state the true and the false values.
No need to handle negative values or invalid edge triple
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
If possible, please include a link to an online testing environment so other people can try out your code!
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Must we handle negative values or invalid edge triple?

@user202729 No ;)

Very related.  I'll leave it up to the rest of the community to decide if its a dup.

I think that using coordinates instead of lengths changes the challenge significantly

There is no triangle with lengths 21, 38, 5, because 21 + 5 < 38.  Is this an intentional pathological case that we have to handle?

@Kevin no you have not to handle this case. User202729 has already asked this question :)

Jelly, 5 bytes
²µSHe

Try it online!
Technical note: Bytes are counted in Jelly codepage.
Explanation:
²µSHe  Main link.
²      Square each number.
 µ     With the new list,
  S    calculate its sum,
   H   and halve it.
    e  Check if the result exists in the new list (squared input)

The problem is equivalent to being given three numbers a, b, c, and asking if there is a permutation such that a² + b² = c². This is equivalent to whether (a² + b² + c²) ÷ 2 is one of a², b² or c², so the program just checks that.

well... I jelly.

Just a technical note: symbols ² and µ cost two bytes each in UTF-8, so your code has actually 7 bytes, not 5

@Charlie Answer edited for clarification.

Python 2, 37 bytes
a,b,c=sorted(input())
1/(a*a+b*b-c*c)

Try it online!
-2 thanks to FlipTack.
-1 thanks to Craig Gidney.
Outputs via exit code (0 = false, 1 = true).

Bah. Came up with the exact same answer. You could modify the test suite to allow for any number of test cases: see here

@mbomb007 exec(code) hmmm, why exec (code) instead of exec code? :D ;-p

Haha, how does this answer have double the upvotes of xnor's shorter one? Maybe people just like the sweet simpleness of it

@FlipTack ¯_(ツ)_/¯ (also xnor's isn't in Python 2)

@EriktheOutgolfer Because the boilerplate isn't the part that is to be golfed. I made it so it'd work in either Python 2 or 3.

@mbomb007 I'd say that's not necessary, since this won't work in Python 3 anyways.

You could use 1/(a*a+b*b!=c*c) to output by exit code.

Use - instead of != to save a byte.

Java 8, 44 bytes
(a,b,c)->(a*=a)+(b*=b)==(c*=c)|a+c==b|b+c==a

Explanation:
Try it here.
(a,b,c)->                // Method with three integer parameters and boolean return-type
  (a*=a)+(b*=b)==(c*=c)  //  Return if `a*a + b*b == c*c`
  |a+c==b                //  or `a*a + c*c == b*b`
  |b+c==a                //  or `b*b + c*c == a*a`
                         // End of method (implicit / single-line return-statement)

Does it work without the parenthesis on the (c*=c)? The *= might have precidence over the == and you can save two bytes.

@corsiKa I'm afraid it's the other way around. == has precedence over *=. =, +=, *=, and similar assignments actually have the lowest precedence in Java operators.

Can't find anything shorter... I tried to get the variables swapped to have the max value assigned to a (for instance), without any success. Well, I could do it, but around 65 characters...

Python 3, 37 bytes
lambda*l:sum(x*x/2for x in l)**.5in l

Try it online!
Might run into float precision issues with large inputs.

JavaScript (ES6), 43 41 40 bytes
Saved 1 byte and fixed a bug thanks to @Neil
Takes input as an array of 3 integers. Returns true for right-angled and false otherwise.
a=>a.some(n=>Math.hypot(...a,...a)==n*2)

let f =

a=>a.some(n=>Math.hypot(...a,...a)==n*2)

console.log(f([5, 3, 4     ])) //  --> yes
console.log(f([3, 5, 4     ])) //  --> yes
console.log(f([12, 37, 35  ])) //  --> yes
console.log(f([21, 38, 5   ])) //  --> no
console.log(f([210, 308, 15])) //  --> no

Original version, 44 bytes
Takes input as 3 integers. Returns 1 for right-angled and 0 otherwise.
(a,b,c)=>(a*=a)+(b*=b)==(c*=c)|a+c==b|b+c==a

Test cases

let f =

(a,b,c)=>(a*=a)+(b*=b)==(c*=c)|a+c==b|b+c==a

console.log(f(5, 3, 4     )) //  --> yes
console.log(f(3, 5, 4     )) //  --> yes
console.log(f(12, 37, 35  )) //  --> yes
console.log(f(21, 38, 5   )) //  --> no
console.log(f(210, 308, 15)) //  --> no

Looks like we came up with the exact same answer (except for the => and -> difference between JavaScript and Java 8). ;) So obvious +1 from me.

>>1 is unsafe, this returns true for [1, 1, 1].

How about Math.hypot(...a,...a)==n*2?

@Neil Very nice fix :)

@Neil I was trying to do Math.hypot(...a)**2==2*n*n and couldn't understand why it didn't work :(

@JollyJoker Floating-point errors perhaps?

@Neil Yes, I logged Math.hypot(...a)**2-2*n*n and get errors of order 10^-15. hypot(...a,...a) seems to get around it, likely because the (desired) result is always an integer.

@JollyJoker Indeed, it's always an integer for Pythagorean triples, which is how I came up with the idea!

@Neil There should be a ~= operator for "rougly equal" ;)

a=>Math.hypot(...a,...a)==a.sort()[2]*2

@l4m2 This would fail for instance for [10,6,8], because sort() uses lexicographical order by default.

Checked. And thus the solution using sort are also invalid

@l4m2 Oh, I didn't notice that one. But it would fail indeed on such test cases.

Builtin function way and recursive way exactly both 40c

f=a=>a.some(n=>Math.hypot(...a,n,n)==n*2) late improvement

Triangular, 57 bytes
I haven't seen any in this language yet and it seemed appropriate to try and do one.  It took a bit ... as I had to get my head around it first and I believe this could be golfed some more.
,$\:$:*/%*$"`=P:pp.0"*>/>-`:S!>/U+<U"g+..>p`S:U/U"p`!g<>/

Try it online!
This expands to the following triangle.
          ,
         $ \
        : $ :
       * / % *
      $ " ` = P
     : p p . 0 "
    * > / > - ` :
   S ! > / U + < U
  " g + . . > p ` S
 : U / U " p ` ! g <
> /

The path is quite convoluted, but I'll try and explain what I have done.  I will skip the directional pointers.  Most of the code is stack manipulation.

$:* Square the first input.
$:* Square the second input.
S":Ug! Test if the second value is greater than the first.

true p" Swap with the first.
false p Do Nothing.

$:* Square the third input.
P":USg! Test if the third value is greater than the greatest of the previous.

true p+U- sum the current stack and take away stored third value
false p"U+- sum the least and stored third and subtract from greatest

0=% test equality to zero and output result.

R, 31 26 30 bytes
cat(sum(a<-scan()^2)/max(a)==2)

I don't like this one as much, but it is shorter.  Sums the squares and divides by the largest square.  Truthy if 2.
Previous Version (modified with cat and with @Guiseppe's tip)
cat(!sort(scan())^2%*%c(1,1,-1))

Do a sum of the sorted input with the last item negated and return the ! not.
Try it online!

For your previous version, !sort(scan())^2%*%c(1,1,-1) is 27 bytes. but I think you still need a cat.

Cheers @Guiseppe, forgot about the cat.  The rules around REPL annoy me, but they are what they are.

@Giuseppe Also nice twist with the matrix multiplication.  I would never have come up with that.

Haskell (33 32 31 bytes)
(\x->(sum x)/2`elem`x).map(^2)

Original version:
(\x->2*maximum x==sum x).map(^2)

Anonymous function. Takes a list in the form [a,b,c]. Outputs True or False.
First version checked if the sum of the squares was twice the square of the maximum.
Second, slightly better version checks if half the sum of squares is an element in the list of squares.
Edit: Accidentally counted a newline, thanks H.PWiz

Welcome to the site! This answer is only 32 bytes, maybe you counted an extra newline?

You can use the function Monad to save some more bytes here

also, the parentheses around sum can be thrown away. nice solution!

Perl 6, 24 bytes
{(*²+*²==*²)(|.sort)}

Try it online!
*²+*²==*² is an anonymous function that returns true if the sum of the squares of its first two arguments is equal to the square of its third argument.  We pass the sorted input list to this function, flattening it into the argument list with |.

Brain-Flak, 68 bytes
({({({})({}[()])}{}<>)<>})<>({<(({}){}<>[({})])>(){[()](<{}>)}{}<>})

Try it online!
Uses the observation in user202729's answer.
 {                      }      for each input number
   {({})({}[()])}{}            compute the square
  (                <>)<>       push onto second stack
(                        )     push sum of squares onto first stack
                          <>   move to second stack

 {                                    }    for each square
   (({}){}<>[({})])                        compute 2 * this square - sum of squares
  <                >(){[()](<{}>)}{}<>     evaluate loop iteration as 1 iff equal
(                                      )   push 1 if any squares matched, 0 otherwise

Python 2, 43 bytes
lambda a,b,c:(a*a+b*b+c*c)/2in(a*a,b*b,c*c)

Try it online!
Python 2, 79 70 68 62 bytes
lambda*l:any(A*A+B*B==C*C for A,B,C in zip(l,l[1:]+l,l[2:]+l))

Try it online!

The challenge was updated to limit inputs to integers.

77 bytes https://tio.run/##hY/BCoMwDIbvPkVgF@ti0dayMXCgPsbYQZ0yL1U6d/Dpu9RtMARdDn8o3/8nzTCN914La29NC61fYoU1O5lmfBoNpZ78LAjEPidJ04K07Q1kmGMBnb587Ei9xoo6vbBkV2YH0@mR5kmEBEGxHbwrDM8wNQ/vhyuyrHIKy618MuflKlfz/k0u/@xXPCITj2bPksdcOHhw4n655ILHDh2/Nziue8@@AA

A*A is shorter...

68 bytes https://tio.run/##VcqxCsIwGATg3af4xyT@QxMNipAhyWOoQ1IJFjQtpUufPh6CqMNx3MdN63Ifq2nFXdojPfMtUeLM/SnVVXjlt0EF56KKVMaZPAeONNSzeJ8ko3vOaCxO8irbNA91oSIs045pLzcfwLJ/oA0uB8R@zWjsI56/1ME6oIa2Fw

@mdahmoune 67 bytes; flipping the truth value's meanings and using - instead of ==.

@JonathanFrech you right :-)

43 bytes: lambda a,b,c:(a*a+b*b+c*c)/2in(a*a,b*b,c*c).

41 bytes: lambda*x:sum(y*y for y in x)/2==max(x)**2

C (gcc), 49 bytes
n(a,b,c){return(a*=a)+(b*=b)-(c*=c)&a+c-b&b+c-a;}

Try it online!
Improves on Kevin Cruijssens technique
Returns 0 for a valid triangle, and a non-zero value otherwise

Welcome to PPCG!

Does it always work if you're using bitwise operations?

C,  68  54 bytes
Using user202729's solution.
f(a,b,c){return!((a*=a)+(b*=b)-(c*=c)&&a-b+c&&a-b-c);}

Thanks to @Christoph for golfing 14 bytes!
Try it online!
C, 85 bytes
#define C(a,b,c)if(a*a+b*b==c*c)return 1;
f(a,b,c){C(a,b,c)C(b,c,a)C(c,a,b)return 0;}

Try it online!

Outputs 1 for parameters of 1, 1, 1 which is wrong...

@Neil It's fixed now.

Question was updated to use ints, might save some bytes.

f(a,b,c){a=!((a*=a)+(b*=b)-(c*=c)&&a-b+c&&a-b-c);}

52 bytes

MATL, 7 bytes
SU&0)s=

Try it online!
Explanation
Consider input [12, 37, 35].
S     % Implicit input. Sort
      % [12, 35, 37]
U     % Square each entry
      % [144, 1225, 1369]
&0)   % Push last entry and remaining entries
      % STACK: 1369, [144, 1225]
s     % Sum of array
      % STACK: 1369, 1369
=     % Isequal? Implicit display
      % STACK: 1

J, 10 bytes
-6 bytes thanks to FrownyFrog
=`+/@\:~*:

original answer
(+/@}:={:)@/:~*:

/: sort the squares *:, then check if the sum of the first two +/@}: equals the last {:
Try it online!

that's awfully damn clever

Japt, 8 bytes
m²ø½*Ux²

Try it
Japt -x¡, 7 bytes
Ë²Ñ¶Ux²

Try it

I like the square symbols in your solution ;)

Julia 0.6, 16 bytes
!x=x⋅x∈2x.*x

Try it online!
How it works
Let x = [a, b, c].
x⋅x is the dot product of x and itself, so it yields a² + b² + c².
2x.*x is the element-wise product of 2x and x, so it yields [2a², 2b², 2c²].
Finally, ∈ tests if the integer a² + b² + c² belongs to the vector [2a², 2b², 2c²], which is true iff
a² + b² + c² = 2a² or a² + b² + c² = 2b² or a² + b² + c² = 2c², which itself is true iff
b² + c² = a² or a² + c² = b² or a² + b² = c².

Triangularity,  49  31 bytes
...)...
..IEO..
.M)2s^.
}Re+=..

Try it online!
Explanation
Every Triangularity program must have a triangular padding (excuse the pun). That is, the ith line counting from the bottom of the program must be padded with i - 1 dots (.) on each side. In order to keep the dot-triangles symmetrical and aesthetically pleasant, each line must consist of 2L - 1 characters, where L is the number of lines in the program. Removing the characters that make up for the necessary padding, here is how the code works:
)IEOM)2s^}Re+=     Full program. Input: STDIN, Output: STDOUT, either 1 or 0.
)                  Pushes a zero onto the stack.
 IE                Evaluates the input at that index.
   O               Sorts the ToS (Top of the Stack).
    M)2s^}         Runs the block )2s^ on a separate stack, thus squaring each.
          R        Reverse.
           e       Dump the contents separately onto the stack.
            +      Add the top two items.
             =     Check if their sum is equal to the other entry on the stack (c^2).

Checking if a triangle is right-angled in Triangularity...

Java (OpenJDK 8), 68 bytes
a->{java.util.Arrays.sort(a);return a[0]*a[0]+a[1]*a[1]==a[2]*a[2];}

Try it online!

Can you save some bytes using currying rather than an array?

@AdmBorkBork Nope, because sort takes an array.

Suggest Math.hypot(a[0],a[1])==a[2] instead of a[0]*a[0]+a[1]*a[1]==a[2]*a[2]

PowerShell, 39 bytes
$a,$b,$c=$args|sort;$a*$a+$b*$b-eq$c*$c

Try it online!
Sorts the input, stores that into $a,$b,$c variables. Then uses Pythagorean theorem to check whether a*a + b*b = c*c. Output is either Boolean True or False.

05AB1E, 6 bytes
n{R`+Q

Try it online!

The first example fails to detect [1,1,1] is not a valid input (common issue on some other attempts), but the second works fine.

@NickLoughlin Oops, removed first example

You could do n{RÆ_ to save a byte.

@Emigna The _ could also be a >, since in this case they have the same effect - making a truthy output if the top of stack is 0 and falsy otherwise. Since 1 is the only truthy value in 05AB1E, > will increment 0 to 1 and output it; for other values, it will increment it and output it. Since any value other than 1 is falsy, it will be a falsy output.

Perl 5, 34 +2 (-ap) bytes
$x+=($_*=$_)/2for@F;$_=grep/$x/,@F

seems that can be shortened to 29 +2 but there is a warning: smartmatch is experimental
$x+=($_*=$_)/2for@F;$_=$x~~@F

the question i couldn't prove but it works in all tests i've tried is if the number (a^2+b^2+c^2)/2  can be a substring of a number (a^2/2 b^2/2 or c^2/2) which would give a false positive.
Try It Online

This can cut down to 35 + 2 by eliminating the @F assignment: Try it online!

@Xcali, thanks, and even 34 +2, editing

We don't count -ap as +2 bytes, but, instead, Perl 5 with the -ap flags is not the same language as Perl 5 without any flags.

thanks Erik seems the rules have changed since i've posted, don't hesitate to update

Ohm v2, 8 6 bytes
²DS)Σε

Try it online!

Racket, 64 60 bytes
(λ(a b c)(=(+(* a a)(* b b)(* c c))(*(expt(max a b c)2)2)))

Try it online!
How it works
Tests if a^2 + b^2 + c^2 is equal to twice the largest of a^2, b^2, and c^2.
Returns #t for right triangles and #f for all other inputs.

-4 bytes thanks to @xnor's suggestion to use expt.

Awesome ;) but i think (define fun must be a part of the code...

Thank you! I think it's conventional to say that pure functions are allowed as answers. The (define fun ...) on TIO is just for convenience: we could equally well use this function as (... 3 4 5) where ... is the function. (So we could have a header of (print ( and a footer of 3 4 5)) if you prefer.)

(But this is one of my first Racket submissions, so I'm not too clear on what Racket-specific conventions there are, if any. Some past solutions using Racket have included #lang racket in the code; some haven't.)

Racket is so wordy that it's shorter to repeat (max a b c) than to do a let binding, huh? I don't suppose it would be shorter to bind as an argument to a λ? Or, isn't there an exponentiation built-in?

I tried some variants along those lines and none were shorter; I didn't try this one, but it looks like ((λ(x)(* x x 2))(max a b c)) doesn't beat (*(max a b c)(max a b c)2) either. There is an exponentiation built-in, but (expt x 2) is worse than (* x x).

@MishaLavrov Then how about (*(expt(max a b c)2)2)?

Can't believe I missed that one. Thanks!

Gaia, 6 bytes
s¦ΣḥuĖ

Try it online!

s¦ - square each.
Σ - sum.
ḥ - ḥalve.
u - square root.
Ė - contains? Check if the square root is in the input.

Is it better than sorting version?

@mdahmoune I believe it is better. I will try to solve it the other way around, but TBH I think that'd be longer.

Upvote any way :)

RProgN 2, 10 bytes
§²2^r]‘\+e

Explained
§²2^r]‘\+e
§           # Sort the input list
 ²2^r       # Square each element in the list.
     ]      # Duplicate it on the reg stack.
      ‘     # Pop the top (largest) element off it
       \+   # Swap it, sum the rest of the list.
         e  # Are they equal?

Try it online!

Why duplicate the list?

@mdahmoune RProgN2 doesn't keep the original list on the stack when popping an element off it, but stacks are by reference, so to keep the stack to do the sum part of it, it needs to be duplicated first.

Thanx upvote ;)

Pari/GP, 29 24 bytes
f(v)=v~==2*vecmax(v)^2

Try it online!
Saved five bytes by an obvious change from norml2(v) to v*v~.
Inspired by other answers.
Here v must be a row vector or a column vector with three coordinates.
Example of use: f([3,4,5])
Of course, you get rational side lengths for free, for example f([29/6, 10/3, 7/2]).
If I do not count the f(v)= part, that is 19 bytes. The first part can also be written v-> (total 22 bytes).
Explanation: If the three coordinates of v are x, y and z, then the product of v and its transpose v~ gives a scalar x^2+y^2+^z^2, and we need to check if that is equal to twice the square of the maximum of the coordinates x, y, z.
Extra: The same f tests for a Pythagorean quadruple if your input vector has four coordinates, and so on.

If possible, please include a link to an online testing environment so other people can try out your code!

@mdahmoune You can use this tio.run link. However, it is much nicer to just install PARI/GP locally.

TI-Basic, 13 11 10 bytes
max(Ans=R►Pr(min(Ans),median(Ans

Now works for inputs in any order and is shorter as well. Another -1 thanks to @MishaLavrov

If possible, please include a link to an online testing environment so other people can try out your code!

This only detects sorted right triangles: input of A=5, B=4, C=3 would not be correctly handled.

@MishaLavrov Thanks for pointing that out, it's actually shorter handling as a list. Now it works for inputs in any order.

If we leave off a single ), then max(Ans=R►Pr(min(Ans),median(Ans is also valid (though the computation we're doing here is different) and is one byte shorter.

@MishaLavrov That's interesting, I see what you mean. I think the expressions are equivalent for all non-negative inputs.

Ruby, 31 bytes
->a{a,b,c=*a.sort;a*a+b*b==c*c}

Takes input as a list of 3 integers. Uses some ideas from other solutions.

I just realized the answer I just posted is almost identical to yours. I promise I didn't copy yours (I actually had it sitting for a while in the "Post an answer" box), but since yours was submitted first, if you think mine is too close, I'll delete it.

@iamnotmaynard It's pretty much the same thing. this was a funny coincidence lol. Thanks for letting me know

If possible, please include a link to an online testing environment so other people can try out your code!

CJam, 9
q~$W%~mh=

Try it online
Explanation:
q~      read and evaluate the input (given as an array)
$W%     sort and reverse the array
~       dump the array on the stack
mh      get the hypotenuse of a right triangle with the given 2 short sides
=       compare with the longer side

Some explanations ;) ?

@mdahmoune here you go

Dang it.  Didn't you write that language? Doesn't seem fair. (joke)

Common Lisp, 64 bytes
(apply(lambda(x y z)(=(+(* x x)(* y y))(* z z)))(sort(read)#'<))

Try it online!
As usual in Common Lisp, true is T and false is NIL.

MS Excel, 48 Bytes
Anonymous worksheet function that takes input from the range [A1:C1] and outputs to the calling cell.
=Let(a,A1^2,b,B1^2,c,C1^2,Or(a+b=c,b+c=a,a+c=b))

JavaScript 6, recursive way, 40 Bytes
f=(a,b,c)=>c<a|c<b?f(b,c,a):a*a+b*b==c*c

f=(a,b,c)=>c<a|c<b?f(b,c,a):a*a+b*b==c*c
console.log(f(4,5,3));
console.log(f(4,5,6));

C (gcc), 42 bytes
f(a,b,c){c=c<a|c<b?f(b,c,a):a*a+b*b==c*c;}

Try it online!

That's a nice approach!

Excel, 47 bytes
Returns FALSE for right-angled Triangles, else TRUE:
=ISERR(FIND(SQRT((A1^2+B1^2+C1^2)/2),A1&B1&C1))

Now that is clever

Is there proof why it work?

Proton, 31 bytes
k=>(sum(j*j for j:k)/2)**.5in k

Try it online!
Credit to user202729 for the idea go upvote them

Neim, 6 bytes
ᛦDᚺS

Try it online!

Could you plz add some explanations?

@mdahmoune You can activate debug mode to see what's going on.

Dyalog APL, 17 16 bytes
{(+/2÷⍨⍵*2)∊⍵*2}

Try it!
Outputs 1 for true, 0 for false.
Thanks to @Adám for 1 byte.
How it works
{(+/2÷⍨⍵*2)∊⍵*2}          # Anonymous function
 (     ⍵*2)               # Each input (⍵) to the 2nd power
    2÷⍨                   # divided by 2
  +/                      # Sum
           ∊              # "is in"
            ⍵*2           # Each input (⍵) to the 2nd power

This uses the same logic as @user202729's Jelly answer, so some credit goes to them.

You should probably update the code on the top, it still has those parens around ⍵*2

(⍵*2)÷2 can be golfed to 2÷⍨⍵*2.

Swift 3, 81 bytes
func r(v:[Int]){let a=v.sorted{$0<$1};print("\(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])")}

Batch, 61 bytes
@cmd/cset/ax=%1*%1,y=%2*%2,z=%3*%3,!((x+y-z)*(y+z-x)*(z+x-y))

Outputs 1 or 0 appropriately.

Pyth, 14 bytes
K_m*ddSQqstKhK

Try it online!

Tcl, 70 bytes
proc R {a b c} {expr $a[set H ==hypot(]$b,$c)||$b$H$a,$c)||$c$H$a,$b)}

Try it online!
Still too long.

You think it can be more golfed?

Failed outgolf: proc R L {expr hypot([lindex [set L [lsort $L]] 0],[lindex $L 1])==[lindex $L 2]}

Another fail: proc R L {expr hypot([[set I lindex] [set L [lsort $L]] 0],[$I $L 1])==[$I $L 2]}

Thanx for the additional less golfed solutions, could you add them to the answer plz?

I already tried to understand some solutions posted on other answers, and it happens, I will add more golfy solutions to main answer using the same approach. I will not publish the fails on the main answer as they are more recent and less golfy; and are also clickable links on the comments to working online demos.

Eukleides, 81 bytes
x=number("")^2;y=number("")^2;z=number("")^2
print x==y+z or y==x+z or z==y+x?1|0

I thought Eukleides would handle this nicely using geometric builtins, but this actually turned out to be longer than just testing against the Pythagorean theorem, because the right triangle assertion is picky about order, and we have to turn our sides into a triangle first:
d e f triangle number(""),number(""),number("")
print right(d,e,f)or right(e,f,d)or right(f,d,e)?1|0

...which is 100 bytes. One nice thing about that one is it'll error out given an impossible triangle. Anyway, for either one, input is via STDIN, output is 1 for right, 0 for non-right via STDOUT. Doing a function was actually longer in this instance.

Pyth, 11 10 bytes
}/sK^R2Q2K

Try it online!
My first Pyth submission! Explanation:
     R        right map
    ^ 2       squaring
       Q      of the input
   K          save this in K
  s           sum up
 /      2     divide by 2
}        K    test if this sum is in K

saved a byte thanks to Mr. Xcoder

10 bytes: }/sK^R2Q2K or /K^R2Q/sK2 (the former returns True/False, the latter returns 1/0)

C++, 156 bytes
bool f(int*a){int g=[](int*b){return b[0]>b[1]?b[0]>b[2]?0:2:b[1]>b[2]?1:2;}(a);int c[2]={g?0:1,g>1?1:2};return pow(a[c[0]],2)+pow(a[c[1]],2)==pow(a[g],2);}

Since this doesn't work without the #include<math.h>, you need to include it in the bytecount. Note that instead of using pow, you can just multiply each element with itself to avoid the #include.

If possible, please include a link to an online testing environment so other people can try out your code!

135 bytes

Racket, 109 bytes
#lang racket/base
(define (isright a b c)
  (if (equal? (+ (* a a) (* b b)) (* c c))
      "yes"
      "no"))

Try it online!

It seems not working for 5 3 4?

So this answer is not valid for the challenge. Also if you don't do trivial golfs such as those ones just because you're lazy then you are not a serious contender to the challenge.

@user202729 While valid to point out, that may not be the most helpful way to address a new user.

@sdfbhg The "trivial golfs" being pointed out are that (1) by convention we say that a pure function (λ expression) is a valid solution, leaving the # lang and define to the header and (2) an easy way to make the code shorter is to delete spaces around parentheses. Also, you can return #t and #f rather than "yes" and "no", bringing us here.

The point of both of these is so that different Racket submissions can be on an equal footing: if one person decides to write #lang racket and leave in spaces while another does not, we can't easily compare the actually different optimizations they found. (Anyway, as has been also mentioned, your submission needs to be fixed to work for right triangles not listed in a-b-c order.)

Dyalog APL, 12 bytes
(+/2÷⍨×⍨)∊×⍨

Uses the same method as this Jelly answer.
Try it online!

MY, 13 bytes
22ω^÷Σ2ω^=Σ←

Try it online!
This helped me realize ... I screwed up the NOT function (and the boolean conversion function).
How it works (cross-compatible function)
22ω^÷Σ2ω^=Σ←
2             = push 2 to the stack
 2ω^          = push ω^2 to the stack (functions vectorize)
    ÷         = pop a, then b. push a/b (rational) to the stack
     Σ        = sum
      2ω^=    = equality test with ω^2
          Σ  = boolean conversion
            ← = output

You can ask Dennis to pull it yourself here or by contacting him at feedback@tryitonline.net

Is it possible to avoid computing ω^2 twice?

Maybe somehow, but MY doesn't have a duplicate command yet.

CJam 10
q~$_.*~-+!

Simplest one I found but also shortest
q reads input as string. Leave input formatted as array [3 4 5]
~ dumps it to stack
$ sorts array
_ duplicates array
.* multiplies each element by itself
~ dumps array to stack
-+ determines largest minus two smallest numbers
! if 0 return 1 and 0 if anything else

Try it online

If possible, please include a link to an online testing environment so other people can try out your code!

@mdahmoune sure. done.

Go, 96 94 bytes
package r;import"sort";func I(i...int)bool{sort.Ints(i);return i[0]*i[0]+i[1]*i[1]==i[2]*i[2]}

Test:
import "r"
import "fmt"

func main() {
    fmt.Println(r.I(3, 5, 4))
    fmt.Println(r.I(12, 37, 35))
    fmt.Println(r.I(21, 38, 5))
    fmt.Println(r.I(210, 308, 15))
}

Try it online!

Is it possible to do it without sorting?

I tried to do some stuff with complex numbers, but they were all higher character count. import "math/cmplx";cmplx.Abs()

You can drop the space between import and "sort"

Jq 1.5, 31 23 bytes
map(.*.)|.[[add/2]]!=[]

Expects input in form of 3 element array, e.g. [5, 3, 4]
Expanded
  map(.*.)           # square each element
| .[[ add/2 ]]!=[]   # true if index of sum/2 element exists

Thanks to mdahmoune for suggesting shorter approach then my original one.
Try it online!

Jq 1.5, 31 bytes
sort|map(.*.)|(.[:2]|add)==.[2]

Expects input in form of 3 element array, e.g. [5, 3, 4]
Expanded
  sort                   # put elements in order
| map(.*.)               # square each element
| (.[:2]|add) == .[2]    # is sum of first two equal to third?

Try it online!

The problem is equivalent to whether (a² + b² + c²) ÷ 2 is in {a², b², c²}, do you think this approach will be shorter on Jq?

Indeed that's a better approach.  Thanks!

Could you plz add also the first solution too :)

Done!  See also original edit

APL (Dyalog), 10 bytes
(+/∊×∘2)×⍨

Try it online!
×⍨ square (lit. multiplication selfie)
(…) apply the following anonymous tacit function on that:
 +/ the sum
 ∊ is a member of
 ×∘2 the doubled amounts

Two answers found by refining the answer by Steadybox and incorporating the technique in the Java answer by Kevin Cruijssen:
C, 52 bytes
f(a,b,c){return(a*=a)+(b*=b)==(c*=c)|b+c==a|c+a==b;}

C, 74 bytes
#define _(a,b,c)a*a+b*b==c*c||
f(a,b,c){return _(a,b,c)_(b,c,a)_(c,a,b)0;}

Test program
#include <stdio.h>
int test(int a, int b, int c, int expected)
{
    int actual = f(a,b,c);
    if (expected != actual) {
        fprintf(stderr, "%d %d %d => %d\n ", a,b,c, actual);
        return 1;
    }
    return 0;
}

int main()
{
    return test(5, 3, 4, 1)
        +  test(3, 5, 4, 1)
        +  test(12, 37, 35, 1)
        +  test(21, 38, 50, 0)
        +  test(210, 308, 250, 0)
        ;
}

If possible, please include a link to an online testing environment so other people can try out your code!

I've provided a main() - anyone can try the code!  It's all standard C...

Pushy, 10 8 bytes
GK2ek+=#

Try it online!
Managed to cut off two bytes by changing the approach, here's how it works now:
          \ Implicit Input                  eg. [3, 4, 5]
G         \ Sort the stack descendingly         [5, 4, 3]
 K2e      \ Square all items                    [25, 16, 9]
    k+    \ Sum last two                        [25, 25]
      =   \ Check equality (1 or 0)             [1]
       #  \ Output result                       PRINT: 1

Original Version, 10 bytes
gK2eSk2/=#

           \ Input implicitly on stack.              eg. [5, 4, 3]
 g         \ Sort the stack ascendingly.                 [3, 4, 5]
 K2e       \ Square all items.                           [9, 16, 25]
 Sk2/      \ Append stack sum divided by 2               [9, 16, 25, 25]
 =#        \ Print equality of last two items (1/0)      PRINT: 1

Could you plz add the first solution too?

@mdahmoune done.

Swift 4, 68 bytes
func f(v:inout[Int]){v.sort();print(v[0]*v[0]+v[1]*v[1]==v[2]*v[2])}

Accepts a mutable array as inout argument and prints true or false.
Swift Sandbox.

Octave, 29 bytes
sum(a=input("").^2)==max(2*a)

Try it online!
Input has to be given in a format octave understands as a vector, like [3 5 4] or [12;35;37].
Checks for Pythagoras's theorem: first, square all the sides, then check if the sum of squares of all the sides is twice the square of the hypotenuse.
Output will be either ans = 1 or ans = 0

Could you add some explanations?

Sure. There you go.

C# (53)
The shortest possible code I could find was the one that looks like the JAVA solution:
(a,b,c)=>{return(a*=a)+(b*=b)==(c*=c)|a+c==b|b+c==a;}

Try it online
Array-input (58)
a=>{Array.Sort(a);return a[0]*a[0]+a[1]*a[1]==a[2]*a[2];};

Add++, 25 18 bytes
D,f,?,caaBcB*#s/2=

Try it online!
-7 bytes thanks to mdahmoune
Yes, I got outgolfed in my own language by 7 bytes. So what?
How does it work?
D,f,?,      - Create a variadic function, f. Example arguments: [5 3 4]
      c     - Clear the stack;      STACK = []
      a     - Push the arguments;   STACK = [[5 3 4]]
      a     - Push the arguments;   STACK = [[5 3 4] [5 3 4]]
      Bc    - Push the columns;     STACK = [[5 5] [3 3] [4 4]]
      B*    - Product of each;      STACK = [25 9 16]
      #     - Sort the stack;       STACK = [9 16 25]
      s     - Push the sum;         STACK = [9 16 25 50]
      /     - Divide;               STACK = [9 16 2]
      2     - Push 2;               STACK = [9 16 2 2]
      =     - Equal;                STACK = [9 16 1]

Implicitly return the top element on the stack
Old version
D,f,?,c2 2 2B]a@BcB`#s/2=

The only difference is the squaring of each element (aaBcB* in the golfed version, 2 2 2B]a@BcB` in this version), so I'll quickly explain how this part works
              - Stack is currently empty
2 2 2         - Push 2 three times;             STACK = [2 2 2]
     B]       - Wrap the stack in an array;     STACK = [[2 2 2]]
       a      - Push the arguments as an array; STACK = [[2 2 2] [5 3 4]]
        @     - Reverse the stack;              STACK = [[5 3 4] [2 2 2]]
         Bc   - Push the columns of the stack;  STACK = [[5 2] [3 2] [4 2]]
           B` - Reduce each by exponentiation;  STACK = [25 9 16]

Why not push the input twice and reduce by multiplication?

@mdahmoune because I over complicate things. Golfing now

Upvote ;) please can you put the first solution too, it’s interesting

@mdahmoune added!

CJam, 12 11 bytes
This is depressingly long.
{$2f#)\:+=}

Try it online!
Anonymous block that takes input as an array of integers on the stack and returns 1 (truthy) or 0 (falsey).
Explanation:
{      e# Stack:        [12 37 35]
 $     e# Sort:         [12 35 37]
 2f#   e# Square each:  [144 1225 1369]
 )     e# Pop:          [144 1225] 1369
 \     e# Swap:         1369 [144 1225]
 :+    e# Sum:          1369 1369
 =     e# Equal:        1
}      e# Result: 1 (truthy)

Old solution
{2f#_:+2/#)}

Try it online!
Anonymous block that takes an array of integers on the stack and returns a truthy or falsy integer.

I like the swap trick ;)

Is it possible to add a link to test the solution please?

@mdahmoune TIO links added, thanks.

@Challenger5 what are the rules for including code in the header/footer like that?  If I accept the input as array (realize I can do now) and include "q~" in the header like you did my answer is only 8.

@kaine The way CJam works is that {} defines an anonymous function that accepts input from the stack. q~ reads input and places it on the stack, and the ~ at the end runs the block. I don't have to score that part because anonymous functions are allowed by default, so I put it in the header/footer.

Ok. Thanks. That means i can make mine 10 by using those rules. The brackets, however are required.

@kaine Yes, that's true.

Stacked, 18 bytes
[sorted:*rev...+=]

Try it online!
Explanation
This is an anonymous function that takes an array of three integers. It sorts  (sorted), squares each element of the array (:*), and reverses the array with rev. This will give an array with the largest value in the front. ... pushes each individual member of the array onto the stack, which would make the stack look like:
c^2  b^2  a^2

+ addes the top two members, yielding:
c^2  (b^2+a^2)

= tests for equality. yielding the expression a^2 + b^2 == c^2, which is only true for right triangles.

Like the :* part ;)

GNUOctave, 32 bytes
A=input("")
sum(A.^2)/2==max(A)^2

The input must be like : [1,2,3] so Octave can evaluate it to a Matrix.
A.^2 squares all the elements of the matrix.
Outputs 1 if the triangle is right-angled, 0 otherwise.
You can try it online : https://octave-online.net
Edit (27 bytes): I saw this answer I thought I could find a better solution. I took the idea of squaring the matrix at the beginning. I don't feel like this deserves upvotes since it wasn't really my whole idea to begin with.
A=input("").^2
sum(A)/max(A)

Outputs 2 if the triangle is right-angled and anything else if it isn't.

The newline counts as a byte too, better to replace it with ";", which also eliminates the spurious output (so the edited version is actually 28 bytes). The rules do require a specific output for both true and false cases; I don't think "anything else than 2" qualifies as specific.

Axiom, 39 bytes
f x==(y:=sort x;y.1^2+y.2^2=y.3^2=>1;0)

f(x) function
Input one list of at last 3 numbers
Output 1 (it is right triangle)
Output 0 (it is not right triangle)

Pyt, 12 8 6 bytes
²ĐƩ₂⇹∈

Explanation:
                 implicit input (as a list, i.e., "[A,B,C]")
 ²               square each element in the list
  Đ              duplicate the list (on stack twice)
   Ʃ             sum elements in list on top of stack
    ₂            divide sum by 2
     ⇹           swap top two items on stack
      ∈          check if sum/2 is in the list of squares
                 implicit print

Try it online!

If possible, please include a link to an online testing environment so other people can try out your code!

Back when I posted this answer, it wasn't on TIO

GolfScript, 10 bytes
~${.*}/-+!

Try it online!
Takes an array as input and outputs 1 for true and 0 for false.
~$           # Sort the array                  [3 4 5]       [1 2 3]
  {.*}/      # Square all elements             9 16 25       1 4 9
       -     # Subtract the last two numbers   9 -9          1 -5
        +    # Add the numbers left            0             -4
         !   # Negate the answer               1             0

Wolfram Language (Mathematica), 18 14 bytes
#.#==2Max@#^2&

Try it online!
Thanks to @att for –4 bytes!
Checks if the sum of the squared numbers is equal to twice the square of the maximum number.

Tr[#^2]->#.#

@att I must have been asleep at the wheel when I wrote this code. Thanks for the heads-up!

Templates Considered Harmful, 140 bytes
Fun<Ap<Fun<bor<Eq<Add<A<1>,A<2>>,A<3>>,bor<Eq<Add<A<2>,A<3>>,A<1>>,Eq<Add<A<3>,A<1>>,A<2>>>>>,Mul<A<1>,A<1>>,Mul<A<2>,A<2>>,Mul<A<3>,A<3>>>>

Try it online!
Anonymous function (all TCH functions are anonymous) that takes 3 integers as inputs.
Cool language that uses C++ templates evaluated by a typedef. Interestingly, this is a similar length to the actual C++ answer.

Fun<  //Anonymous function declaration
  Ap< //Apply following function with arguments (a²,b²,c²)
    Fun<
      bor<
        Eq<Add<A<1>,A<2>>,A<3>>,  // (a²+b²=c²)|
        bor<                      //((b²+c²=a²)|
          Eq<Add<A<2>,A<3>>,A<1>>,// (c²+a²=b²))
          Eq<Add<A<3>,A<1>>,A<2>>
        >
      >
    >,
    Mul<A<1>,A<1>>,Mul<A<2>,A<2>>,Mul<A<3>,A<3>> //arguments (a²,b²,c²)
  >
>

Vyxal, 35 bitsv2, 4.375 bytes
²:∑½c

Try it Online!
Ports Thunno 2
Explained (old)
s²Ṙḣ∑=
s²     # sort and square the input
  Ṙ    # reverse the list so that it's in descending order
   ḣ   # push the head of that, and the rest of that to the stack
    ∑= # does the sum of the list equal the other item?

Mathematica 39 24 bytes
With 15 bytes saved thanks to Jenny_mathy.
#^2+#2^2==#3^2&@@Sort@#&

Sort ensures that the diagonal will be the third element of z.
z[[1]]^2 means
Example
#^2+#2^2==#3^2&@@Sort@#&[{3,5,4}]

 (*True*)

Can it be done as a function?

It is a pure function, employed as if it were a single word.

3 bytes shorter #&@@(z=Sort@#)^2+z[[2]]^2==z[[3]]^2&

24 bytes:  #^2+#2^2==#3^2&@@Sort@#&

Lua, 66 bytes
function f(...)t={...}table.sort(t)print(t[1]^2+t[2]^2==t[3]^2)end

This could be simplified by using table call syntax which would mean that the table does not need to be constructed in the function, saving 9 bytes.
Try it online!
Try it online on tio.run!

PLZ could you add the two solutions?

Can be golfed with function f(...)t={...}

Are those not 66 bytes?

Excel VBA, 49 Bytes
Anonymous VBE immediate window function that takes input from range [A1:C1] and output to the VBE immediate window.
[2:2]=[(1:1)^2]:?[Or(A2+B2=C2,B2+C2=A2,A2+C2=B2)]

PHP, 48 47 bytes
sort($a);echo($a[2]**2==$a[1]**2+$a[0]**2)?1:0;

Try it online!
Outputs 1 for true, 0 for false.

If it is acceptable to emit empty string for false, you can shave the four character ternary.

Pyth - 23 22 Bytes, 22 21 if falsy value doesn't need to be the same every time
!-+^@KSQZ2^@K1 2^@K2 2

Try it online!
Returns True or False
or (if falsy value does not need to be the same every time)
-+^@KSQZ2^@K1 2^@K2 2

Try it online!
Returns 0 or a number other than 0
This can probably be golfed a lot
Explanation:
!        Logical negate; Makes 0 true and others false. Not necessary if falsy values can be different
 -       Subtract
  +      Add
   ^     To the power of
    @    Index in
     K   Assign variable K, returning K
      S  Sorted
       Q Input
     Z   Zero
    2    2
   ^     To the power of
    @    Index in
     K   Variable K
     1   1
    2    2
   ^     To the power of
    @    Index In
     K   Variable K
     2   2
    2    2

APL NARS 14 chars
{⍵∊⍨√2÷⍨+/⍵*2}

(seen in some other answer) test:
  f←{⍵∊⍨√2÷⍨+/⍵*2}
  f 3 4 5
1
  f 1 1 1
0
  f 5 3 4
1
  f 3 5 4
1
  f 12 37 35
1
  f 21 38 50
0
  f 210 308 250
0

Here ⍵ is the argument of function f.
{⍵∊⍨√2÷⍨+/⍵*2}
           ⍵*2} if ⍵=1 2 3, ⍵*2 will be 1 4 9 (square the argument ⍵)
         +/     if ⍵*2 is 1 4 9 here sum it 1+4+9=14(sum list)
     √2÷⍨       here makes d=sqrt( (sum list above)/2 )
 ⍵∊⍨            here return 1 if d is element of ⍵, else return 0
                 because ⍨ reverse arguments of its left operator ∊

This follow from this: Given a, b, c the length of one triangle, they are the length of one right triangle <=> a^2+b^2=c^2 and a,b,c different from 0.
  |\
  | \
  |  \
 a|   \c
  |    \
  |_____\
     b
  a^2+b^2=c^2 <=> (a^2+b^2+c^2)/2=(2*a^2+2*b^2)/2=a^2+b^2=c^2 <=>
  <=> (a^2+b^2+c^2)/2 ∊ {a^2, b^2, c^2}

If possible, please include a link to an online testing environment so other people can try out your code!

@mdahmoune the code would run only in a Nars interpreter... I don't know where find that interpreter in the net...( Because I use one symbol function sqrt,  not present in other Apl interpreters) So no trust in what I say... (for see if run ok one would have download Apl Nars, load the code , execute it)

So could u plz explain your solution?

@mdahmoune done... I possibly make wrong something...

@mdahmoune because I make one error in understand the code, so I change the explanation where I make that error (sqrt( sum/2))

This is 28 bytes.

05AB1E, 5 bytes
à‚nOË

Try it online!

some explanations plz :)?

nàsOQ is another. Not thinking it's possible below 5.

PHP, 44 bytes
echo($a**2+$b**2+$c**2)/2==max($a,$b,$c)**2;

Try it online!
Half the sum of the squares of the sides should equal the square of the max side.  Emits "1" for true and "" (empty string) for false.
The TIO link runs all the tests in a loop.

Let me know if taking the inputs as three independently pre-set variables abuses the The input and output can be given in any convenient format. rule.

JavaScript (Node.js), 45 bytes
(a,b,c)=>[a*=a,b*=b,c*=c].includes((a+b+c)/2)

Try it online!
Half the sum of the squares of the sides should equal the square of the max side.  Returns a bool.
The TIO link runs all the tests in a loop.

Making a shorthand function seemed shorter than a console.log().

Julia 0.6, 14 bytes
L->L'L∈2L.^2

Try it online!
Based @mdahmoune's hint that "The problem is equivalent to whether (a² + b² + c²) ÷ 2 is in {a², b², c²}" - this expresses the condition "(a² + b² + c²) is in {2a², 2b², 2c²}" for a given array L=[a,b,c].
L'L is multiplying the array by itself as a matrix multiplication, so
[a b c]*[a    = a^2 + b^2 + c^2
         b
         c]

L.^2 is elementwise squaring, so is equal to [a^2 b^2 c^2].
∈ is a synonym to in, and checks membership - so the code checks that "sum of squares evaluates to twice of any one of the squares".
Just saw @Dennis' previous Julia answer and saved a few bytes thanks to that. This golf improves on it by two bytes, by using L'L instead of L⋅L (⋅ is a 3-byte Unicode character).

Rust, 44 bytes
|n|{n.sort();n[0]*n[0]+n[1]*n[1]==n[2]*n[2]}

Try it online!
Takes in an &mut[u64] of at least three elements and proceeds to sort and test if the Pythagorean theorem holds. If sorting floats in rust were easier (it's hard because they can't implement the Ord trait, which is required by the sorting functions) I could use the hypot function and wind up with this:
|n|{n.sort();n[0].hypot(n[1])==n[2]}

which is much shorter.

SmileBASIC, 55 bytes
DEF R(T)SORT T
RETURN SQR(T[0]*T[0]+T[1]*T[1])==T[2]END

If possible, please include a link to an online testing environment so other people can try out your code!

I don't think one exists, unfortunately.

Could you PLZ tell us how can test your code?

A quick search found this: https://en.m.wikipedia.org/wiki/Petit_Computer . I don't know if you can download it and run it on DSi emulator though.

It appears it defines a function R with argument T and assumes T to be a zero indexed array containing 3 numbers. SQR must be square root function. Unlike other BASICs this one uses C-like == rather than = for comparison. I guess I would just have to find a copy of the manual online to assess it as the code is really straightforward.

Lua, 90 bytes
t={...}for k,v in pairs(t)do t[k]=tonumber(v)end table.sort(t)print(t[1]^2+t[2]^2==t[3]^2)

Try it online!

Japt, 7 bytes
øUx²z q

Try it online!

Thunno 2, 5 bytes
²DS½Ƈ

Attempt This Online!
Port of DELETE_ME's Jelly answer.
Explanation
²DS½Ƈ  # Implicit input         ->  [5, 3, 4]
²      # Square each value      ->  [25, 9, 16]
 DS    # Duplicate and sum      ->  [25, 9, 16]  50
   ½   # Halve the sum          ->  [25, 9, 16]  25
    Ƈ  # Check for containment  ->  1
       # Implicit output


text:
Yo boy, must it sum

Every positive integer can be expressed as the sum of at most three palindromic positive integers in any base b≥5.   Cilleruelo et al., 2017

A positive integer is palindromic in a given base if its representation in that base, without leading zeros, reads the same backwards. In the following, only base b=10 will be considered.
The decomposition as a sum of palindromic numbers is not unique. For example, 5 can be expressed directly as 5, or as the sum of 2, 3. Similarly, 132 can be decomposed as 44, 44, 44 or as 121, 11.
The challenge
Given a positive integer, produce its sum decomposition into three or fewer positive integers that are palindromic in base 10.
Additional rules

The algorithm used should work for arbitrarily large inputs. However, it is acceptable if the program is limited by memory, time or data type restrictions.
Input and output can be taken by any reasonable means. Input and output format is flexible as usual.
You can choose to produce one or more valid decompositions for each input, as long as the output format is unambiguous.
Programs or functions are allowed, in any programming language. Standard loopholes are forbidden.
Shortest code in bytes wins.

Examples
Since an input can have many decompositions, these are examples rather than test cases. Each decomposition is shown on a different line.
Input  ->  Output

5     ->   5
           2, 3

15    ->   1, 3, 11
           9, 6

21    ->   11, 9, 1
           7, 7, 7

42    ->   22, 11, 9
           2, 7, 33

132   ->   44, 44, 44
           121, 11

345   ->   202, 44, 99
           2, 343

1022  ->   989, 33
           999, 22, 1

9265  ->   9229, 33, 3
           8338, 828, 99

mmm, pun in the title

I wonder: is there any integer that must be composed into two palindromes? This would make a nice test case (if not, hey, golfers can use this fact and only check k=1 and k=3.)

@Lynn Seems "unlikely", as there turn out to be quite a few decompositions for each input. But as we know, intuition in maths can be so misleading...

@Lynn If you're allowing k=1 (as in the original number is already a palindrome), that means you're assuming the other 2 numbers are both 0.  So if 0 is acceptable as one of the numbers, any number which must be done with k=2 would also work for k=3 if one of the three numbers is 0.

I don't think there's any numbers that can ONLY be expressed as a sum of 2. Therefore, you can just cover the 3 and 1 case and ignore 2.

@SteadyBox interesting... "For all palindromic numbers p(n) there exists p(i)+p(j)=p(n), where p(x) is the set of all palindromic numbers?"

Brachylog, 7 bytes
~+ℕᵐ.↔ᵐ

Try it online!
Surprisingly not that slow.
Explanation
(?)~+  .          Output is equal to the Input when summed
     ℕᵐ.          Each element of the Output is a positive integer
       .↔ᵐ(.)     When reversing each element of the Output, we get the Output

What's with the random .'s in the explanation, and the (.)? Don't really know Brachylog.

@MagicOctopusUrn . is the output variable. ~+, ℕᵐ, and ↔ᵐ are predicates which have a left and right variable. The duplication of those . simply indicates that the output is involved directly in each of those 3 predicate calls. The final (.) is here to display that the output variable is implicitely the last variable of the program. Therefore, the last stated relationship is really .↔ᵐ. which means "mapping reverse on the output results in the output".

Very good at last the input  could be >10000

It's surprising that negative numbers can be considered palindromes (thus requiring ℕᵐ).

@DLosc That’s because ↔ is implemented to reverse digits only. They wouldn’t be palindromes if we treated them as strings, but this would greatly reduce expressivity in Brachylog.

Python 2, 82 79 bytes
f=lambda n:min([f(n-k)+[k]for k in range(1,n+1)if`k`==`k`[::-1]]or[[]],key=len)

Try it online!

Jelly, 12 10 9 8 bytes
ŒṗDfU$ṪḌ

Try it online!
How it works
ŒṗDfU$ṪḌ  Main link. Argument: n (integer)

Œṗ        Find all integer partitions of n.
  D       Convert each integer in each partition to base 10.
     $    Combine the two links to the left into a chain.
    U     Upend; reverse all arrays of decimal digits.
   f      Filter the original array by the upended one.
      Ṫ   Take the last element of the filtered array.
          This selects  the lexicographically smallest decomposition of those with
          the minimal amount of palindromes.
       Ḍ  Undecimal; convert all arrays of decimal digits to integers.

I just wanted to submit a solution with ~140 bytes, then I see 8 bytes and I'm like: "Nope, not gonna post mine".

Comparing scores across languages is pretty much meaningless. I've posted a Python answer myself, not because it has a chance to beat this answer, but because it's the shortest Python answer I can think of.

Python 2, 117 bytes
def f(n):p=[x for x in range(n+1)if`x`==`x`[::-1]];print[filter(None,[a,b,n-a-b])for a in p for b in p if n-a-b in p]

Try it online!
Prints a list of lists, each of which is a solution. Rod saved 9 bytes.

-9 bytes switching to function, replacing c with subtractions and using filter

@Rod Thanks! filter(None hit me as well while I was making dinner, haha. c → n-a-b is cool :)

JavaScript (ES6), 115 ... 84 83 bytes
Always returns a three-element array, where unused entries are padded with zeros.
f=(n,b=a=0)=>(r=[b,a%=n,n-a-b]).some(a=>a-[...a+''].reverse().join``)?f(n,b+!a++):r

Test cases

f=(n,b=a=0)=>(r=[b,a%=n,n-a-b]).some(a=>a-[...a+''].reverse().join``)?f(n,b+!a++):r

console.log(JSON.stringify(f(5)))
console.log(JSON.stringify(f(15)))
console.log(JSON.stringify(f(21)))
console.log(JSON.stringify(f(42)))
console.log(JSON.stringify(f(132)))
console.log(JSON.stringify(f(345)))
console.log(JSON.stringify(f(1022)))
console.log(JSON.stringify(f(9265)))

R, 126 bytes 145 bytes
Thanks to Giuseppe for golfing off 19 bytes
function(n){a=paste(y<-0:n)
x=combn(c(0,y[a==Map(paste,Map(rev,strsplit(a,"")),collapse="")]),3)
unique(x[,colSums(x)==n],,2)}

Try it online!
Explanation
R does not have a native way to reverse strings and many default string operations don't work on numbers. So first we convert the series of positive integers (plus 0) to characters.
Next we produce a vector of 0 and all palindromes.  The string reversal requires splitting each number up by characters, reversing the order of the vector and pasting them back together with no gap.
Next I want to check all groups of three (here's where the 0s are important), luckily R has a built in combination function which returns a matrix, each column in a combination.
I apply the colSums function to the matrix and keep only the elements which equal the supplied target.
Finally, because there are two 0s, any set of two positive integers will be duplicated so I use a unique function on the columns.
The output is a matrix where each column is a set of positive, pallindromic integers that sum to the target value. It is lazy and returns 0's when fewer than 3 elements are used.

128 bytes. +1, though, nice use of Map to generate palindromes!

oops, found a 126 byter

Mathematica, 49 bytes
#~IntegerPartitions~3~Select~AllTrue@PalindromeQ&

Try it online!
returns all solutions
-2~MartinEnder~bytes

#~IntegerPartitions~3~Select~AllTrue@PalindromeQ&, I think?

Jelly, 17 bytes
RŒḂÐfṗ3R¤YS⁼³$$Ðf

Try it online!
-6 bytes thanks to HyperNeutrino.
Outputs all ways. However the output consists of some duplicates.

There's an is palindrome builtin lol

Also, if you use normal (raised) range, you can remove your last 4 bytes

15 bytes

@cairdcoinheringaahing Still can beat neither Dennis nor Erik. Anyway am I going to decrypt truncated Deflate-compressed Base64-encoded URL?

@user202729 Huh, must not have copied the link correctly. The code was RŒḂÐfṗ3R¤YS⁼¥Ðf

Jelly, 14 bytes
L<4aŒḂ€Ạ
ŒṗÇÐf

Try it online!
Very, very inefficient.

Seems too much slow, even if the target is code length, for me it is not only the length

@RosLuP Here you don't aim to keep the code efficient, here you aim to shorten the code as much as possible. It has to work in theory, not necessarily in practice, since this is a [tag:code-golf] challenge, not a [tag:code-golf] [tag:restricted-complexity] or [tag:code-golf] [tag:restricted-time] challenge.

Ohm v2, 13 12 10 bytes
#Dð*3ç⁇Σ³E

Try it online!

Haskell, 90 86 79 bytes
-7 bytes thanks to Laikoni!
f=filter
h n=[f(>0)t|t<-mapM(\_->f(((==)<*>reverse).show)[0..n])"123",sum t==n]

Try it online!
Returns a list of all solutions with some duplication.

79 bytes with mapM and declaring f=filter: Try it online!

Java (OpenJDK 8), 185 bytes
n->{for(int i=0,j=n,k;++i<=--j;)if(p(i))for(k=0;k<=j-k;k++)if(p(k)&p(j-k))return new int[]{j-k,k,i};return n;}
boolean p(int n){return(""+n).equals(""+new StringBuffer(""+n).reverse());}

Try it online!
Remove 1 byte from TIO to get the correct amount because the submission doesn't contain the ; after the lambda.

This in my opinion it is better than all one other solution posted until now

@RosLuP Why is that, if I may ask?

Because at last give answers for input > 500000 (if I remember well)

Suggest i++<--j instead of ++i<=--j

Husk, 11 bytes
ḟo=⁰Σm↑3Ṗİ↔

Try it online!
-2 from DLosc.

@LuisMendo should be correct now,

That length filter is expensive. I think "take 3 from each" should work for -2 bytes: Try it online!

Proton, 117 bytes
a=>filter(l=>all(p==p[by-1]for p:map(str,l)),(k=[[i,a-i]for i:1..a-1])+sum([[[i,q,j-q]for q:1..j-1]for i,j:k],[]))[0]

Try it online!
Outputs a solution

920 as input not return the output in 1 min in tio... I not speak of 364757698688 but only 920

@RosLuP That doesn't matter. Efficiency is not an important thing in code-golf. It will theoretically work for all sizes of input so that doesn't matter; given enough time, it will give the correct output for 920.

Pyth,  16 12  10 bytes
ef_I#`MT./

Try it here!
How it works

ef_I#`MT./  ~ Full program.

        ./  ~ Integer Partitions.
 f          ~ Filter with a variable T.
     `MT    ~ Map each element of T to a string representation.
    #       ~ Filter.
  _I        ~ Is palindrome? (i.e Invariant over reverse?)
e           ~ Get last element.

05AB1E, 17 bytes
LʒÂQ}U4GXNãDO¹QÏ=

Try it online!

Outputs the result in three lists as follows:

Palindromic lists of length 1 (the original number IFF it's palindromic).
Palindromic lists of length 2.
Palindromic lists of length 3.

Axiom, 900 bytes
R(x)==>return x;p(r,a)==(n:=#(a::String);if r<0 then(a=0=>R a;n=1 or a=10^(n-1)=>R(a-1);a=10^(n-1)+1=>R(a-2));if r>0 then(n=1 and a<9=>R(a+1);a=10^n-1=>R(a+2));r=0 and n=1=>1;v:=a quo 10^(n quo 2);repeat(c:=v;w:=(n rem 2>0=>v quo 10;v);repeat(c:=10*c+w rem 10;w:=w quo 10;w=0=>break);r<0=>(c<a=>R c;v:=v-1);r>0=>(c>a=>R c;v:=v+1);R(c=a=>1;0));c)
b:List INT:=[];o:INT:=0
f(a:NNI):List INT==(free b,o;o:=p(-1,o);w:=0;c:=#b;if c>0 then w:=b.1;e:=a-o;e>10000000=>R[];if w<e then repeat(w:=p(1,w);w>e=>break;b:=cons(w,b));g:List INT:=[];for i in #b..1 by-1 repeat(b.i>e=>break;g:=cons(b.i,g));if o>e then g:=cons(o,g);n:=#g;for i in 1..n repeat(x:=g.i;x=a=>R[x];3*x<a=>break;for j in i..n repeat(y:=g.j;t:=x+y;t>a=>iterate;t=a=>R[x,y];t+y<a=>break;for k in j..n repeat(z:=t+g.k;z=a=>R[x,y,g.k];z<a=>break)));[])
D(a:NNI):List INT==(free o;p(0,a)=1=>[a];o:=a;for j in 1..10 repeat(t:=f(a);#t>0=>R t);[])

test code
--Lista random di n elmenti, casuali compresi tra "a" e "b"
randList(n:PI,a:INT,b:INT):List INT==
    r:List INT:=[]
    a>b =>r
    d:=1+b-a
    for i in 1..n repeat
          r:=concat(r,a+random(d)$INT)
    r

test()==
   a:=randList(20,1,12345678901234)
   [[i,D(i)] for i in a]

If this code has to decompose the number X in 1,2,3 palindrome, what this code does, it is try near palindrome N < X and decompose X-N in 2 palindrome; if this decomposition of X-N has success return 3 palindrome found; if it fail, it try the prev palindrome G < N < X and try decompose X-G in 2 palindrome etc. Ungolf code (but it is possible some bug)
 R(x)==>return x

-- se 'r'=0 ritorna 1 se 'a' e' palindrome altrimenti ritorna 0
-- se 'r'>0 ritorna la prossima palindrome >'a'
-- se 'r'<0 ritorna la prossima palindrome <'a'
p(r,a)==(n:=#(a::String);if r<0 then(a=0=>R a;n=1 or a=10^(n-1)=>R(a-1);a=10^(n-1)+1=>R(a-2));if r>0 then(n=1 and a<9=>R(a+1);a=10^n-1=>R(a+2));r=0 and n=1=>1;v:=a quo 10^(n quo 2);repeat(c:=v;w:=(n rem 2>0=>v quo 10;v);repeat(c:=10*c+w rem 10;w:=w quo 10;w=0=>break);r<0=>(c<a=>R c;v:=v-1);r>0=>(c>a=>R c;v:=v+1);R(c=a=>1;0));c)

b:List INT:=[]   -- the list of palindrome
o:INT:=0         -- the start value for search the first is a

--Decompose 'a' in 1 or 2 or 3 palindrome beginning with prev palindrome of o
--if error or fail return []
f(a:NNI):List INT==
    free b,o
    -- aggiustamento di o, come palindrome piu' piccola di o
    o:=p(-1,o)
    -- aggiustamento di b come l'insieme delle palindromi tra 1..a-o compresa
    w:=0;c:=#b
    if c>0 then w:=b.1 --in w la massima palindrome presente in b
    e:=a-o
    output["e=",e,"w=",w,"o=",o,"#b=",#b]
    e>10000000=>R[]   --impongo che la palindrome massima e' 10000000-1
    if w<e then       --se w<a-o aggiungere a b tutte le palindromi tra w+1..a-o
          repeat(w:=p(1,w);w>e=>break;b:=cons(w,b))
                      -- g e' l'insieme dei b palindromi tra 1..a-o,o
    g:List INT:=[];for i in #b..1 by-1 repeat(b.i>e=>break;g:=cons(b.i,g))
    if o>e then g:=cons(o,g)
    --output["g=",g,b]
    n:=#g
    for i in 1..n repeat
        x:=g.i
        x=a  =>R[x]
        3*x<a=>break
        for j in i..n repeat
           y:=g.j;t:=x+y
           t>a   =>iterate
           t=a   =>R[x,y]
           t+y<a =>break
           for k in j..n repeat
                z:=t+g.k
                z=a =>R[x,y,g.k]
                z<a =>break
    []

--Decompose 'a' in 1 or 2 or 3 palindrome
--if error or fail return []
dPal(a:NNI):List INT==
   free o
   p(0,a)=1=>[a]
   o:=a                  -- at start it is o=a
   for j in 1..10 repeat -- try 10 start values only
        t:=f(a)
        #t>0=>R t
   []

results:
(7) -> [[i,D(i)] for i in [5,15,21,42,132,345,1022,9265] ]
   (7)
   [[5,[5]], [15,[11,4]], [21,[11,9,1]], [42,[33,9]], [132,[131,1]],
    [345,[343,2]], [1022,[999,22,1]], [9265,[9229,33,3]]]
                                                      Type: List List Any
                                   Time: 0.02 (IN) + 0.02 (OT) = 0.03 sec
(8) -> test()
   (8)
   [[7497277417019,[7497276727947,624426,64646]],
    [11535896626131,[11535888853511,7738377,34243]],
    [2001104243257,[2001104011002,184481,47774]],
    [3218562606454,[3218561658123,927729,20602]],
    [6849377785598,[6849377739486,45254,858]],
    [375391595873,[375391193573,324423,77877]],
    [5358975936064,[5358975798535,136631,898]],
    [7167932760123,[7167932397617,324423,38083]],
    [11779002607051,[11779000097711,2420242,89098]],
    [320101573620,[320101101023,472274,323]],
    [5022244189542,[5022242422205,1766671,666]],
    [5182865851215,[5182864682815,1158511,9889]],
    [346627181013,[346626626643,485584,68786]],
    [9697093443342,[9697092907969,443344,92029]],
    [1885502599457,[1885502055881,542245,1331]], [10995589034484,[]],
    [1089930852241,[1089930399801,375573,76867]],
    [7614518487477,[7614518154167,246642,86668]],
    [11859876865045,[11859866895811,9968699,535]],
    [2309879870924,[2309879789032,81418,474]]]
                                                      Type: List List Any
      Time: 0.25 (IN) + 115.17 (EV) + 0.13 (OT) + 28.83 (GC) = 144.38 sec

05AB1E, 8 bytes
ÅœR.ΔDíQ

Try it online!
Explanation:
Åœ          # integer partitions of the input
  R         # reversed (puts the shortest ones first)
   .Δ       # find the first one that...
     D Q    # is equal to...
      í     # itself with each element reversed

Vyxal, 6 bytes
ṄṘ‡R⁼c

Try it Online!
ṄṘ‡R⁼c
Ṅ      # Integer partitions (from longest to shortest)
 Ṙ     # Reverse to make the shortest partitions be at the beginning
  ‡  c # Find the first element that satisfies:
   R   #  Reverse each
    ⁼  #  Equal to the original item?

Java (OpenJDK 8), 605 bytes
Prints dupes but they aren't banned afaik
a->{int i=0,j,k,r[]=new int[a-1];for(;i<a-1;r[i]=++i);for(i=0;i<a-1;i++){if(r[i]==a&(""+r[i]).equals(""+new StringBuffer(""+r[i]).reverse()))System.out.println(r[i]);for(j=0;j<a-1;j++){if(r[i]+r[j]==a&(""+r[i]).equals(""+new StringBuffer(""+r[i]).reverse())&(""+r[j]).equals(""+new StringBuffer(""+r[j]).reverse()))System.out.println(r[i]+" "+r[j]);for(k=0;k<a-1;k++)if(r[i]+r[j]+r[k]==a&(""+r[i]).equals(""+new StringBuffer(""+r[i]).reverse())&(""+r[j]).equals(""+new StringBuffer(""+r[j]).reverse())&(""+r[k]).equals(""+new StringBuffer(""+r[k]).reverse()))System.out.println(r[i]+" "+r[j]+" "+r[k]);}}}

Try it online!

APL (Dyalog), 51 bytes
{w/⍨⍵=+/¨w←(,y∘.,z),,(z←,∘.,⍨y),y←,x/⍨(⌽≡⊢)¨⍕¨x←⍳⍵}

Try it online!

Ruby, 84 bytes
Builds a list of all possible combinations of 3 palindromes from 0 to n, finds the first one whose sum matches, then prunes the zeroes.
->n{a=(0..n).select{|x|x.to_s==x.to_s.reverse};a.product(a,a).find{|x|x.sum==n}-[0]}

Try it online!

Perl 6, 51 bytes
{first *.sum==$_,[X] 3 Rxx grep {$_ eq.flip},1..$_}

Try it online!

grep { $_ eq .flip }, 1 .. $_ produces a list of all palindromic numbers from 1 to the input number.
3 Rxx replicates that list three times.
[X] reduces that list-of-lists with the cross-product operator X, resulting in a list of all 3-tuples of palindrominc numbers from 1 to the input number.
first *.sum == $_ finds the first such 3-tuple that sums to the input number.

You can save a byte by not reversing the xx 3.

Add++, 62 bytes
D,g,@,BDdbR=
D,l,@@,$b+=
D,k,@@*,
L,RÞgdVBcB]Gd‽kdG‽k€bF++A$Þl

Try it online!
~50 bytes golfed while writing up an explanation. Defines a lambda function which returns a list of lists containing the solutions.
How it works
The last line contains the main function and works by generating all sublists of lengths \$1, 2\$ and \$3\$ containing only palindromic numbers between \$1\$ and \$n\$, then discarding those whose sum does not match \$n\$.
The first section, and helper function, generates the range \$1, 2, ..., n\$, and filters out any number that isn't a palindrome. The helper function g is a palindrome checker and RÞg filters the range on g. We then save this filtered list as \$A\$ for later.
The next section can be split into three further parts:
BcB]
Gd‽k
dG‽k€bF

The first part takes the array \$A\$ ([1 2 3 4 ...]) and wraps each element in an array, yielding [[1] [2] [3] [4] ... ]. We then push \$A\$ twice and run the table quick over the function k:
D,k,@@*,

This function does basically nothing. It receives two arguments and wraps them in an array. However, the table quick, ‽ is the magic trick here. It takes two lists and generates every pair of elements between those two lists. So [1 2 3] and [4 5 6] generates [[1 4] [1 5] [1 6] [2 4] [2 5] [2 6] [3 4] [3 5] [3 6]]. It then takes its functional argument (in this case k) and runs that function over each pair, which, in this case, simply returns the pairs as is.
After the first two parts are completed, the stack contains a list of wrapped palindromic integers (all palindromic numbers of list length 1), and a list of pairs of numbers that pair each palindromic number with every other palindromic number. The third section pushes the second array again, then pushes \$A\$, and runs the table function over the two arrays. This almost generates the list of triples we need, but annoyingly, each triple has a nested pair. To remove this, we run €bF over the list which flattens each sublist. Finally, we concatenate the three lists to form a list of all required sublists.
We've generated all sublists of length \$1, 2\$ and \$3\$ containing palindromic numbers, so all we need to do now is filter those whose sum is not the input. So, we push \$n\$ again and filter each sublist of l, which returns whether the sum of the array is equal to \$n\$. Finally, we return the list of lists.

Python 3, 106 bytes
lambda n:[(a,b,n-a-b)for a in range(n)for b in range(n)if all(f'{x}'==f'{x}'[::-1]for x in(a,b,n-a-b))][0]

Try it online!
In the TIO link I used a faster (but 1 byte longer version) that takes the first valid result as a generator, rather than building the entire list of possible combinations and taking the first.

Lua, 334 bytes
m=math.floor function p(a)a=tostring(a)return a:reverse()==a end
s=io.read()function g(s) for i=s,1,-1 do if(p(m(i)))then
t=i for j=s-i,1,-1 do if (p(m(j)))then u=j for k=t-j,0,-1 do
if(p(m(k))and(k~=0)and((t+u+k)==tonumber(s)))then
print(m(t))print(m(u))print(m(k))return end end end end end end end
if(p(s))then print(s)else g(s)end

Try it online!

source: Stack Exchange

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

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

sort: votes


text:
Oscillation equality
We have objects that oscillate between two integer points, [l, r], at the speed of one unit per time unit, starting at l on t=0. You may assume l < r. For example, if an object oscillates on [3, 6], then we have:
t=0 -> 3
t=1 -> 4
t=2 -> 5
t=3 -> 6
t=4 -> 5
t=6 -> 4
t=7 -> 3
t=8 -> 4

Etc. But objects oscillate continuously, so we  also have t=0.5 -> 3.5 and t=3.7 -> 5.3.
Given two objects oscillating between [l1, r1], [l2, r2], determine if there is ever a time t such that the two objects share the same position. You make take l1, r1, l2, r2 in any convenient format, and output any truthy/falsy values.

Truthy inputs:
[[3, 6], [3, 6]]
[[3, 6], [4, 8]]
[[0, 2], [2, 3]]
[[0, 3], [2, 4]]
[[7, 9], [8, 9]]

Falsy inputs:
[[0, 3], [3, 5]]
[[0, 2], [2, 4]]
[[5, 8], [9, 10]]
[[6, 9], [1, 2]]
[[1, 3], [2, 6]]

so it's a pointy wave not a sinusoid, right?

For reference this challenge refer to this game, where you have to detect if it is possible to jump from one block to the other.

@HyperNeutrino Correct.

Can the falsy value be 0 and truthy any positive integer or must they be consistent. Even more, can falsy be the empty list and truthy be any non-empty list?

@Mr.Xcoder Both of those seem fine to me.

A good falsy test is [[1,3],[2,6]]: this falsifies the heuristic "the intervals overlap and are not the same length".

Python 2, 69 bytes
l,r,L,R=input()
d=r-l;k=1
while(R-L)*k%d:k+=1
print r-L>=k%2*d/k<=R-l

Try it online!

Husk, 13 bytes
VEΣUẊeTmȯ…¢mD

Takes input in format [[l,r],[L,R]].
Returns 0 for falsy instances and a positive integer for truthy instances.
Try it online!
Explanation
The main ideas are

A collision can only happen at an integer or half-integer coordinate.
It's enough to simulate the system until a repetition of two consecutive states is encountered.

Here's the code annotated.
VEΣUẊeTmȯ…¢mD  Implicit input, say [[0,2],[2,3]]
       mȯ      For both pairs do:
           mD   Double each: [[0,4],[4,6]]
          ¢     Cycle: [[0,4,0,4..],[4,6,4,6..]]
         …      Rangify: [[0,1,2,3,4,3,2,1,0,1,2..],[4,5,6,5,4,5,6..]]
      T        Transpose: [[0,4],[1,5],[2,6],[3,5],[4,4],[3,5],[2,6]..
    Ẋe         Adjacent pairs: [[[0,4],[1,5]],[[1,5],[2,6]],[[2,6],[3,5]],[[3,5],[4,4]]..
   U           Prefix of unique elements: [[[0,4],[1,5]],[[1,5],[2,6]],[[2,6],[3,5]],[[3,5],[4,4]]..[[1,5],[0,4]]]
  Σ            Concatenate: [[0,4],[1,5],[1,5],[2,6],[2,6],[3,5],[3,5],[4,4]..[1,5],[0,4]]
VE             Index of first pair whose elements are equal (or 0 if not found): 8

Slick answer.  Why do you need to double each?  Is that to turn the statement "collisions can only happen at integers or half integers" into "collisions can only happen at integers"?

@Jonah Yes, exactly.

Wolfram Language (Mathematica), 77 69 61 bytes
If[#>#3,#0[##3,#,#2],(z=GCD[x=#-#2,#3-#4])Mod[x/z,2]<=#2-#3]&

A pure function taking the four arguments l1, r1, l2, r2 as input: e.g., [0,3,2,4] when the intervals are [0,3] and [2,4].
Try it online!
How it works
To get a point in [a,b] close to a point in [c,d], assuming a<c<b<d, we want an odd multiple of b-a within b-c of an even multiple of d-c. If b-a has more factors of 2 than d-c, we can make this happen exactly: there will be a time when the first point is at b and the second point is at c, and then we're in good shape. If not, then the best we can do is the GCD of b-a and d-c.

JavaScript (ES6), 104 100 bytes
A naive implementation that just runs the simulation. Takes (a, b, c, d) as 4 distinct variables.
(a,b,c,d)=>(g=(X,Y)=>x==y|x+X==y&(y+=Y)==x||(x+=X)-a|y-c&&g(x>a&x<b?X:-X,y>c&y<d?Y:-Y))(1,1,x=a,y=c)

Test cases

let f =

(a,b,c,d)=>(g=(X,Y)=>x==y|x+X==y&(y+=Y)==x||(x+=X)-a|y-c&&g(x>a&x<b?X:-X,y>c&y<d?Y:-Y))(1,1,x=a,y=c)

console.log('Truthy')
console.log(f(3, 6, 3, 6))
console.log(f(3, 6, 4, 8))
console.log(f(0, 2, 2, 3))
console.log(f(0, 3, 2, 4))
console.log(f(7, 9, 8, 9))

console.log('Falsy')
console.log(f(0, 3, 3, 5))
console.log(f(0, 2, 2, 4))
console.log(f(5, 8, 9, 10))
console.log(f(6, 9, 1, 2))

JavaScript (ES6), 89 bytes
(a,b,c,d)=>[...Array((b-=a)*(d-=c)*4)].some((g=e=>i/e&2?e-i/2%e:i/2%e,i)=>a+g(b)==c+g(d))

Takes l1,r1,l2,r2 as separate arguments. Explanation: The simulation is guaranteed to repeat after (r1-l1)*(r2-l2)*2 time units (or a factor thereof); g calculates the offset of the appropriate object after i/2 time units, so i needs to range up to (r1-l1)*(r2-l2)*4.

05AB1E, 12 10 14 bytes
+4 bytes to handle negative ranges
Return 0 if falsy, or a positive integer otherwise
Use Zgarb's idea of doubling values to make same position detection easier
Thanks to @Zacharý for pointing out my mistakes
ÄZU\·εXиŸ}øüQO

Try it online!
Explanations:
ÄZU\·εXиŸ}øüQO
ÄZU\            Store in X the largest absolute number in the lists
    ·           Double lists ([3,6],[4,8] => [6,12],[8,16])
     ε   }      For each...
      X             Push X
       и            List-repeat that much times ([6,12]*12 => [6,12,6,12,6,...])
        Ÿ           Rangify ([6,12,6,...] => [6,7,8,9,10,11,12,11,...])
          ø     Zip lists ([6,7,8,...],[8,9,10,...] => [6,8],[7,9],[8,10],...)
           üQ   1 if both elements of a pair are equal, 0 otherwise
             O  Sum result list (=0 if the same position is never shared)
                Implicit output

I don't think this will work for large list ranges, because 100 seems pretty arbitrary.

@Zacharý Thanks! I've fixed it in a very ineffective way, since now lists are repeated way too many times. :-)

Actually, this might not work still (I won't be bothered to figure out how, because it would take too long, and honestly, the lists would have to be a tiny range and a HUGE range from what I think won't work)

@Zacharý It should work for arbitrary large positive integers, since the worst case would be [[0,n],[n-1, n]] and even in that case, the second list would be repeated enough times (and more) for the first one to reach its upper bound. But I forgot to take negative numbers into account: [[-100, 1], [0, 1]] does not work. Fixing it at a cost of 4 bytes :-(

Java (OpenJDK 8), 81 bytes
(l,r,L,R)->{int d=r-l,k=0;for(;(R-L)*++k%d>0;);return(r-L<R-l?r-L:R-l)>=k%2*d/k;}

Try it online!
Reusing xnor's Python algorithm.

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


text:
Determine How many Wheels There Are
Non-math explanation
This is an explanation that is meant to be approachable regardless of your background. It does unfortunately involve some math, but should be understandable to most people with a middle school level of understanding
A pointer sequence is any sequence such that \$a(n+1) = a(n-a(n))\$.
Lets pick apart this formula a little bit to understand what it means.  This just means to figure out the next term in the sequence we look at the last term, take that many steps back and copy the term we find.  For example if we had the sequence so far to be
... 3 4 4 4 3 ?

We would take 3 steps back from 3
... 3 4 4 4 3 ?
      ^

making our result 4.
Now normally we play this game on a tape that is infinite in both directions, but we can also play it on a wheel where after a certain number of steps we get back to the beginning of the sequence.
For example here is an visualization of the sequence [1,3,1,3,1,3]

Now we might notice that any number, \$x\$ in a wheel that exceeds the number of cells in the wheel, \$n\$, might as well be \$x\$ modulo \$n\$ because every complete circuit around the wheel is the same as doing nothing.  So we will only consider wheels with all members being less than the size of the wheel.
Math explanation
A pointer sequence is any sequence such that \$a(n+1) = a(n-a(n))\$.  Usually these are defined from the integers to the integers, however you might notice that the only things needed in this definition are a successor function and an inverse function.  Since all cyclic groups have both of these we can actually consider pointer sequences on any cyclic groups.
If we start looking for these types of functions we will notice that for each function there are a couple of similar functions.  For example on \$\mathbb{Z}_3\$ the following 3 are all functions that fit our requirements.
f1 : [1,2,2]
f2 : [2,1,2]
f3 : [2,2,1]

(Here a list is used to represent a function to get the result just index the list by the input)
We might notice that these functions are all "rotations" of each other.  To formalize what I mean by rotation, a function \$b\$ is a rotation of \$a\$ iff
\$
\exists n : \forall m : a(m+n) = b(m)
\$
We can actually show that if \$a\$ is a pointer sequence every rotation of \$a\$ is also a pointer sequence.  Thus we will actually consider any sequences that are rotations of each other to be equivalent.
Task
Given \$n\$ as input output the number of pointer sequences that have size \$n\$.
This is code-golf so answers will be scored in bytes with less bytes being better.
Testcases
Currently these testcases are lacking a bit, I have a computer program to generate these but it is inordinately slow at doing so.  If anyone would like to contribute larger testcases (that they can verify correct) they are free to do so.  Below some tests is a list of all the functions that I found, this might be useful for debugging.  I can't add these for the larger ones because of character limits.
If you want the code I used to generate these here it is
1 -> 1
[[0]]
2 -> 2
[[1,1],[0,0]]
3 -> 4
[[2,2,2],[2,2,1],[1,1,1],[0,0,0]]
4 -> 7
[[3,3,3,3],[3,3,3,2],[2,2,2,2],[3,3,3,1],[3,1,3,1],[1,1,1,1],[0,0,0,0]]
5 -> 12
[[4,4,4,4,4],[4,4,4,4,3],[3,3,3,3,3],[4,4,4,4,2],[4,3,4,4,2],[2,2,2,2,2],[4,4,4,4,1],[4,3,4,4,1],[4,4,2,4,1],[4,4,1,4,1],[1,1,1,1,1],[0,0,0,0,0]]
6 -> 35
[[5,5,5,5,5,5],[5,5,5,5,5,4],[5,5,4,5,5,4],[4,4,4,4,4,4],[5,5,5,5,5,3],[5,4,5,5,5,3],[5,5,5,3,5,3],[5,3,5,3,5,3],[3,3,3,3,3,3],[5,5,5,5,5,2],[5,4,5,5,5,2],[5,3,5,5,5,2],[5,5,4,5,5,2],[5,5,2,5,5,2],[5,5,2,5,2,2],[5,3,2,5,2,2],[5,2,2,5,2,2],[4,2,2,4,2,2],[2,2,2,2,2,2],[5,5,5,5,5,1],[5,4,5,5,5,1],[5,3,5,5,5,1],[5,5,4,5,5,1],[5,5,2,5,5,1],[5,5,1,5,5,1],[5,5,5,3,5,1],[5,3,5,3,5,1],[5,5,5,2,5,1],[5,5,5,1,5,1],[5,3,5,1,5,1],[5,1,5,1,5,1],[3,1,3,1,3,1],[2,2,1,2,2,1],[1,1,1,1,1,1],[0,0,0,0,0,0]]
7 -> 80
[[6,6,6,6,6,6,6],[6,6,6,6,6,6,5],[6,6,6,5,6,6,5],[5,5,5,5,5,5,5],[6,6,6,6,6,6,4],[6,5,6,6,6,6,4],[6,6,6,5,6,6,4],[6,6,6,6,4,6,4],[6,5,6,6,4,6,4],[6,4,6,6,6,4,4],[4,4,4,4,4,4,4],[6,6,6,6,6,6,3],[6,5,6,6,6,6,3],[6,4,6,6,6,6,3],[6,6,5,6,6,6,3],[6,6,4,6,6,6,3],[5,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3,7,3,1],[3,5,7,1,7,5,3,1],[3,5,3,1,3,5,3,1],[3,3,3,1,3,3,3,1],[3,1,3,1,3,1,3,1],[1,1,1,1,1,1,1,1],[0,0,0,0,0,0,0,0]]
9 -> 1049
10 -> 4304

Last case calculated by @HyperNeutrino

+1 for a really well documented challenge although I still don't fully understand it.

@ElPedro What are you still unsure of?  Perhaps I can help make this question more clear.

Jelly, 18 17 bytes
J_ịṙ1⁼
ṗṙ€RṂ€QÇ€S

Try it online!
How it works
ṗṙ€RṂ€QÇ€S  Main link. Argument: n

ṗ           Cartesian power; yield all vectors of n elements of [1, ..., n].
   R        Range; yield [1, ..., n].
 ṙ€         Rotate each vector 1, ..., and n units to the left.
    Ṃ€      Take the minimum of each array of rotations of the same vector.
      Q     Unique; deduplicate the resulting array.
            Since each vector is replaced by its lexicographically minimal
            rotation, no resulting vector will be a rotation of another vector.
       Ç€   Map the helper link over the remaining vectors.
            Vectors that represent pointer sequences map to 1, others to 0.
         S  Take the sum.

J_ịṙ1⁼      Helper link. Argument: v = (v1, ..., vn)

J           Indices; yield [1, ..., n].
 _          Subtract v, yielding [1 - v1, ..., n - vn].
  ị         Index into v, yielding [v(1 - v1), ..., v(n - vn)].
   ṙ1       Rotate the result one unit to the left.
     ⁼      Compare the result with v.

Python 2, 162 156 152 146 143 bytes
lambda n:len({min(l[i:]+l[:i]for i in R(n))for l in product(*[R(n)]*n)if all(l[-~i-n]==l[i-l[i]]for i in R(n))})
from itertools import*
R=range

Try it online!
More or less brute force:

Generates all permutations product(r,repeat=n)
Checks valid lists. all(l[-~i-n]==l[i-l[i]]for i in r)
Generates a set of the minimum (lexicographical) rotation of the valid lits min(l[i:]+l[:i]for i in r)

Recursive function that short circuits a bit:
This version is longer, but is able to calculate f(10) in ~19 secs on tio.run
On my machine, I've found:

f(11) = 16920
f(12) = 78687

Python 2, 209 bytes
lambda n:len(g(n,(-1,)*n))
r=range
g=lambda n,a,j=0:set()if any(len({-1,a[-~i-n],a[i-a[i]]})>2for i in r(j))else set.union(*[g(n,a[:j]+(i,)+a[j+1:],j+1)for i in r(n)])if j<n else{min(a[i:]+a[:i]for i in r(n))}

Try it online!
Explanation:
f=lambda n:len(g(n,(-1,)*n)) #calls the recursive function, and gets length.
#The initial circle is all -1, and is built recursively
r=range
g=lambda n,a,j=0:
#if any of the indexes so far break the pointer rule (ignored if 'empty'), stop recursion.
if any(len({-1,a[-~i-n],a[i-a[i]]})>2for i in r(j))
    return set()
else
if j<n:
    #recursively call g with a+ all numbers in range ie.(a+[0], a+[1], ..)
    return set.union(*[g(n,a[:j]+(i,)+a[j+1:],j+1)for i in r(n)])
else # if recursion depth == n, we are done. Return the smallest (lexicographically) rotation.
    return {min(a[i:]+a[:i]for i in r(n))}

Surely Python's array indexing means you can drop the %n (and then a few parentheses)?

143 bytes.

CJam, 37
ri:M_m*{:XM,Xfm<:e<=M{(_X=-X=}%X=&},,

Try it online
Pretty much brute force, and it feels kinda clumsy. It gets very slow after 6. Replace the last comma with a p to print the wheels.

Pyth, 28 bytes
l{mS.>LdQf!fn@ThY@T-Y@TYUQ^U

Test suite
First, we generate all sequences of the appropriate length with the appropriate elements. Second, we check whether there are any pointer failures. Third, map to all sorted rotations. Fourth, deduplicate and count.

Haskell, 117 112 104 bytes
f k|x<-[1..k]=sum[1|y@(h:t)<-mapM(x<$f)x,t++[h]==[y!!mod(n-a)k|(n,a)<-zip x y],and[y<=drop n y++y|n<-x]]

Brute force, so pretty slow for large inputs.
Try it online!
-5 bytes thanks to Laikoni.
-5 bytes thanks to Ørjan Johansen.

and[y<=drop i y++take i y|i<-x] saves some bytes.

@Laikoni So it does, thanks!

(1) x<$f is one byte shorter than \_->x. (2) Thanks to laziness, n`drop`cycle y saves 4 bytes over drop n y++take n y.

@ØrjanJohansen Thanks, the <$ trick is nice. drop n y++y turns out to be even shorter for the second hint.

Hm that's almost tails, so 4 more with a variant of the standard trick: all(y<=)$scanr(:)y y.

Wolfram Language (Mathematica), 150 123 bytes
nCount[Tuples[r=Range@n-1,{n}],l_/;l==Sort[l~RotateLeft~#&~Array~n][[1]]&&And@@(!1!-!0//.!a_:>l[[Mod[#+a,n,1]]]&/@r)]

Try it online!
-27 bytes thanks to att.
Explanation from 150 byte version:
p=Part[#,Mod[#2,Length@#,1]]&;            -helper function to take part of circular list

n|->
  Count[                                  -count all the
    Tuples[Range@n-1,{n}],                  -possible sequences
    _?(l|->                                 -where
      l==Sort[Array[RotateLeft[l,#]&,n]][[1]]  -the sequence is the first of all rotations of that sequence
      &&                                       -and
      And@@Array[p[l,#+1]==p[l,#-p[l,#]]&,n]   -the pointer property holds for all elements in that sequence
  )]

In lieu of |->,  (\[Function]) is recognized by TIO, and has the same byte count.

123 bytes. The first box (after the first n) is \[Function], and the second (after !1) is \[Xnor].

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


text:
Advice for ruby
How can I shorten:
p=gets.to_i
a=gets
b=gets.to_i

If my input is an integer, followed by a string, followed by an integer?

Welcome to PPCG!

For the people that will say that this is off topic, if you want to argue it is, read through meta and then message me.

Use ARGV ($*) and mass assignment
(disclaimer: I don't know Ruby, but this works on TIO)
p,a,b=$*
p=p.to_i
b=b.to_i

28 26 bytes instead of 30 (thanks to Snack for pointing out the $* trick)

ARGV can also be accessed as $* which saves two bytes

@Snack Hehe, golfing a tips answer :)

Use a lambda
Answers are typically allowed as lambda functions with your input/output being the parameters/return value of the lambda, so you can do this:
->p,a,b{...}
If you assigned this to a variable f then it would be called as
f[p,a,b]
It's generally fine to assume the types of the inputs as well, but to be safe you can mention it in your answer.
Relevant meta post about acceptable input/output methods

If you need a full program with stdin/stdout io for some reason, the shortest you can do is use the -n flag to shorten one call to gets.to_i to eval$_:
p=eval$_
a=gets
b=gets.to_i

The -n flag surrounds your code with while gets ... end, so the program will loop if more input is supplied than your program consumes.


text:
Sum the Vertex Connections
Let's say you have a positive integer N. First, build a regular polygon, that has N vertices, with the distance between neighbouring vertices being 1. Then connect lines from every vertex, to every other vertex. Lastly, calculate the length of all lines summed up together.
Example
Given the input N = 6, build a hexagon with lines connecting every vertex with the other vertices.

As you can see, there are a total of 6 border lines (length=1), 3 lines that have double the border length (length=2) and 6 other lines that we, by using the Pythagoras Theorem, can calculate the length for, which is
If we add the lengths of the lines together we get (6 * 1) + (3 * 2) + (6 * 1.732) = 22.392.
Additional Information
As structures with 2 or less vertices are not being considered polygons, output 0 (or NaN, since distance between a single vertex doesn't make much sense) for N = 1, since a single vertice cannot be connected to other vertices, and 1 for N = 2, since two vertices are connected by a single line.
Input
An integer N, in any reasonable format.
Output
The length of all the lines summed up together, accurate to at least 3 decimal places, either as a function return or directly printed to stdout.
Rules

Standard loopholes are forbidden.
This is code-golf, so the shortest code in bytes, in any language, wins.

Good luck!
Test Cases
(Input) -> (Output)
1 -> 0 or NaN
2 -> 1
3 -> 3
5 -> 13.091
6 -> 22.392

Must we really handle 1? My current entry would return nan rather than zero for example, and would just require special casing for it.

@JonathanAllan I thought about it after seeing your answer, nan is fine too, as distance between a single vertex doesn't make much sense anyways.

You should probably allow errors to be thrown too for n=1 I think.

It's hard to tell what 3 decimal places of accuracy means without an upper bound for N, since outputs get larger and floats get less precise.

@xnor As long as it is precise up to 3 decimal places for any reasonable input N, its fine is the result is less precise for huge numbers.

@IanH. I'm looking to express pi as a decimal because it may be shorter than importing a library. How many digits should I use?

@xnor Depends on how many decimal places your result will have. I don't know your algorithm, but lets say atleast 3 decimal places up to N = 100.

Python 3 (with sympy),  61 60 58 54  48 bytes
-6 (maybe even -10 if we do not need to handle n=1) thanks to xnor (further trigonometric simplification plus further golfing to handle edge case of 1 and save parentheses by moving a (now unnecessary) float cast).
Hopefully beatable with no 3rd party libraries? Yes!! but Lets get things rolling...
lambda n:1%n*n/2/(1-cos(pi/n))
from math import*

Try it online!
This uses a formula for the sum of the lengths if a polygon is inscribed inside a unit circle, n*cot(pi/2/n)/2 and adjusts the result to one for the side length being one by dividing by the sin of that cord length sin(pi/n).
The first formula is acquired by considering the n-1 cord lengths of all the diagonals emanating from one corner which are of lengths sin(pi/n) (again), sin(2*pi/n), ..., sin((n-1)pi/n). The sum of this is cot(pi/2/n), there are n corners so we multiply by n, but then we've double counted all the cords, so we divide by two.
The resulting n*cot(pi/2/n)/2/sin(pi/n) was then simplified by xnor to n/2/(1-cos(pi/n)) (holding for n>1)
...this (so long as the accuracy is acceptable) now no longer requires sympy over the built-in math module (math.pi=3.141592653589793).

yes! saved 11 bytes. cool formula!

It looks like the formula simplifies to n/2/(1-cos(pi/n)).

Good spot @xnor (so long as we may output 0.25 for n=1 - but special casing may be shorter too...)

@JonathanAllan Huh, weird that 1/4 is the result for n=1. It can be patched with 1%n*. Also, parens can be saved by moving the float inside to float(1-cos(pi/n)). I don't know sympy much, but maybe there's an arithmetic way to force a float.

@xnor Thanks! (I should have noticed the float move). sympy outputs an expression - e.g. for n=6 no cast results in an expression with a representation 3.0/(-sqrt(3)/2 + 1) - there may well be a shorter way but I don't know it yet.

@JonathanAllan What about just using import math? It should just give floats.

^

@xnor Ah, I was already on it - thanks though! (sympy was for cot).

Python, 34 bytes
lambda n:1%n*n/abs(1-1j**(2/n))**2

Try it online!
Uses the formula n/2/(1-cos(pi/n)) simplified from Jonathan Allan. Neil saved 10 bytes by noting that Python can compute roots of unity as fractional powers of 1j.
Python without imports doesn't have built-in trigonometric functions, pi, or e. To make n=1 give 0 rather than 0.25, we prepend 1%n*.
A longer version using only natural-number powers:
lambda n:1%n*n/abs(1-(1+1e-8j/n)**314159265)**2

Try it online!

Cool as a cucumber.

37 bytes: lambda n:1%n*n/(1-(1j**(2/n)).real)/2

@Neil Wow, Python can just compute roots of unity.

Well, that was the easy bit. I don't know what abs() does though.

@Neil it gets the absolute value, hence the norm, i.e. the distance from the origin.

@Neil I'm using the fact that when z is a unit vector, abs(1-z)**2 == 2*(1-z.real).

I see now, because abs(1-z)**2 == 1 - 2*z.real + z.real**2 + z.imag**2.

I've added a Python tip: https://codegolf.stackexchange.com/a/146172 although while writing that I noticed that the code only works in Python 3 now because it uses 2/n.

MATL, 16 15 bytes
t:=ZF&-|Rst2)/s

Try it online! Or verify all test cases.
This uses a commit which introduced the FFT (Fast Fourier Transform) function, and which predates the challenge by 8 days.
Explanation
The code uses this trick (adapted to MATL) to generate the roots of unity. These give the positions of the vertices as complex numbers, except that the distance between consecutive vertices is not normalized to 1. To solve that, after computing all pairwise distances, the program divides them by the distance between consecutive vertices.
t       % Implicit input, n. Duplicate
:       % Range: [1 2 ... n-1 n]
=       % Isequal, element-wise. Gives [0 0 ... 0 1]
ZF      % FFT. Gives the n complex n-th roots of unity
&-|     % Matrix of pairwise absolute differences
R       % Upper triangular matrix. This avoids counting each line twice.
s       % Sum of each column. The second entry gives the distance between
        % consecutive vertices
t2)/    % Divide all entries by the second entry
s       % Sum. Implicit display

this is beautiful

@Jonah Complex numbers FTW :-)

Grasshopper, 25 primitives (11 components, 14 wires)
I read a meta post about programs in GH and LabVIEW, and follow similar instructions to measure a visual language.

Print <null> for N = 0, 1, 2,because Polygon Primitive cannot generate a polygon with 2 or fewer edges and you will get an empty list of lines.
Components from left to right:

Side count slider: input
Polygon Primitive: draw a polygon on canvas
Explode: Explode a polyline into segements and vertices
Cross reference: build holistic cross reference between all vertices
Line: draw a line between all pairs
Delete Duplicate Lines
Length of curve
(upper) Sum
(lower) Division: because Polygon Primitive draws polygon based on radius, we need to scale the shape
Multipication
Panel: output

Mathematica, 26 bytes
uses @Jonathan Allan's formula
N@Cot[Pi/2/#]/2Csc[Pi/#]#&

Try it online!
-1 byte junghwan min

-1 byte: N@Cot[Pi/2/#]/2Csc[Pi/#]#& since 1/sin(x) = csc(x)

.5Csc[x=Pi/#]Cot[x/2]#&

Haskell, 27 bytes
f 1=0
f n=n/2/(1-cos(pi/n))

Try it online!
I just dove into Haskell, so this turns out to be a fair beginner golf (that is, copying the formula from other answers).
I've also tried hard to put $ somewhere but the compiler keeps yelling at me, so this is the best I've got. :P

Jelly, 13 12 11 bytes
Uses Jonathan Allan's formula (and thanks to him for saving 2 bytes)
ØP÷ÆẠCḤɓ’ȧ÷

Try it online!
I've always been pretty fascinated with Jelly, but haven't used it much, so this might not be the simplest form.

Save a byte by using "argument swapping dyadic chain separation", ɓ, to inline your helper link like so: ØP÷ÆẠCḤɓn1×÷

@JonathanAllan oh thanks, I'm still a beginner and knew there probably was a better way than having a new chain but didn't know how to do it

Oh, we can save another by using decrement, ’, and logical-and, ȧ: ØP÷ÆẠCḤɓ’ȧ÷ :)

oh wow thanks I hadn't thought of that

Javascript (ES6), 36 bytes
n=>1%n*n/2/(1-Math.cos(Math.PI/n))

Port of @JonathanAllan's Python 3 answer

f=n=>1%n*n/2/(1-Math.cos(Math.PI/n))
<input id=i type=number oninput="o.innerText=f(i.value)" /><pre id=o>