text:
Help me accelerate linear recurrence relation!
Background
A linear recurrence relation is a description of a sequence, defined as one or more initial terms and a linear formula on last \$k\$ terms to calculate the next term. (For the sake of simplicity, we only consider homogeneous relations, i.e. the ones without a constant term in the formula.)
A formal definition of a linear recurrence relation looks like this, where \$y_n\$ is the desired sequence (1-based, so it is defined over \$n\ge 1\$) and \$x_i\$'s and \$a_i\$'s are constants:
$$
y_n =
\begin{cases}
x_n,  & 1\le n\le k \\
a_1y_{n-1}+a_2y_{n-2}+\cdots+a_ky_{n-k}, & k<n
\end{cases}
$$
In this challenge, we will accelerate this sequence by converting it to a matrix form, so that the \$n\$-th term can be found by repeated squaring of the matrix in \$O(\log n)\$ steps, followed by inner product with the vector of initial terms.
For example, consider the famous Fibonacci sequence: its recurrence relation is \$y_n=y_{n-1} + y_{n-2}\$ with \$k=2\$, and let's use the initial values \$x_1=x_2=1\$. The recurrence relation can be converted to a matrix form:
$$
\begin{bmatrix} y_{n-1} \\ y_{n} \end{bmatrix} = \begin{bmatrix} y_{n-1} \\ y_{n-1}+y_{n-2} \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ 1 & 1 \end{bmatrix}\begin{bmatrix} y_{n-2} \\ y_{n-1} \end{bmatrix}
$$
So multiplying the matrix once advances the sequence by one term. Since this holds for any \$n\$, it can be extended all the way until we reach the initial terms:
$$
\begin{bmatrix} y_{n-1} \\ y_{n} \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ 1 & 1 \end{bmatrix}\begin{bmatrix} y_{n-2} \\ y_{n-1} \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ 1 & 1 \end{bmatrix}^2\begin{bmatrix} y_{n-3} \\ y_{n-2} \end{bmatrix} \\
= \cdots = \begin{bmatrix} 0 & 1 \\ 1 & 1 \end{bmatrix}^{n-2}\begin{bmatrix} y_{1} \\ y_{2} \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ 1 & 1 \end{bmatrix}^{n-2}\begin{bmatrix} 1 \\ 1 \end{bmatrix}
$$
In general, one way to construct such a matrix is the following:
$$
\begin{bmatrix} y_{n-k+1} \\ y_{n-k+2} \\ \vdots \\ y_{n-1} \\ y_{n} \end{bmatrix} = \begin{bmatrix} 0 & 1 & 0 & \cdots & 0 \\ 0 & 0 & 1 & \cdots & 0 \\ & \vdots & & & \vdots \\ 0 & 0 & 0 & \cdots & 1 \\ a_k & a_{k-1} & a_{k-2} & \cdots & a_1 \end{bmatrix}\begin{bmatrix} y_{n-k} \\ y_{n-k+1} \\ \vdots \\ y_{n-2} \\ y_{n-1} \end{bmatrix}
$$
Note that, if you reverse the vectors and the matrix in every dimension, the equation still holds, retaining the property of "advancing a term by matmul-ing once". (Actually any permutation will work, given that the rows and columns of the matrix are permuted in the same way.)
Challenge
Given the list of coefficients \$a_1,\cdots,a_k\$, construct a matrix that represents the recurrence relation (so that its powers can be used to accelerate the computation of \$n\$-th term of the sequence).
You can take the coefficients in reverse order, and you can optionally take the value \$k\$ as a separate input. \$k\$ (the number of terms) is at least 1.
Standard code-golf rules apply. The shortest code in bytes wins.
Test cases
In all cases, any other matrix that can be formed by permuting rows and columns in the same way is also valid.
Input
[1,1]
Output
[[0, 1],
 [1, 1]]

Input
[5]
Output
[[5]]

Input
[3, -1, 19]
Output
[[0,  1,  0],
 [0,  0,  1],
 [19, -1, 3]]
or reversed in both dimensions:
[[3, -1, 19],
 [1, 0,  0],
 [0, 1,  0]]
or cycled once in both dimensions:
[[3, 19, -1],
 [0, 0,  1],
 [1, 0,  0]]
etc.

MATL, 8 7 bytes
-1 byte thanks to @LuisMendo
Xy4LY)i

Takes the coefficients in reverse order
Try it online!
Explanation
Xy4LY)i
Xy        : Create an identity matrix of size equal to input
  4LY)    : Remove the first row
      i   : Insert input onto the stack

J, 10 8 bytes
Returns the matrix reversed in both dimensions.
,}:@=@/:

Try it online!
How it works
 ,}:@=@/:   input:             3 _1 19
       /:   indices that sort: 1 0 2
            (just to get k different numbers)
     =@     self-classify:     1 0 0
                               0 1 0
                               0 0 1
  }:@       drop last row:     1 0 0
                               0 1 0
 ,          prepend input:     3 _1 19
                               1  0  0
                               0  1  0

JavaScript (ES6), 36 bytes
a=>a.map((_,i)=>i?a.map(_=>+!--i):a)

Try it online!
Returns:
$$
\begin{bmatrix} a_1 & a_2 & a_3 & \cdots & a_{k-1} & a_k \\ 1 & 0 & 0 & \cdots & 0 & 0 \\ 0 & 1 & 0 & \cdots & 0 & 0 \\ \vdots & \vdots & \vdots & & \vdots & \vdots \\ 0 & 0 & 0 & \cdots & 1 & 0 \end{bmatrix}
$$

Io, 56 bytes
method(a,a map(i,v,if(i<1,a,a map(I,v,if(I==i-1,1,0)))))

Try it online!
Explanation
method(a,                                              )   // Input an array.
         a map(i,v,                                   )    // Map. i = index, v = value
                   if(i<1,                           )     //     If the indice is 0,
                          a,                               //         Return the inputted list
                            a map(I,v,              )      //     Otherwise, map: (I is the current index)
                                      if(I==i-1,   )       //     If I == i-1,
                                                1,         //         Return 1,
                                                  0        //     Otherwise 0

APL (Dyalog Unicode), 10 bytes
⊢⍪¯1↓⍋∘.=⍋

Try it online!
Tacit function taking the list of coefficients on the right.
Explanation
⊢⍪¯1↓⍋∘.=⍋
     ⍋   ⍋  ⍝ Grade up to obtain a list of k distinct values
      ∘.=   ⍝ Outer product with operation `equals` (identity matrix)
  ¯1↓       ⍝ Drop the last row
⊢⍪          ⍝ Prepend the list of coefficients

Python 2, 46 bytes
lambda l,k:[l]+zip(*[iter(([1]+[0]*k)*~-k)]*k)

Try it online!
Takes input as a tuple l and number of terms k, and outputs with both rows and columns reversed.
The idea is to use the zip/iter trick to create an identity-like matrix by splitting a repeating list into chunks. The is similar to my solution to construct the identity matrix but changed to have one fewer row by changing the inner multiplier k to k-1 (written ~-k).

Cool, a nice trick of which I was unaware!

Python 3, 60 58 bytes
-2 bytes thanks to @JonathanAllan
lambda a,k:[map(i.__eq__,range(k))for i in range(1,k)]+[a]

Try it online!
Takes the coefficients in reverse order

-1 byte: lambda a,k,r=range(k):[[i==j for j in r]for i in r[1:]]+[a]

@ManfP - that's invalid, k is not defined at the point it's being used by range (TIO).

lambda a,k:[map(i.__eq__,range(k))for i in range(1,k)]+[a] is 58. Returns a list of iterables, and False==0 and True==1.

@JonathanAllan oh sorry you are totally right, the perils of testing locally with shadowing variable names...

Charcoal, 12 bytes
ＩＥθ⎇κＥθ⁼⊖κμθ

Try it online! Link is to verbose version of code. Produces the "reversed in both directions" output. Works by replacing the first row of a shifted identity matrix with the input. Explanation:
 Ｅθ             Map over input list
   ⎇κ           If this is not the first row then
     Ｅθ         Map over input list
       ⁼⊖κμ     Generate a shifted identity matrix
           θ    Otherwise replace the first row with the input
Ｉ               Cast to string for implicit print

@xash Actually I was thinking of a different permutation, but either way I've probably misunderstood the question. I'll rewrite it to use the reversed in both directions option.

R, 34 bytes
function(r,k)rbind(diag(k)[-1,],r)

Try it online!
Takes the length as well; the TIO link has a k=length(r) argument so you can just input the recurrence relation.

05AB1E, 7 bytes
āDδQ`\)

Outputs reversed in both dimensions.
Try it online or verify all test cases.
Explanation:
ā        # Push a list in the range [1,length] (without popping the implicit input-list)
 D       # Duplicate it
  δ      # Apply double-vectorized:
   Q     # Check if it's equal
         # (this results in an L by L matrix filled with 0s, with a top-left to
         #  bottom-right diagonal of 1s; where `L` is the length of the input-list)
    `    # Pop and push all rows of this matrix separated to the stack
     \   # Discard the last row
      )  # And wrap all list on the stack into a list
         # (after which the matrix is output implicitly as result)

Jelly, 8 bytes
W;J⁼þṖ$$

A monadic Link accepting a list which yields a list of lists in the reversed rows & columns permutation.
Try it online!
How?
W;J⁼þṖ$$ - Link: list A                    e.g. [5,2,5,4]
W        - wrap (A) in a list                   [[5,2,5,4]]
       $ - last two links as a monad - f(A):
  J      -   range of length (A)                [1,2,3,4]
      $  -   last two links as a monad - f(J):
     Ṗ   -     pop                              [1,2,3]
    þ    -     (J) outer product (that) with:
   ⁼     -       equals?                        [[1,0,0,0],[0,1,0,0],[0,0,1,0]]
 ;       - (W) concatenate (that)               [[5,2,5,4],[1,0,0,0],[0,1,0,0],[0,0,1,0]]

C (gcc), 90 89 80 bytes
Saved 9 bytes thanks to ceilingcat!!!
i;j;f(a,k)int*a;{for(i=k;i--;puts(""))for(j=k;j--;)printf("%d ",i?i-1==j:a[j]);}

Try it online!
Inputs an array of coefficients (in forward order) along with its length.
Prints a matrix that represents the recurrence relation.

Google Sheets, 52
Closing Parens discounted.

Input cells is Row 1, starting in column B.
A2 - =COUNTA(1:1). Rules say that we can take this as input too, so I have discounted this as well. (Our "k")
A3 - =ArrayFormula(IFERROR(0^MOD(SEQUENCE(A2-1,A2)-1,A2+1)))

The output matrix starts in B1.
How it works

Since this is a spreadsheet, the input cells give us free output too. As long is it's the first row and we end up with a square set of cells, we're good. If this didn't count, we'd have to do this with Column 1 instead to use TRANSPOSE() to copy the input. (Because it's smaller than ArrayFormula())
Cache the number of columns in A2
Generate a k-1 x k matrix using SEQUENCE. Values are MOD number of columns + 1. (Diagonals are 0, otherwise something else).
Since 0^0 is 1 in Sheets, that means this effectively is a Boolean NOT() converted to an integer.
IFERROR handles input size of 1. (Output a Blank)

Pari/GP, 29 bytes
a->matcompanion(x^#a-Pol(a))~

Try it online!


text:
Legendre's (Unsolved) Conjecture
Legendre's Conjecture is an unproven statement regarding the distribution of prime numbers; it asserts there is at least one prime number in the interval \$(n^2,(n+1)^2)\$ for all natural \$n\$.
The Challenge
Make a program which only halts if Legendre's conjecture is false. Equivalently, the program will halt if there exists \$n\$ which disproves the conjecture.
Rules

This is code-golf so the shortest program in bytes wins.

No input shall be taken by the program.

The program only needs to halt or not halt in theory; memory and time constraints shall be ignored.

One may use methods other than checking every \$n\$ if they can prove their program will still only halt if Legendre's conjecture is false.

n=1 satisfies the conjecture. are you sure the program should halt there?

@roblogic The conjecture means "between" as the open interval (n^2,(n+1)^2), I will edit to clarify

The definition of "natural numbers" is ambiguous between "positive integers" and "nonnegative integers"; can you use "positive integers" instead?

@L.F. I think it's pretty clear what is meant - if 0 was included, the (negation of the) conjecture wouldn't be "unproven" for very long.

Based on a careful reading we could just submit a program that waits for input if we include a proof of the conjecture as a comment, yes?  =)

@Cireo Yes, and that was intentional; tbh if I motivated a proof of a >200yr old problem I would be ecstatic so you can go right ahead

@Cireo also note python 3: input() ties jelly if that is the case

@ManfP In some parts of the world, "natural number" unambiguously includes 0.  It's clear unless the reader isn't aware of the intended definition at all.  Not a big deal, but I still think avoiding the term is better.

So I can just submit the empty program? If the conjecture is false, that should be correct, right?

@superbrain You can, but only if you also include a proof that the conjecture is false.

JavaScript (Node.js),  49  47 bytes
A full program that stops only if there's some \$n\ge2\$ such that all \$x\in[(n-1)^2..n^2]\$ are composite.
for(x=n=2n;x-n*n;d?0:x=n*n++)for(d=x++;x%d--;);

Try it online!
Commented
for(                  // outer loop:
  x = n = 2n;         //   start with x = n = 2
  x - n * n;          //   stop if x = n²
  d ? 0 : x = n * n++ //   if d = 0, set x = n² and increment n
)                     //
  for(                //   inner loop:
    d = x++;          //     start with d = x and increment x
    x % d--;          //     stop if d divides x; decrement d
  );                  //     if we end up with d = 0, then x is prime

Upvoting cause it is literally the only answer i can read lol

Raku, 34 bytes
1...{is-prime none $_²..($_+1)²}

Try it online!
Counts upwards until it finds a number where none of the given range are prime.

05AB1E, 17 11 bytes
∞.∆DnÅNs>n@

Try it online!
-6 bytes thanks to @ovs
Explained
∞.∆DnÅNs>n@
∞                   Push an infinite list
 .∆                 Find the first item in that list that:
   D
       s>n              (n+1)^2 is
          @             larger or equal than
    nÅN                 the next prime from n^2

Instead of finding a single prime, you can just check all numbers in the range with Ÿp_W.

And I think this 11-byter should work, but for some reason it outputs the result of every iteration.

I don't think output is prohibited, it just isn't required.

@ovs You're using the wrong ∆. The one you use has codepoint 8710, while the one you should use from 05AB1E's codepage is Δ (codepoint 916). The reason it outputs every iteration is because the . and ∆ in your 11-byter act as no-ops, so it applies all the other commands on the entire infinite list (implicitly mapping those other builtins). You confused me for a moment with your answer, since even the basic ∞.∆ (∞.Δ) wasn't outputting 1, even though that worked before my vacation. xD

@KevinCruijssen thanks for looking into this. I guess should just copy commands from the documentation instead of trying to type 05AB1E code with my keyboard.

Jelly, 9 bytes
²+æR$Ṇµ2#

Try it online!
-1 byte thanks to caird coinheringaahing
-1 byte thanks to Jonathan Allan

10 bytes

9 bytes

@cairdcoinheringaahing thanks I tried using that on a different algorithm and it didn't work and I forgot to retry lol

@JonathanAllan thanks!

R, 60 55 54 bytes
Edit: -1 byte thanks to Robin Ryder
while(sd(sapply(lapply(T^2:(T=T+1)^2,`%%`,2:T),all)))T

Try it online!, or, since it's rather boring to run a program that (probably) never halts and produces no output, try a slightly longer version (exchanging n=sum( for any() that prints n and the number of primes in the interval (n-1)^2..n^2 for each n>2.
Commented original version:
while(                                  # keep looping as long as...
    any(                                # there is at least one true result among...
        sapply(T^2:(T=T+1)^2,           # the loop from T^2 up to (T+1)^2
                                        # (& use this opportunity to increment T)...
            function(x)all(x%%(2:T))    # tested for primality by checking that all
                                        # modulo divisions from 2..T have a non-zero result
        )
    )
){}

any could be sdfor -1 byte. You are then checking whether the vector contains (at least) 2 different values, i.e. both TRUEs and FALSEs. Since (T+1)^2 is necessarily a composite number, the standard deviation will be non-zero iff there is at least one prime number in the interval.

Jelly, 7 bytes
‘ɼ²ÆCµƬ

A niladic Link which, if the conjecture is False, will yield a list of counts of primes between \$2\$ and \$k^2\$ where \$k\$ is the zero-based index of the element (although the zero-indexed element will be None rather than 0). The final value in the list will be the count of primes between \$2\$ and \$n^2\$ (the next term would be the count between \$2\$ and \$(n+1)^2\$, and would be equal to that).
Note: Since this uses one of Jelly's prime related built-ins, this is subject to the underlying implementation's (sympy's) primality check, and help(sympy.ntheory.isprime) states ...[If] the number is larger than 2^64, a strong BPSW test is performed.  While this is a probable prime test and we believe counterexamples exist, there are no known counterexamples).
Try it online!
How?
Collects the counts of primes between \$2\$ and \$(k+1)^2\$ starting with \$k=0\$ until repetition would be present by appending the result. This implies there are no new primes between \$(k+1)^2\$ and \$(k+2)^2\$ (i.e. \$n^2\$ and \$(n+1)^2\$). The final result, if any, will have a leading None - the initial input to the function that performs the counting.
‘ɼ²ÆCµƬ - Link: no arguments
      Ƭ - collect up (the initial input (None) and each result) until repetition:
     µ  -   apply the monadic chain - i.e. f(x=previousResult):
 ɼ      -     recall (k) from the register (initially 0), apply, store back, and yield:
‘       -     increment -> k+1
  ²     -     square -> (k+1)²
   ÆC   -     count primes from 2 to (k+1)² inclusive

Retina 0.8.2, 67 62 bytes

_¶¶_
{`(_+)¶_*(¶_+)
_$1$2$2$1$1_
¶(_+)¶(?!_*(?!(__+)\2+$)\1)

Don't try it online! Instead, try a Retina 1 version which takes as input the number of iterations. Explanation:

_¶¶_

The working area contains n+1, n² and (n+1)², where n starts at 0 but is immediately incremented (saving 5 bytes over my previous answer which started with n=1).
{`

Repeat until Legendre's conjecture is false.
(_+)¶_*(¶_+)
_$1$2$2$1$1_

Increment n; the old (n+1)² becomes the new n² and the new (n+1)² is calculated.
¶(_+)¶(?!_*(?!(__+)\2+$)\1)

If none of the numbers between n² and (n+1)² are prime, then delete n² and (n+1)², which causes the loop to terminate, as neither stage can now match.

C (gcc), 194 180 169 bytes
#include<gmp.h>
main(){mpz_t n,l,h;for(mpz_init_set_ui(n,1),mpz_init(l),mpz_init(h);mpz_mul(l,n,n),mpz_add_ui(n,n,1),mpz_mul(h,n,n),mpz_nextprime(l,l),mpz_cmp(l,h)<1;);}

Try it online!
-14 bytes thanks to ceilingcat!
-11 bytes again thanks to ceilingcat!
To test, here's one that outputs the prime in each range:
C (gcc), 352 bytes
 #include<stdio.h>
#include<gmp.h>
#define m(X) mpz_##X
main(){m(t) n,l,h;m(init_set_ui)(n,1);m(init)(l);m(init)(h);for(;;){m(mul)(l,n,n);m(add_ui)(n,n,1);m(mul)(h,n,n);
 printf("In (");
 m(out_str)(stdout,10,l);
 printf(", ");
 m(out_str)(stdout,10,h);
 printf("): ");
m(nextprime)(l,l);if(m(cmp)(l,h)>0)return;
 m(out_str)(stdout,10,l);
 puts("");
}}

Try it online!
Note: This is probably very optimizable. When certain users inevitably improve the solution, I'll update. ;)

Wow, I really didn't put enough effort into that. Missing the for trick is just a "noob" mistake. But actively "optimizing" a prefix with a define that doesn't save any bytes and actually costs bytes is ridiculous! Nice catch!

Suggest mpz_inits(l,h,0); instead of mpz_init(l),mpz_init(h);

05AB1E, 11 bytes
First attempt:
[N>nÅMNn‹#]

Fixed (after @ovs notes):
[NÌnÅMN>n‹#

Explanation:
[NÌnÅMN>n‹#
[                     Infinite Loop
 N                    Current loop index (starts from 0 to Infinity)
  Ì                   add 2 ( we want to start from N=1 instead of N=0)
   n                  Squaring - (N+1)**2
    ÅM                Find the previous prime. Highest prime less than (N+1)**2
      N>               Push Current loop index + 1
        n              Squaring - N**2
         ‹             Does  Highest prime less than (N+1)**2 < N**2  ?
          #            If true, break the loop

Try it online!

This cannot halt because there is no prime below 1: https://tio.run/##yy9OTMpM/f/f8HCr7///AA

Interesting... Well I can increment the N so it will actually start from N=1. I'll edit it soon.

You don't need the trailing ], so you can still do it in 11 bytes.

Python 2, 45 bytes
i=k=P=1
while~i*~i-k:P*=k;k+=1;i+=i*i<k>0<P%k

Try it online!
Here's a demonstration of the code halting if we modify it to claim that all of range(36,49) is non-prime.
We use the Wilson's Theorem prime generator. We count up potential primes k, and the condition P%k>0 is met exactly for primes.  Except, we use P*=k instead of P*=k*k which makes k=4 also be called prime, but that doesn't matter here.
Here's how we halt if there's not prime between two consecutive squares. The value i tries to track the smallest number so that the square i*i is at least the current potential prime k. Every time we hit a prime k, we update i by checking if i*i<k, and if so, increment i. This makes it so that k<=i*i afterwards. But, if there is no prime between i**2 and (i+1)**2, then i won't update in that interval, and k will reach all the way to (i+1)**2. The while loop conditions checks for this (writing ~i*~i for (i+1)**2) and terminates the loop if it happens.

73 bytes
n=2
while any(all(k%i for i in range(2,k))for k in range(n*n,~n*~n)):n+=1

Try it online!
A more direct approach of checking that each interval between squares contains a prime, based on the solution of Manish Kundu

MATL, 11 10 bytes
`@U_Yq@QU<

Try it online!
-1 byte thanks to Luis Mendo. Otherwise, pretty straightforward.
`  % Start a loop
@  % Push loop index (n)
U  % square
_Yq % Get next prime
@QU % Loop index plus one, squared
<   % Continue loop if the prime is smaller than this.

Io, 124 bytes
method(x :=1;loop(s :=0;for(i,x*x,x*(x+2)+1,if(Range 1 to(i)asList select(o,i%o<1)size<3,s :=1;break));if(s<1,break);x=x+1))

Try it online!

Does (x+1)^2 not work in Io?  It doesn't seem to give an error...

@DominicvanEssen ^ is bitwise xor in Io. To actually do exponentiation, you have to do: (x+1)pow(2).

Got it.  Thanks for the mini Io lesson!

Python 3, 107 99 88 86 90 86 79 bytes
n=2
while n:n+=0<sum(min(i%j for j in range(2,i))for i in range(n*n,~n*~n))or-n

Try it online!
Initially, n=2. Then it checks if any of the 2n numbers between n^2 and (n+1)^2 are prime or not. If yes, then n is incremented, otherwise n is set to 0 and the loop terminates.
-7 bytes thanks to Jo King

I think you need to count the n=2 for the code's length.

@xnor I wasn't aware, thanks for pointing it out. Updated.

You can save 6 bytes by directly checking it in the while loop's condition.

><>, 51 bytes
/;?)*:&+1}::&<
\~:*>2:}}:}=?^:}}:}$%?2~1+l3+1.15a&4

Try it online!
Try it online! (2) shows the program terminating if starting above last prime in first range.
Explanation
/;?)*:&+1}::&<
\~:*

Prime branch, checks if first found prime is below \$(n+1)^2\$ and then increments \$n\$ and jumps up to the next range, otherwise terminates
    >2:}}:}=?^

Ends trial division if we have found a prime
              :}}:}$%?2~1+l3+1.

Branch-free trial division
/
\                             .15a&4

Initial values, starts at 10 trying to find primes below \$4^2\$

Japt, 12 11 bytes bytes
_²ôZÑ dj}f1

Test it (May cause your browser to explode!)
_               :Function taking an integer Z as argument
 ²              :  Z squared
   ZÑ           :  Z times 2
  ô             :  Range [Z²,Z²+Z*2]
      d         :  Any
       j        :    Prime
        }       :End function
         f1     :Return the first Z≥1 that returns false

Wolfram Language (Mathematica), 30 bytes
For[n=1,NextPrime[n++^2]<n^2,]

Try it online!
Special thankks to @att for saving 9 bytes

n++ evaluates first, so you shouldn't be adding n+1. Also, For with a null incr still saves one byte over While. 30 bytes

Scala, 98 93 91 87 bytes
-7 bytes thanks to Dominic Van Essen
Stream.iterate(2:BigInt)(_+1)find(n=>n*n to n*n+2*n forall(x=>n to(2,-1)exists(x%_<1)))

Without BigInt, it could be made a few bytes shorter, but then it would overflow.
It first creates an infinite list starting at 2, then tries to find an n in that list such that every number x in the range n^2 to (n+1)^2 is composite.
Try it in Scastie

I can't read or write Scala, but wouldn't you save 2 bytes (and make the function much more efficient) if for each x you check for division in the range n to 2 instead of x/2 to 2?

@DominicvanEssen You were right! Ignore my previous comment, I thought you said x to 2 instead of n to 2

I'm probably no smarter than a monkey at a keyboard...  but this seems to run without error...  (sorry if this is a waste of time: but it's fun to try-out new languages without bothering to try to learn them...)

@DominicvanEssen You know what they say - "If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs." You must be the supermonkey that evolved from a Java-writing monkey to a Scala-writing monkey :) (no offense to Perl programmers intended)

n pow 2 -> n*n and !=0 -> >0 to save 5 more bananas.

C (gcc), 88 84 bytes
Saved 4 bytes thanks to ceilingcat!!!
q;h;i;j;f(n){for(h=n=1;h;++n)for(h=0,i=n*n;q=j=++i<~n*~n;h|=q)for(;++j<i;)q=q&&i%j;}

Try it online!
Will run forever on an infinite machine (with new infinity-bit int types!) so long as there's always a prime number in the interval \$(n^2,(n+1)^2)\$.
Here's the same code modified to print the primes as they are found:
C (gcc), 161 bytes
q;h;i;j;f(n){for(h=n=1;h;++n)for(h=0,i=n*n;q=j=++i<~n*~n;h|=q){for(;++j<i;)q=q&&i%j;if(q)printf("Found prime %d in the interval (%d, %d)\n",j,n*n,(n+1)*(n+1));}}

Try it online!

Brachylog, 12 bytes
+₁;?≜^₂ᵐ⟧₂ṗⁿ

Try it online!
How it works
Brachylog will try to find a value N that fulfills the following program:
+₁;?≜^₂ᵐ⟧₂ṗⁿ
+₁            N+1
  ;?          [N+1, N]
    ≜         Try possible numbers, e.g. [5, 4]
     ^₂ᵐ      Map square [25, 16]
        ⟧₂    Range from min to max
          ṗⁿ  Succeeds if there is no prime in this range

source: Stack Exchange

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

sort: votes


text:
Separating the _____ from the _____
There are two types of people in this world: users and admins. Let's find out who the real admins are.
The task is simple:
If the script is run with elevation, print 'True' and only 'True' (only trailing newlines permitted as extra). If the script is run as an unelevated user, print 'False' and only 'False', exceptions granted for trailing new lines.
The code can be run on any operating system which is currently available free of charge, or on any CPU architecture as a code insertion OR it can run on Windows 10.
The selected operating system must have at least 3 privilege levels, and should return 'True' for any execution of code above the default user privilege level.
I couldn't find any tags for this, so please if you have suggestions, name them. Good luck!

On *nix systems, would it be valid to test that either a) the user has UID 0? or b) the user belongs to group 0? (TBH, I don't think that any of these methods correctly address the above the default user privilege level question. But I ask just to be sure.)

Is this [tag:decision-problem] (even though there's no input)? Would you consider relaxing the output requirements so that any two consistent truthy/falsy values are allowed?

What's "elevation"?

Why the requirement for 3 privilege levels? That's pretty bizarre. Common operating systems only have two and the challenge requires a boolean result. All the existing answers check admin/non-admin without caring about some third level.

I feel like this question lacks a good definition of "privilege level". Two of the three current answers make specific assumptions about system configuration. And with things like capabilities and namespacing (under linux) the distinction what counts as "elevated" doesn't always seem easy.

@ManfP Privilege levels are built directly into x86 hardware. This isn't hat hard.

@Gilles'SO-stopbeingevil' Name one operating system with two privelege levels.

@tuskiomi Unix without containers, capabilities or security frameworks. You're either root or you aren't. None of the existing answers account for anything beyond admin/non-admin, and would be wrong under any interpretation where the OS has more than 2 privilege levels.

@tuskiomi You are conflating x86's notion of "privileged" with the OS's. On all common consumer OSs, all user-mode code (including that of root/admin/...) will run as "unprivileged" user-mode, as far as x86 is concerned. It's only through syscalls to the kernel that a root-user process is able to access more resources.

@Gilles'SO-stopbeingevil' something that's downloadable and installable, something that's not 50 years old, and valid for this challenge?

@ManfP and interrupts, and protected memory ranges, and certain context changes. a lot more than syscalls.

@tuskiomi A program running as root user can't perform arbitrary (physical) memory access, nor can it directly access hardware. It can only ask the kernel to do so via syscalls. "priviledged" has a very different meaning when talking about processes than when talking about CPUs.

@ManfP Ah! So then there is a 3rd privilege level for the kernel!

Python 3, 32 bytes
-13 bytes thanks to @Arnauld
-1 byte thanks to @Dingus
import os
print(os.getuid()<1e3)

Try it online!

I'm not really sure how this works, but the code should be equivalent to print(1000!=os.getuid()).

@ovs I was about to ask the same thing. I think it's more like print(os.getuid()<1000), but I don't really speak Python.

@Arnauld oof, just realized that. Stupid mistake on my part.

You could save one byte on MacOS, where user ids start at 501 instead of 1000.

You could also save a byte by changing 1000 to 1e3.

@Dingus cool, edited!

Assuming this is meant for a unix-like platform, this is overly long and incorrect. 1000 is not a meaningful cutoff for privileges. User id 0 is privileged and others are not.

I don't think this is even right in practice on most linux systems - 1000 is where normal users start, daemons (which mostly run just as unpriviledged) will be below that.

@ManfP Exactly; it will output True whenever it is not being run as a normal user.

@sugarfl But "normal user" isn't the same as "unelevated user", it's more like "account intended for an actual human". A daemon can (and often will) run with even lower privileges than most users, and is not inherently privileged in any way. Only root (euid=0 in the root user namespace) is getting special ("privileged") treatment from the kernel, and that too keeps getting replaced by CAP_SYS_ADMIN etc.

@sugarfi There is no difference between the privileges granted to users ids in the system range and users ids in the user range. It's just a cutoff for the user creation program to use different defaults.

Bash, 39 31 27 bytes
Saved 4 bytes thanks to Gilles 'SO- stop being evil'!!!
a=False
>/a&&a=True
echo $a

Try it online!
Works on any *nix system.
Explanation
a=False         # set env variable a to False
>/a             # try to create (>) (or overwrite if it exists) file /a
                # but directory / has root write privileges
                # and if /a is created by root in a
                # previous run the file will have root only
                # write privileges
   &&a=True     # if this succeeds set a to True
                # if this fails a will be left as is
echo $a         # will be True for root and False otherwise

Creating new files in /bin should also be disallowed for non-root, so you could use >/bin/9 or something that isn't an existing file on standard systems.  Or >/9 should work; any sane system won't have unprivileged users able to create files in the root directory.  On my Arch GNU/Linux system, /, /bin and /bin/[ have the same rwx-xr-x permissions, and no ACLs, so this fails for all non-root users.  The question talks about systems with 3 permission levels; IDK if accounts like systemd-journal have more persmissions; just different.

I feel that trashing your system is an undesirable side-effect...

@PeterCordes Indeed the privileges of /bin itself only allow root to create files there, changed.

@Neil It shows the great responsibility the comes with the power of root! T_T

You can remove /bin.

@Gilles'SO-stopbeingevil' Came back to make that change - thanks! :-)

Batch, 32 bytes
fltmc>nul&&echo True||echo False

Taken from this Stack Overflow answer.

you can cut two bytes if you redirect to a single-letter file

@peterferrie Surely that will throw an error if you don't have the rights to create the file? For a question where rights are important, I wouldn't want to mess it up!

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


text:
Paper Folding for the win
Paper Folding for the win

"How many times can you fold a paper?" - This well known question led to many arguments, competition, myths and theories.
Well, the answer to that question depends on many properties of the paper (length, strength, thickness, etc...).
In this challenge we will try to fold a piece of paper as much as we can, however, there will be some constraints and assumptions.

Assumptions:

The paper will be represented in pixel-sized cells. The length and width of the paper is N x M respectively (which means you can not fold a pixel/cell in the middle).
Unlike real paper, each spot (pixel) of the paper has its own thickness.

A paper:
A paper will be represented as a 2D M x N Matrix as the top-view of the paper. Each cell of the matrix will contain a number that will represent the thickness of the paper's pixel. Area with no paper is the cell with the number 0.
Paper representation example:
     Option 1                        Option 2

2 1 1 1 1 1 1 1 2              [[2,1,1,1,1,1,1,1,2],
1 1 1 1 2 1 1 1 1              [1,1,1,1,2,1,1,1,1],
1 1 1 2 3 2 1 1 1              [1,1,1,2,3,2,1,1,1],
1 1 1 1 2 1 1 1 1              [1,1,1,1,2,1,1,1,1],
2 1 1 1 1 1 1 1 2              [2,1,1,1,1,1,1,1,2]]

A fold:
A fold is a manipulation on the matrix defined as follows:
Assuming there is a 2 pixels fold from the right side of the paper in the example above, the size of the paper will now be N-2 x M and the new thickness of the pixels will be the summation  of the previous thickness of the cell + the thickness of the mirrored cell relative to the fold cut:
            ___
           /   \
          \/<-- |
2 1 1 1 1 1 1|1 2            2 1 1 1 1 3 2
1 1 1 1 2 1 1|1 1            1 1 1 1 2 2 2
1 1 1 2 3 2 1|1 1    ===>    1 1 1 2 3 3 2
1 1 1 1 2 1 1|1 1            1 1 1 1 2 2 2
2 1 1 1 1 1 1|1 2            2 1 1 1 1 3 2

Constraints:

You can fold a paper from 4 directions only: Top, Left, Right, Bottom.
The fold will be symmetric, which means, if you fold 2 pixels of the paper from the left, all of the cells in the first and second columns will be folded 2 pixels "mirrorly".
A thickness threshold of a paper cell will be given in each case, a cell can not exceed that threshold at any time, which means, you will not be able to fold the paper, if that specific fold will result exceeding the thickness threshold.
Number of pixels being fold must be between 0 and the length/width of the paper.
Do not exceed with your folding the initial dimensions and position of the paper. ( there is no pixel -1 )

Input:

A paper (represented as described before)
Thickness threshold

Output:

A list of folds that yields a valid paper (with no pixels exceeding the thickness threshold) folded in any way you want (using any heuristic or algorithm you've implemented).

Scoring:
The goal is writing a program that will output a set of folds that result in the minimum possible number of remaining pixels for any input.
Since this is a code-golf, the shortest code wins.

Examples:
Example:
Threshold: 9

1 1 1 1 1 1
1 1 1 1 1 1    fold 2 pixels from top   2 2 2 2 2 2    fold 3 pixels from right   4 4 4    fold 1 pixel from top
1 1 1 1 1 1    ======================>  2 2 2 2 2 2    =======================>   4 4 4    =====================>   8 8 8    No more fold possible
1 1 1 1 1 1

Optional outputs:
[2T,3R,1T]
------------or----------
[[2,top],[3,right],[1,top]]
------------or----------
Top 2
Right 3
Top 1
------or any other sensible readable way------
--------notice the order is inportant---------

Some Test cases:
Case 1:
N = 17 , M = 11 , Threshold =  16
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0
0 0 0 0 0 0 1 1 2 1 1 0 0 0 0 0 0
0 0 0 0 0 1 1 2 3 2 1 1 0 0 0 0 0
0 0 0 0 1 1 1 1 2 1 1 1 1 0 0 0 0
0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2

Case 2:
N = 20 , M = 9 , Threshold =  32
1 1 1 1 1 1 1 1 1 8 8 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 8 1 1 8 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 8 1 1 1 1 8 1 1 1 1 1 1 1
1 1 1 1 1 1 8 1 1 1 1 1 1 8 1 1 1 1 1 1
1 1 1 1 1 8 1 1 1 1 1 1 1 1 8 1 1 1 1 1
1 1 1 1 1 1 8 1 1 1 1 1 1 8 1 1 1 1 1 1
1 1 1 1 1 1 1 8 1 1 1 1 8 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 8 1 1 8 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 8 8 1 1 1 1 1 1 1 1 1

Case 3:
N = 10 , M = 10 , Threshold =  29
1 1 1 1 1 1 1 1 1 1
1 1 9 1 1 1 1 9 1 1
1 9 9 9 1 1 9 9 9 1
1 1 9 1 1 1 1 9 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 9 1 1 1 1 9 1 1
1 9 9 9 1 1 9 9 9 1
1 1 9 1 1 1 1 9 1 1
1 1 1 1 1 1 1 1 1 1

Case 4:
N = 20 , M = 12 , Threshold =  23
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 4 3
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 4
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3
1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4
1 1 1 3 4 3 1 1 1 1 1 1 1 1 1 1 2 3 4 4
1 1 1 1 3 1 1 1 1 1 1 1 1 1 2 2 3 4 4 4
1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 3 4 4 4 3
1 1 1 1 1 1 1 1 2 2 2 2 2 3 4 4 4 3 3 2
2 2 1 1 1 1 1 1 1 1 2 2 2 2 2 3 3 2 1 1
4 3 2 1 1 1 1 1 2 2 3 3 2 2 1 1 1 1 1 1
5 4 3 2 1 1 1 3 3 2 2 1 1 1 1 1 1 1 1 1

Check validity
This nodejs program will:

Check if your folded papers are valid
Check if your steps are valid

How to use:
Call the desired function in the footer.
Call validator with threshold, initial paper, and a list of steps with the format [x,d] for folding x pixels from d direction. d is one of the following strings: "RIGHT","LEFT","TOP","BOTTOM".
This function will print if the final paper as a matrix and the amount of pixels reduced.
Output will look like this:
*** PAPER IS VALID ***
Init length: 240, New length: 180, Pixels removed (score): 60

Or, if the paper isn't valid:
*** PAPER UNVALID ***
NO SCORE :(

You can see call examples commented in the code.
You can also remove the comment in the line // console.log(paper); // If you want to print the paper after each step to "debug" and print the folded paper after each fold.

As for the first question, P/S will be 0 and then we can kind of say something/0 is "Inf" which is the highest score and the bottom of the leaderboard.
But I got the point in the example Dominic gave.
I will go back to my original scoring plan, and consider only the amount of pixels removed. I am editing with the new scoring now. Thanks :)

I also added this: "Papers with no reduced pixels are also considered not valid".
So making no folds at all or making folds that are all 0-pixels sized - yields an invalid paper result, which is not eligible for scoring.

Would it be unreasonable to insist that every program removes the maximum possible number of pixels?  Then one could remove 'remaining pixels' from the score altogether, and it'd just be code-golf...

I am kind of willing to keep the number of pixels removed as a factor for score improvement. One of my first thoughts when I sandboxed it was to evaluate the score on hidden test cases (that way, people will avoid hard-coding set of folds). But I wasn't sure if it is acceptable here and how it could be operated.

Let us continue this discussion in chat.

In my opinion this challenge is very interesting but I think you can mostly only solve this using brute force. Also the modification makes it absolutely more clear but it isn't enough to suit code golf. My suggestion is to have only a thickness of 1. This may make it a lot simpler, opens the door for non brute force solutions and last but not least makes the solutions more.. "Validable".. I really think this can gain a great consensus with this little modification.

I might do so... I'll keep it for a couple of days, if it gains no interest and no entries, I'll modify it. (If there will be entries I can open a new question with the new less complicated version as well, just to keep both alive)

As promised, I opened a simpler version of this challenge

R, 425 bytes
p=function(m,t){
d=dim(m);r=d[1];c=d[2]
l=apply(matrix(c(seq(l=r-1),rep(0,r+c-2),seq(l=c-1)),,2),1,function(f){n=array(0,pmax(g<-(f-1)%%d+1,h<-(d-f-1)%%d+1))
`if`(f,n[1:g[1],]<-m[g[1]:1,],n[,1:g[2]]<-m[,g[2]:1])
n[1:h[1],1:h[2]]=n[1:h[1],1:h[2]]+m[(i=g%%d+1)[1]:r,i[2]:c]
if(max(n)<=t)cbind(c(T=f[1],L=f[2]),p(n,t))})
if(!is.null(l))l[[order(sapply(l,function(f){for(x in seq(ncol(f))){d=pmax(f[,x],d-f[,x])};prod(d)}))[1]]]}

Try it online!
This came out much longer than I expected, and also slows-down a lot for big sheets of paper with large thresholds (which could be foreseen from the approach).
Recursively tries each possible fold, keeping only results that don't exceed the threshold at any pixel, and choosing the series of folds that gives the smallest folded size.
Output is 2d list of folds, with 'T' row indicating position of horizontal folds from top, and 'L' row indicating position of vertical folds from left.
Ungolfed version:
fold_paper=p=function(m,t){             # m=matrix of paper thicknesses; t=threshold thickness;
    d=dim(m);r=d[1];c=d[2]              # get paper dimensions;
    fold_list=apply(                    # iterate over list of possible folds to this paper...
        matrix(c(seq(l=r-1),rep(0,r+c-2),seq(l=c-1)),,2),1,
                                        # as a matrix: each row is a possible fold, and the 2
                                        # columns represent positions vertical & horizontal folds;
        function(f){
            new_m=array(0,pmax(g<-(f-1)%%d+1,h<-(d-f-1)%%d+1))
                                        # make a new matrix for each trial fold, then...
            if(f)                       # if it's a horizontal fold...
                 new_m[1:g[1],]<-m[g[1]:1,]
                                        # add the relevant rows of m, reversed,
            else new_m[,1:g[2]]<-m[,g[2]:1])
                                        # otherwise add the relevant cols of m, reversed;
            new_m[1:h[1],1:h[2]]=new_m[1:h[1],1:h[2]]+m[(i=g%%d+1)[1]:r,i[2]:c]
                                        # and now add all the unfolded elements of m
            if(max(new_m)<=t)               # now, if we didn't exceed the paper thickness threshold...
                cbind(c(T=f[1],L=f[2]),p(new_m,t))
                                        # add this fold to the list (labelled with 'T' and 'L',
                                        # and recursively call function with newly_folded paper;
        }
    )
    if(!is.null(fold_list))             # if we ended-up with a list containing any valid folds,
        fold_list[[                     # return the element containing the set of folds with...
            which.min(                  # the lowest value of...
                sapply(fold_list,function(folds){
                    for(x in seq(ncol(folds))){d=max(folds[,x],d-folds[,x])};prod(d)}))]]
                                        # the number of remaining pixels, calculated from the product
                                        # of the remaining cols & rows after applying all the folds
}

@SomoKRoceS - The output from test case 3 is: 1T 1T 4T 1T 1L 3L 5L.  I tried to use the 'validator' to verify this, but it fails at the last step (link is too long for comments).  But without the last step, it's obvious from the final result that the last step would be Ok.

@SomoKRoceS - The paper size before the last step is 3 high x 6 wide, and the validator gives it a '*** PAPER IS VALID ***' using 1T 1T 4T 1T 1L 3L 1R (which is equivalent to the output above, just doing the last fold the other way...)

That's a great answer :) About that last step.. yes, my intention (as noted in the challenge) is that a fold can't exceed the original "box" of the paper, so you can use the equivalent opposite fold. The Validator follows that as well. However It can be accepted.

Ah!  I did not understand that constraint from the way it was written, but I now see what you intended...


text:
Sums of permutations of vectors
I am looking for a more efficient way of computing the following.
Let A and B be two vectors of non-negative integers of length a and b.
Let A0 and B0 be the padded versions of A and B, so that we pad the vectors by 0, until their lengths are a+b.
We now want to compute sort(A0 + pB0) where pB0 ranges over all distinct permutations of B0, and keep track of how many times a result is obtained.
For example, A={2,1,1}, B={3,1} gives A0={2,1,1,0,0}, B0={3,1,0,0,0},
and the expected output is
{{5,2,1},2}
{{5,1,1,1},2}
{{4,3,1},2}
{{3,3,1,1},2}
{{4,2,2},2}
{{4,2,1,1},4}
{{3,2,2,1},4}
{{3,2,1,1,1},2}

For example, {5,2,1} is obtained from the two cases
{2,1,1,0,0}+{3,1,0,0,0} and {2,1,1,0,0}+{3,0,1,0,0}.
The Mathematica code I use for generating this is given as follows:
myFunction[A_, B_] := Module[{n, A0, B0},
n = Length[A] + Length[B];
A0 = PadRight[A, n];
B0 = PadRight[B, n];
Tally@Table[Sort[DeleteCases[A0 + pB0, 0], Greater],
{pB0, Permutations@B0}]
];
Timing[
Table[
myFunction[A, B]
, {A, IntegerPartitions[8]}
, {B, IntegerPartitions[8]}]
]
I am looking for a solution which does this quickly, for say all integer partitions A, B of some maximal size n. A recursive solution with memoization would be ok (and perhaps preferred if this leads to greater speed).
The motivation for this question has to do with multiplication of monomial symmetric functions.

Are you looking for speed optimization or code length optimization?

Speed optimization - i did not see the tag speed in the list of tags...

[tag:fastest-code], or [tag:fastest-algorithm]

You'll have to choose either fastest-code or fastest-algorithm. These tags are in conflict with each other.

@Arnauld ok, fastest algorithm it is then.

If you can produce examples of different difficulty and make it fastest-code you will get the highest quality answers in my experience. This is assuming you want to solve it in practice.

I'm not sure if I misunderstood the question. But... For O(n) input A = {n+1, 2n+2, 3n+3, ..., (n+1)n}, B={1, 2, 3, ..., n}; The program should generate O(n*n!) outputs. So the fastest algorithm could not be faster than O(n*n!). But an O(n*n!) algorithm could be trivial.

@ths perhaps, but I am looking for some improvements which take advantage of cases when many entries are equal, or a recursive method, where smaller cases are already assumed to be known. Say you want to compute this for all A and B where A and B ranges over all integer partitions if size less than 10.

@Per But the trivial algorithm is the (asymptotically) fastest algorithm then.

@mypronounismonicareinstate ok, then perhaps fasted code is the more appropriate tag. One should be able to make significant gains by doing a recursive approach, assuming that one has already computed the results for vectors with fewer entries...

Is this meant to be asking for programming help, or posing a challenge? I think if you don't have a sense of strong solutions to the problem, it's likely to turn out to not be a well-crafted challenge.

Why isn't {0,0,1,1,2}+{0,0,0,1,3} counted?

How are answers going to be scored?  You can't just add [tag:fastest-code] to a challenge and be done with it, you need to actually explain how scoring works.


text:
Shift Tac Toe - Code Golf Challenge
Shift Tac Toe
Shift Tac Toe is a game that combines Tic Tac Toe and Connect 4 together. In this game, you start with a 3 by 3 board, and each row is connected to a slider that you can move left and right. At the start, the sliders all start to the very right(this means that you can't move the slider to the right on the first turn). Each slider can hold a total of 5 pieces. Each turn, the player can drop an O or a X in one of the 3 columns of the Tic Tac Toe grid depending on which turn it is, or the player can move one of the sliders one spot to the left or to the right. All pieces fall to the bottom most space that is unoccupied. The pieces can also fall from one slider to another outside the 3 by 3 grid. If a piece is outside the 3 by 3 grid and doesn't fall into the bottom slider, then the piece is taken out. If it does reach the bottom slider, it will stay in play. A notable example of this is shown in the following grid:
     --- --- --- --- ---
    |   |   |   |   - O -
 --- --- --- --- --- ---
-   |   |   |   |   -
 --- --- --- --- --- ---
    |   |   |   |   -   -
     --- --- --- --- ---
In the grid above, the dashes(-) indicate the part of the sliders that are outside of the 3 by 3 grid and the vertical bars(|) indicate the 3 by 3 grid.
As you can see, this is the starting board except that the middle slider is one spot over to the left, and that there is an O at the very top right.
What happens in this scenario? There is nothing immediately underneath it, so does it go out of play?
No. This is because it still falls into the bottom slider, which means that it is still in play.

The final grid is this:
     --- --- --- --- ---
    |   |   |   |   -   -
 --- --- --- --- --- ---
-   |   |   |   |   -
 --- --- --- --- --- ---
    |   |   |   |   - O -
     --- --- --- --- ---

Pieces can also stack outside of the 3 by 3 grid. Players will alternate between O and X, with the O player going first.
Example game:
Start with 3 by 3 grid with sliders all the way to the right:

 --- --- --- --- ---
|   |   |   |   -   -
 --- --- --- --- ---
|   |   |   |   -   -
 --- --- --- --- ---
|   |   |   |   -   -
 --- --- --- --- ---

The O player places an O in the middle column of the 3 by 3 grid and it falls to the bottom:

 --- --- --- --- ---
|   |   |   |   -   -
 --- --- --- --- ---
|   |   |   |   -   -
 --- --- --- --- ---
|   | O |   |   -   -
 --- --- --- --- ---

The X player then places an X in the middle column:

 --- --- --- --- ---
|   |   |   |   -   -
 --- --- --- --- ---
|   | X |   |   -   -
 --- --- --- --- ---
|   | O |   |   -   -
 --- --- --- --- ---

The O player then pushes the middle row slider one space to the left.
Notice that after the slider moves, there is nothing under the X anymore, so it falls down.
Also note that the slider has moved one space to the right as indicated below:

     --- --- --- --- ---
    |   |   |   |   -   -
 --- --- --- --- --- ---
-   |   |   |   |   -
 --- --- --- --- --- ---
    | X | O |   |   -   -
     --- --- --- --- ---

The X player places a X in the rightmost column:

     --- --- --- --- ---
    |   |   |   |   -   -
 --- --- --- --- --- ---
-   |   |   |   |   -
 --- --- --- --- --- ---
    | X | O | X |   -   -
     --- --- --- --- ---

The O player then moves the bottom slider one spot to the left.
Notice that all the pieces shift one place to the left, and the leftmost X is now out of the playing field:

     --- --- --- --- ---
    |   |   |   |   -   -
 --- --- --- --- --- ---
-   |   |   |   |   -
 --- --- --- --- ---
- X | O | X |   |   -
 --- --- --- --- ---

The X player places a X in the leftmost column:

     --- --- --- --- ---
    |   |   |   |   -   -
 --- --- --- --- --- ---
-   | X |   |   |   -
 --- --- --- --- ---
- X | O | X |   |   -
 --- --- --- --- ---

The O player places an O in the leftmost column:

     --- --- --- --- ---
    | O |   |   |   -   -
 --- --- --- --- --- ---
-   | X |   |   |   -
 --- --- --- --- ---
- X | O | X |   |   -
 --- --- --- --- ---

The X player shifts the top slider one place to the left. Notice that the O falls one place down because there is nothing beneath it:

 --- --- --- --- ---
-   |   |   |   |   -
 --- --- --- --- ---
- O | X |   |   |   -
 --- --- --- --- ---
- X | O | X |   |   -
 --- --- --- --- ---

The O player is not very good at this game, so he shifts the middle slider one place to the right.
This shifts all the pieces in the middle row one place to the right:

 --- --- --- --- ---
-   |   |   |   |   -
 --- --- --- --- --- ---
    | O | X |   |   -   -
 --- --- --- --- --- ---
- X | O | X |   |   -
 --- --- --- --- ---

The X player wins the game by placing a X in the middle column:

 --- --- --- --- ---
-   |   | X |   |   -
 --- --- --- --- --- ---
    | O | X |   |   -   -
 --- --- --- --- --- ---
- X | O | X |   |   -
 --- --- --- --- ---

Your job is to take in a string or array of any length that only consists of 9 unique characters(you choose the characters). Three of the characters will choose which column you place the X or O(depending on whose turn it is), three of them will choose which slider to move right, and the last three will choose which slider to move left. You can assume that the input only has these 9 characters. The output should be a 3 by 3 matrix or some kind of list/string that clearly shows the final position of the grid upon following the instructions of the input. You can assume that all inputs are valid. Each character takes up a turn. Also, if any move results in a winning move(forms 3 in a row in the 3 by 3 grid like regular Tic-Tac-Toe), then ignore the rest of the input. Note that the pieces that form the winning 3 in a row all have to be in the 3 by 3 grid. The two example grids below are NOT winning positions:
Grid #1:
 --- --- --- --- ---
|   |   |   |   -   -
 --- --- --- --- ---
|   |   |   |   -   -
 --- --- --- --- ---
|   |   | O | O - O -
 --- --- --- --- ---
This is not a winning move because two of the O's are outside the playing field, despite the fact that it forms a 3 in a row.
Using the character assignment stated below, this grid pattern can be achieved with 99372467643.

Grid #2:
 --- --- --- --- ---
|   |   |   |   - O -
 --- --- --- --- ---
|   |   |   | O - X -
 --- --- --- --- ---
|   |   | O | X - X -
 --- --- --- --- ---
This is not a winning position because two of the O's are outside the playing field.
Using the character assignment below, this grid pattern can be achieved with 939318836537734654

In the examples below, 1, 2, and 3 mean drop in the leftmost, middle, and rightmost column respectively. 4, 5, and 6 mean to move the top, middle, and bottom slider to the right respectively, and 7, 8, and 9 mean to move the top, middle, and bottom slider to the left respectively.
Examples
Input will be in the form of a string
Output will be a list of lists, with each sub-list representing a row(I'm Python programmer so this list format might not be compatible with all languages).
The first, second, and third sub-list correspond to the top, middle, and bottom row of the 3 by 3 grid respectively.
The output will have 'O' for the O pieces, 'X' for the X pieces, and an empty string for empty spaces.

Input: 123332
Output:
[['','','O'],
 ['','X','X'],
 ['O','X','O']]

Input: 33387741347
Output:
[['','',''],
 ['','','O'],
 ['X','O','X']]

Input: 2283911752
Output:
[['','X',''],
 ['O','X',''],
 ['O','X','']]

Input: 228374739
Output:
[['','',''],
 ['','',''],
 ['X','X','X']]

Input: 8873334917349
Output:
[['','',''],
 ['','','O'],
 ['X','X','O']]

Input: 799333466
Output:
[['','',''],
 ['','',''],
 ['','','']]

Input: 99372467643
Output:
[['','',''],
 ['','',''],
 ['','','O']]

Input: 939318836537734654
Output:
[['','',''],
 ['','',''],
 ['','','O']]

This is code-golf, so shortest code wins!

This looks like a nice first challenge! How flexible is the output format? May we just return a 3x3 matrix in any convenient format? (I would recommend to allow that, as the main point of the challenge is obviously to simulate the game.)

@Arnauld I was hoping that the code would actually print out the 3 by 3 grid like shown in the examples but I could implement your suggestion if you think that's the best thing to do.

Let's see what others have to say about that, but we usually discourage cumbersome I/O formats unless that's the very point of the challenge, or any peripheral task that may turn the challenge into a chameleon.

@Arnauld If I really wanted to keep the 3 by 3 grid format as the output, would adding the [tag:ascii-art] tag to my question be considered bad practice?

I think that would make sense.

@Arnauld I have added the [tag:ascii-art] tag to the question.

It's not a good idea to mix a challenge that's going to require some processing to get the correct answer along with ascii-art output. Usually a challenge is just one or the other,

@Noodle9 Wait so what do I do then? Do I implement Arnauld's first suggestion?

That'd be best. Adding in the ascii-art output on top of solving the problem is too much for a challenge.

@Noodle9 Oh ok I just thought it would add an extra element to the challenge but if you think it's too much then I will fix it.

The problem you have now is that it's quite a complex challenge just to calculate the final grid and you've added error handling into the mix. Usually challenges assume only valid input unless the challenge itself is just to verify if the input is or isn't valid.

@Noodle9 So what do I do now? It's like you guys just want to take out all the hard parts out of the challenge.

@AidenChow Leave it as is if you want to, but don't be surprised if you don't get any answers. Of course, you should post questions to the Sandbox first so your learn all this before posting your challenge.

@Noodle9 I did, but I wasn't getting any replies and I got a couple of upvotes, so I thought it was good. My sandbox post

For how long, a week minimum is recommended.

@Noodle9 So should I delete this question for now and then wait for feedback in the Sandbox, or should I leave the challenge as is?

Yes, it'd be best to move it to the Sandbox and rework it there.

@Noodle9 Ok got it. I will delete.

Ok it's been a week since it was first posted on Sandbox and I basically got no replies, so I'm assuming it's now fine.

MATLAB, 727 Bytes
Try it online
b=nan(3,7);m=num2str(input(''));a=@(B)any(all(B)|all(B,2)'|all(diag(B))|all(diag(flip(B))));A=@(x,y)x(:,3:5)==y;n=@(x)isnan(x);
o=[1;1;1];
for i=1:numel(m)
t=1+mod(i,2);M=str2num(m(i));
switch M
case{1,2,3}
c=2+M;b(sum(n(b(:,c))),c)=t;case{4,5,6}
r=M-3;o(r)=o(r)+1;b(r,2:7)=b(r,1:6);b(r,1)=nan;case{7,8,9}
r=M-6;o(r)=o(r)-1;b(r,1:6)=b(r,2:7);b(r,7)=nan;end
r=o(3);
if r==1
b(:,[1,2])=nan;
elseif r==0
b(:,[1,7])=nan;
else
b(:,[6,7])=nan;
end
for j=1:7
d=n(b(:,j));e=sum(d);b(:,j)=[nan(e,1); b(~d,j)];
end
if r==1
b(:,[1,2])=nan;
elseif r==0
b(:,[1,7])=nan;
else
b(:,[6,7])=nan;
end
B=A(b,1);if a(B)
break
end
B=A(b,2);if a(B)
break
end
end
b(b==1)=79;b(b==2)=88;b(n(b))=0;disp(char(b(:,3:5)));

Explanation:
This challenge is a bit of a beast. First the user runs the program and inputs the moveset as either a single large number or a character array. For large numbers, due to numerical precision, a character array is required. I define a few often used functions that take up a lot of space so that they can be called with one character rather than a whole lot. Then I loop through each character in the input and use a switch statement to determine the move. 1-3 places the piece at the lowest available spot in the right column. 4-6 shift the row left and 7-9 shift it right. After, all invalid positions (outside the sliders) are removed automatically, as nothing could possibly stay there. Then, all columns are shifted so that things are settled as far down as they can go after 'falling'. Invalid positions are removed again in case a token fell onto another but was still outside a slider. The last thing to do is check the victory condition and break if it is found.
Overall, I had to chip my way out of a few sandtraps but I golfed as best I could. I'll take a triple bogey if no one else is fighting me for it.

Wait a minute... I just realized after all this time: Is the TIO link that you provided even correct? I just clicked on the TIO link, and the code don't seem to match what is in your post, and the inputs don't seem to match what you described either.


text:
Find your dog's age
Task
Take the (integer) number of human years that the dog has lived, \$n\$, as input and return its age in dog years, \$d\$, to two decimal places.
The number of human years, \$n\$, will be between \$1\$ and \$122\$ inclusive: \$n \in [1,122], n \in \Bbb{N}\$.
According to BBC's Science Focus Magazine, the correct function for determining your dog's age is:
$$
n = 16 \times \ln(d) + 31
$$
Where
\$n\$ is the age in human years
\$d\$ is the age in dog years
Rules
The final output in dog years must be a decimal, rounded to 2 decimal places.

Which range of human years are we supposed to support accurately?

Is 'rounded to 2 digits' a firm rule? Neither of the current answers do this.

Yes, it's a firm rule.

At 969 years, floating point imprecision becomes significant (the correct answer is 28874468684703116351749853 point something, while a simple calculation with doubles returns 28874468684703116489129984.00. Are you sure you want to set the upper limit to such a high value?

Ok, I set the max age to 122, which keeps the maximum age to 295.15. Thanks!

Does "rounded to 2 digits" mean two decimal places or two significant figures? (I don't think this adds anything to the challenge either way.)

It means two decimal places. I'll specify that.

...also I imagine trailing zeros may be implicit, right? (i.e. that 0.5 is an acceptable output when given an input of 20 [rather than 0.50])

Are we allowed to assume n is an integer?

Yes. Definitely.

Many solutions seem to have the logic backwards, giving answers d much less than n. Unless I missed something

This question misinterprets the formula. n and d are the wrong way around. From the source paper: (equivalent) human_age = 16 ln(dog_age) + 31

Orst, 9 bytes
31FᎽGć2Š

Try it online!
As bytes, this is
F3 F1 1B FF 30 1C 64 F2 42

Or, encoded as UTF-8,
óñÿ0dòB
which can be run by omitting the -u flag (filled by default on TIO). Note the not shown 0x1b and 0x1c bytes
How it works
31FᎽGć2Š - Full program. n is pushed to the stack
31       - Push 31
  F      - Subtract; n-31
   Ꮍ     - Push 16
    G    - Divide; (n-31)÷16
     ć   - Exp; exp((n-31)÷16)
      2Š - Round to 2 decimal places

Just curious: What's with the "undefined bytes?"

@Makonede Orst uses a 512 byte code byte, using a continuation byte (FF). When adding Orst to TIO, it was easier to use "undefined" than try to add in a special byte-counting script

Io, 114 bytes
While you all are enjoying rounding built-ins in your language, Io doesn't have any of those convenient rounding built-ins...
method(x,I :=((((x-31)/16)exp*100)round asString);I=if(I size<3,"0","").. I;I asMutable atInsertSeq(I size-2,"."))

Try it online!

Perl 5, 36 31 bytes
printf"%.2f",1.0644944**($_-31)

Try it online!
Command line one-liner examples:
echo 52 | perl -ne 'printf"%.2f\n",2.71828**(($_-31)/16)'
echo 52 | perl -ne 'printf"%.2f\n",1.06449445**($_-31)'
echo 52 | perl -ne 'printf"%.2f",1.06449445**($_-31)'
echo 52 | perl -ne 'printf"%.2f",1.0644944**($_-31)'

for a in {1..122};do echo "Man: $a Dog: "`echo $a|perl -ne'printf"%.2f\n",1.0644944**($_-31)'`;done

printf"%.2f\n",1.06449445**($_-31) saves two.

Do you need the \n? (You can only take one input at a time without it, but there's nothing wrong with that.)

@JonathanAllan Thanks, and I also see that for the range 0-125 then 1.06449445 can be shortened to 1.0644944 and still give the same results when rounding to 2 decimals.

Thanks to @Dingus also.

1.0644944 = 2.7182818284**(1/16) = e^(1/16) = sqrt(sqrt(sqrt(sqrt(e))))

@KjetilS. Ah, I only tried the rounded value of 1.0644945 good spot.

Why use the constant?  exp(($_-31)/16) is actually shorter: Try it online!

Shorter yet: 27 bytes

Jelly, 10 bytes
_31÷⁴Æeær2

A monadic Link accepting a float which yields a float. (As a full program a decimal input causes the result to be printed.)
Try it online!
How?
_31÷⁴Æeær2 - Link: float, n
 31        - 31
_          - subtract         -> n-31
    ⁴      - 16
   ÷       - divide           -> (n-31)/16
     Æe    - exp(x)           -> exp((n-31)/16)
         2 - 2
       ær  - round to 10^(-y) -> round(exp((n-31)/16), 2)

Integral, 14 11 Bytes
My first Integral answer!

x▼◄w‼5*↕u*‼

Try it!
An alternative: ▲w‼!◄5*↕u*‼ (11 bytes)
Explanation
x              Push 32
 ▼             x-1
  ◄            Subtraction
   w           Push 16
    ‼          Divide
     5         e ^ a
      *        100
       ↕       Multiplicaiton
        u      Round to the closest integer
         *     100
          ‼    Division

APL+WIN, 13 bytes
Prompts for input of n:
⍎2⍕*(⎕-31)÷16

Try it online! Courtesy of Dyalog Classic

Vyxal s, 23 bytes
31-16/W∆ehS\.€ḣh2wi\.$W

Try it Online!
From this answer two stupid features of Vyxal:

Why \$ln(x)^{-1}\$ needs to take a list instead of digit?
Seriously it cannot round a digit to n decimal places, so that part is handrolled.

y'know, there's nicer and more direct ways of asking for feature requests ;p

@lyxal I'll refer to the Vyxal room as soon as possible (tomorrow)

JavaScript (V8), 33 32 bytes
a=>Math.exp(-~a/16-2).toFixed(2)

Try it online!
Thanks to @my pronoun is monicareinstate for -1 byte

32 bytes with the same golf as I proposed for the C answer

C (gcc), 35 44 38 36 bytes
Saved a byte thanks to my pronoun is monicareinstate!!!
Saved 2 bytes thanks to Arnauld!!!
Added 10 bytes to fix a bug kindly pointed out by Kjetil S.
f(n){printf("%.2f",exp(-~n/16.-2));}

Try it online!

Rounding should be inside function f?

Ignoring rounding, which should be added, 34 bytes (assuming I didn't make a dumb mistake)

@KjetilS. Oops, missed that - fixed! :-)

Do you really need the \n?

@Arnauld Of course not - thanks! :D

Python 3, 52 36 35 bytes
Saved a whopping 16 17 bytes thanks to Jonathan Allan!!!
lambda n:round(1.0644944**(n-31),2)

Try it online!

@petStorm I disagree, "The final output in dog years must be a decimal, rounded to 2 digits." states nothing about necessitating trailing zeros (and that's assuming it means 2dp rather than 2sf). Furthermore, many answers will give no trailing zero, e.g. 0.5 when given 20.

lambda n:round(math.exp(-~n/16-2),2) saves 4

If we can't assume n is an integer we can't use ~; if we can assume n is an integer (in $[1,122]$) we can do lambda n:round(2.71828**((n-31)/16),2) for 38.

...actually,  lambda n:round(1.06449445**(n-31),2) would work for 36.

@JonathanAllan Oh wow, that's great - thanks! :D

1.0644944 works too!

@JonathanAllan Nice one - thanks! :-)

Rust, 38 bytes
|n|print!("{:.2}",((n-31.)/16.).exp())

Try it online

cQuents, 24 bytes
:b$)/100
:R100*x_+$/16-2

Try it online!
For some reason, rounding works on the whole line. I would do /100/R100*, but floats went all 9y on me.

R, 28 bytes
round(exp((scan()-31)/16),2)

Try it online!
There seems to be some controversy about whether trailing zeros must be printed.
If so, the following 35 byte solution works:
sprintf("%.2f",exp((scan()-31)/16))

bc, 40 bytes
scale=2
define f(n){return e((n-31)/16)}

Try it online!

Japt, 12 11 bytes
-1 byte thanks to @Shaggy
Me°U/G-2 x2

Try it
Explanation
Me°U/G-2 x2
Me            //  exp(
  °U          //      (U + 1)
    /G-2      //              / 16 - 2
              //  )
          x2  //  round to 2 decimal digits

16 can be G.

Charcoal, 20 bytes
﹪%.2fＸ¹·⁰⁶⁴⁴⁹⁴⁴⁵⁻Ｎ³¹

Try it online! Link is to verbose version of code. Numeric constant stolen from @JonathanAllan. Explanation:
                Ｎ      Input as a number
               ⁻ ³¹    Subtract literal 31
     Ｘ¹·⁰⁶⁴⁴⁹⁴⁴⁵        Raise literal 1.06449445 to that power
﹪%.2f                   Format using literal format string `%.2f`
                        Implicitly print

MathGolf, 19 bytes
T-☻/e▬♪*i♂‼/%5≥+♀∩*

If only MathGolf had a round builtin.. :/
6 bytes are used for the actual formula, 13 for rounding to 2 decimals, haha.
I/O both as a float.
Try it online.
Explanation:
T-            # Subtract 31 from the (implicit) input-float
              #  i.e. 50.0 → 19.0
  ☻/          # Divide it by 16
              #  → 1.1875
    e▬        # Push 2.718281828459045 to the power this value
              #  → 3.2788737679386735
♪*            # Multiply it by 1000
              #  → 3278.8737679386735
  i           # Convert it to an integer, truncating the decimal values
              #  → 3278
   ♂          # Push 10
    ‼         # Apply the following two commands separated to the stack:
     /        #  Integer-division
      %       #  Modulo
              #   → 327 and 8
       5≥     # Check if the modulo-10 result (the last digit) is >= 5
              # (1 if truthy; 0 if falsey)
              #   → 327 and 1
         +    # Add that to the division-by-10 result
              #   → 328
          ♀∩  # Push 1/100
            * # Multiply that to the integer
              #   → 3.28
              # (note: `♀/` cannot be used, because it would act as integer division)
              # (after which the entire stack is output implicitly as result)

Zsh, 50 bytes
zmodload zsh/mathfunc
printf %.2f $[16*log($1)+31]

Try it Online!
Gives "dog years" per the original refs and examples. For example, the "ScienceFocus" article gives 2 examples, and the "Cell Systems" paper gives 1 example, as tabulated:
     dog age | equivalent human age
actual years | approx. "dog years"
           1 | ~30
           4 | ~52
          12 | ~70
Do programmers ever read requirements?

This was my first question, and I wrote it in a bit of a hurry, so it is bad and not very well researched. Thanks for the help, and nice answer.

05AB1E, 12 bytes
>16/Ížrsm2.ò

Try it online!
>16/Ížrsm2.ò  # full program
          .ò  # round...
     žr       # 2.718281828459045...
       sm     # to the power of...
              # implicit input...
>             # plus 1...
   /          # divided by...
 16           # literal...
    Í         # minus 2...
          .ò  # to...
         2    # literal...
          .ò  # decimal places
              # implicit output

HP‑41C series, 18 B
You must place \$n\$ on top of the stack first (a. k. a. the X register).
Then you can XEQ (execute) the following program:
01♦LBL "Y"         5 Bytes    global label requires 4 + (length of string) Bytes
   NULL            1 Byte     invisible Null byte before numbers
02 31              2 Bytes    X ≔ 31;  Y ≔
03 −               1 Byte     X ≔  − 31
   NULL            1 Byte     invisible Null byte before numbers
04 16              2 Bytes    place the value 16 on top of the stack; X ≔ 16
05 ∕               1 Byte     X ≔ ( − 31) ∕ 16
06 E↑X             1 Byte      raised to the power of X
07 FIX 2           2 Bytes    show (up to) two place after the radix point
08 RND             1 Byte     round the value
09 RTN             1 Byte     `RTN` does not affect local label search

The fixed decimal point display is always rounded.
However, the display settings do not affect the internally stored numbers.
To ensure all digits after the second decimal place are zero, too, RND (round) is applied.


text:
Give Me a Ladder!
I think everyone is familiar with the game of snakes & ladders1. Imagine we have a 10x10 board like this:
=============================================================
|     |     |     |     |     |     |     |     |     |     |
| 100 | 99  | 98  | 97  | 96  | 95  | 94  | 93  | 92  | 91  |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
|     |     |     |     |     |     |     |     |     |     |
| 81  | 82  | 83  | 84  | 85  | 86  | 87  | 88  | 89  | 90  |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
|     |     |     |     |     |     |     |     |     |     |
| 80  | 79  | 78  | 77  | 76  | 75  | 74  | 73  | 72  | 71  |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
|     |     |     |     |     |     |     |     |     |     |
| 61  | 62  | 63  | 64  | 65  | 66  | 67  | 68  | 69  | 70  |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
|     |     |     |     |     |     |     |     |     |     |
| 60  | 59  | 58  | 57  | 56  | 55  | 54  | 53  | 52  | 51  |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
|     |     |     |     |     |     |     |     |     |     |
| 41  | 42  | 43  | 44  | 45  | 46  | 47  | 48  | 49  | 50  |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
|     |     |     |     |     |     |     |     |     |     |
| 40  | 39  | 38  | 37  | 36  | 35  | 34  | 33  | 32  | 31  |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
|     |     |     |     |     |     |     |     |     |     |
| 21  | 22  | 23  | 24  | 25  | 26  | 27  | 28  | 29  | 30  |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
|     |     |     |     |     |     |     |     |     |     |
| 20  | 19  | 18  | 17  | 16  | 15  | 14  | 13  | 12  | 11  |
------+-----+-----+-----+-----+-----+-----+-----+-----+------
|     |     |     |     |     |     |     |     |     |     |
| 1   | 2   | 3   | 4   | 5   | 6   | 7   | 8   | 9   | 10  |
=============================================================

The task is to (sort of) paint a ladder on this board from a smaller number to a bigger one. Kind of an ASCII art using these characters /\ | _ only.
The board's dimensions are 61x31 characters fixed like above. To illustrate the task, let's draw some ladders e.g. from 7 to 31, 22 to 77, 54 to 96, and 68 to 89 like this:
=============================================================
|     |     |     |     |     |     |     |     |     |     |
| 100 | 99  | 98  | 97  | 96  | 95  | 94  | 93  | 92  | 91  |
------+-----+-----+-----+-\_\-+-----+-----+-----+-----+------
|     |     |     |     |  \_\|     |     |     |     |     |
| 81  | 82  | 83  | 84  | 85\_\ 86  | 87  | 88  | 89  | 90  |
------+-----+-----+-----+----\_\----+-----+-----+/_/--+------
|     |     |     |     |     \_\   |     |     /_/   |     |
| 80  | 79  | 78  | 77  | 76  |\_\  | 74  | 73 /_/72  | 71  |
------+-----+-----+/_/--+-----+-\_\-+-----+---/_/-----+------
|     |     |     /_/   |     |  \_\|     |  /_/|     |     |
| 61  | 62  | 63 /_/64  | 65  | 66\_\ 67  | / / | 69  | 70  |
------+-----+---/_/-----+-----+----\_\----+-----+-----+------
|     |     |  /_/|     |     |     \_\   |     |     |     |
| 60  | 59  | /_/ | 57  | 56  | 55  |\ \  | 53  | 52  | 51  |
------+-----+/_/--+-----+-----+-----+-----+-----+-----+------
|     |     /_/   |     |     |     |     |     |     |     |
| 41  | 42 /_/43  | 44  | 45  | 46  | 47  | 48  | 49  | 50  |
------+---/_/-----+-----+-----+-----+-----+-----+-----+------
|     |  /_/|     |     |     |     |     |     |     |     |
| 40  | /_/ | 38  | 37  | 36  | 35  | 34  | 33  | 32  | 31  |
------+-|_|-+-----+-----+-----+-----+-----+-----+-----+/_/---
|     | |_| |     |     |     |     |     |     |     /_/   |
| 21  | | | | 23  | 24  | 25  | 26  | 27  | 28  | 29 /_/30  |
------+-----+-----+-----+-----+-----+-----+-----+---/_/------
|     |     |     |     |     |     |     |     |  /_/|     |
| 20  | 19  | 18  | 17  | 16  | 15  | 14  | 13  | /_/ | 11  |
------+-----+-----+-----+-----+-----+-----+-----+/_/--+------
|     |     |     |     |     |     | __________/_/   |     |
| 1   | 2   | 3   | 4   | 5   | 6   | _________/_/9   | 10  |
=============================================================

Challenge
Given the two distinct numbers that are both in the range of 1..100, draw a ladder from the smaller number to the bigger one, assuming that their arrangements and positions are fixed like above. You are not required to print the whole table. Only the ladder would suffice, but it must be placed in the right position on a 31x61 ASCII sheet.
Note that sometimes the ladder has two parts, i.e. direct (horizontal or vertical) and slant. The direct part must always come first.
Rules
Standard code-golf rules apply. If any clarifications or more rules are needed, please inform me in the comments. Happy golfing!
1. In case you have never heard of it (which would be really odd), please refer to the linked Wikipedia article. I skipped elaborating the game rules for the sake of brevity and being on topic.

May we align the digits to the right instead?

@JonathanAllan Yes that would be fine

Great challenge! Since it deserves attention, I recommend calling it something slightly more captivating. Catchiness is more important than accuracy in a title! Something like, "Paint Snakes & Ladders," maybe include "Board" at the end. I know the challenge is not quite that; it's more subtle. But that's why you have the body! Minimally, I'd at least recommend getting rid of the parenthetical "(not an actual one)" you have now :)

@AviFS Thanks, duly noted. At first there was no parenthetical, but the system complained that the title is too short. Hope this one is more catchy!

@polfosolఠ_ఠ 'Course! I do think the Snakes & Ladders in the title would appeal even more as PPCG'ers seem to love board games & games in general, not to mention everyone's a sucker for nostalgia! And "Build Me a Ladder" is more something than "Give Me," but I don't know the word for that...

Charcoal, 130 bytes
ＦχＦχ⊞υ×⁶⎇﹪ι²⁻⁹κκ≔⁻ＬυＮθ≔⁻ＬυＮη≔⊕§υηζ≔×³÷ηχηＪ§υθ×³÷θχ Ｆ›ζⅈ«≦⊕ζ »Ｆ⁻ζ⁺ⅈ⁻ⅉηＧ←←↑→↘→²_Ｆ⁻ⅈ⁺ζ⁻ⅉηＧ↑←↙→²_Ｗ›ⅉη«≔⎇›⁻ⅉη↔⁻ζⅈ²∨›ζⅈ³ιＰ✳ι¹←←✳ι¹→¿›ⅉη_

Try it online! Link is to verbose version of full 198-byte program that includes drawing the entire background. Explanation:
ＦχＦχ⊞υ×⁶⎇﹪ι²⁻⁹κκ

Get the X-coordinates of all 100 squares (since each row reverses direction).
≔⁻ＬυＮθ≔⁻ＬυＮη

Input the starting and ending square, but subtract from 100.
≔⊕§υηζ≔×³÷ηχη

Calculate the destination character.
Ｊ§υθ×³÷θχ

Jump to the start character.
 Ｆ›ζⅈ«≦⊕ζ »

Erase the start character, and if this is a right-leaning ladder, then erase the next character too (this is because right-leaning ladders start 1 character further right than left-leaning ladders for some reason).
Ｆ⁻ζ⁺ⅈ⁻ⅉηＧ←←↑→↘→²_

Draw the horizontal part of a right-leaning ladder, if applicable. This is complicated slightly because the horizontal part does not start 1 character further right.
Ｆ⁻ⅈ⁺ζ⁻ⅉηＧ↑←↙→²_

Draw the horizontal part of a left-leaning ladder, if applicable.
Ｗ›ⅉη«

Repeat until the top of the ladder is reached.
≔⎇›⁻ⅉη↔⁻ζⅈ²∨›ζⅈ³ι

Work out which direction we're going in (3 = up left, 2 = up, 1 (default) = up right).
Ｐ✳ι¹←←✳ι¹→

Draw the next section of ladder.
¿›ⅉη_

Draw the next rung, unless we've got to the top of the ladder.

Python 2, 316 bytes
def f(m):
 r=[list(' '*61)for y in range(31)]
 (y,x),(b,a)=[[(109-p)/10*3,1+min(p%20,19-p%20)*6]for p in[max(m)-1,min(m)-1]]
 while y<b:c=cmp(a,x);r[y][x:x+4]=r"  /|\___/|\ "[c%3::3];x+=c;y+=1
 if x==a:r[y-1][x+2-(r[y-1][x]>' ')]=" "
 while x-a:c=cmp(a,x)+1;r[y-2][x+c:x+2+c]="__";r[y-1][x+c*3/2]="_";x+=c-1
 print r

Try it online! (footer paints over grid for pretty output)
Function that inputs a list of two numbers and outputs a list of lists of characters.
How it works
We find character coordinates of the higher point (e.g. 96), then translate it along diagonal, vertical, or horizontal movements to the coordinates of the lower point (e.g. 54), modifying the character matrix r as we go.
def f(m):
    r = [list('.'*61) for y in range(31)]
    m = [max(m)-1,min(m)-1]
    # (x,y) is the higher point
    # (a,b) is the lower point
    # x increases right; y increases down
    (y,x),(b,a) = [[(109-p)/10*3,1+min(p%20,19-p%20)*6] for p in m]
    # move (x,y) to (a,b) via 1-unit translations
    # \ diagonal
    while x < a and y < b:
        r[y][x+1:x+4] = "\\_\\"
        x += 1
        y += 1
    # / diagonal
    while x > a and y < b:
        r[y][x:x+3] = "/_/"
        x -= 1
        y += 1
    # straight down
    while x == a and y < b:
        r[y][x+1:x+4] = "|_|"
        y += 1
    # remove space at the bottom of the ladder
    # (r[y-1][x]!='.' deals with off-by-one error in the case of
    # \ diagonals with no straight segment)
    if x == a:
        r[y-1][x+2-(r[y-1][x]!='.')] = " "
    # left
    while x > a:
        r[y-2][x+1] = "_"
        r[y-2][x] = "_"
        r[y-1][x] = "_"
        x -= 1
    # right
    while x < a:
        r[y-2][x+2] = "_"
        r[y-2][x+3] = "_"
        r[y-1][x+3] = "_"
        x += 1
    return r


text:
Antisymmetry of a Matrix
A matrix is antisymmetric, or skew-symmetric, if its transpose equals its negative.
The transpose of a matrix can be obtained by reflecting its elements across the main diagonal. Examples of transpositions can be seen here:
\$\begin{pmatrix}11&12&13\\21&22&23\end{pmatrix}\rightarrow\begin{pmatrix}11&21\\12&22\\13&23\end{pmatrix}\$
\$\begin{pmatrix}11&12&13\\21&22&23\\31&32&33\end{pmatrix}\rightarrow\begin{pmatrix}11&21&31\\12&22&32\\13&23&33\end{pmatrix}\$
This matrix is antisymmetric because it equals its transpose when multiplied by -1:
\$\begin{pmatrix}0&2&-1\\-2&0&0\\1&0&0\end{pmatrix}\$
All antisymmetric matrices exhibit certain characteristics:

Antisymmetry can only be found on square matrices, because otherwise the matrix and its transpose would be of different dimensions.

Elements which lie on the main diagonal must equal zero because they do not move and consequently must be their own negatives, and zero is the only number which satisfies \$x=-x\$.

The sum of two antisymmetric matrices is also antisymmetric.

The Challenge
Given a square, non-empty matrix which contains only integers, check whether it is antisymmetric or not.
Rules

This is code-golf so the shortest program in bytes wins.

Input and output can assume whatever forms are most convenient as long as they are self-consistent (including output which is not truthy or falsy, or is truthy for non-antisymmetry and falsy for antisymmetry, etc).

Assume only valid input will be given.

Test Cases
In:
1 1 1
1 1 1
1 1 1

Out: False

In:
 0 0 1
 0 0 0
-1 0 0

Out: True

In:
0 -2
2  0

Out: True

Speaking of skew-symmetry... That's totally different though since that one is in the CA sense.

What type of outputs can be used? Any two consistent values? Any truthy and falsy values? Can we choose falsy for antisymmetric and truthy for symmetric?

Will the input ever contain complex numbers? Only contain real numbers? Only integers?

@LuisMendo I do believe your first comment is addressed by rule 2, but examples were added anyway. Additionally, only integers will be present (also added). For the record I do want to delete this question but I can't.

@golf69 Thanks. Don't delete it, it already has answers, and I think it's a good challenge, now that these details are clearer

You could create a new similar question disallowing builtins perhaps(but not this specific task)?

@user That's Do X Without Y, obviously, and is thus deprecated.

I really don't see how built-in answers are "not interesting". To me they are perfectly valid and beautiful answers.

@HighlyRadioactive That's not the problem; it's more that I thought the challenge would be more difficult than it actually is. Built-ins are good and important and the fact that the challenge relies on my lack of knowledge of such built-ins indicates to me that the challenge is not that good in the first place.

APL (Dyalog Unicode), 3 bytes
-≡⍉

Try it online!
This is exactly an APLcart entry on "antisymmetric". Basically it checks if the input's negative - matches ≡ the input's transpose ⍉.

Python 2, 45 bytes
lambda A:A==[[-x for x in R]for R in zip(*A)]

Try it online!

44 bytes

R, 23 bytes
function(m)!any(m+t(m))

Try it online!
Checks whether there are any non-zero elements in \$M+M^T\$.

Brachylog, 5 bytes
5 bytes seems to be the right length for this (unless you're Jelly). Actually, this would be three bytes if Brachylog implicitly vectorized predicates like negation.
\ṅᵐ²?

Try it online!
Explanation
\      Transpose
 ṅᵐ²   Map negation at depth 2
    ?  Assert that the result is the same as the input

How do you program in this language without using something like windows character map or a special keyboard with 5000 keys?

@DanielW. Good question! I have two methods: copying and pasting from the codepage chart, and using a bookmarklet of Adám's language bar (also available for several other languages).

C (gcc), 67 64 bytes
-3 thanks to AZTECCO
i,j;f(m,s)int**m;{for(i=j=0;i=i?:s--;)j|=m[s][--i]+m[i][s];m=j;}

Try it online!
Returns 0 if the matrix is antisymmetric, and a nonzero value otherewise.

Octave, 19 bytes
@(a)isequal(a',-a);

Try it online!
The semicolon doesn't need to be there, but it outputs the function otherwise, so I'll take the one-byte hit to my score for now.
Explanation
It's pretty straightforward - it checks to see if the matrix of the transpose is equal to the negative matrix

Io, 67 bytes
method(~,~map(i,\,\map(I,V,V+x at(I)at(i)))flatten unique==list(0))

Try it online!
Explanation
For all a[x][y], it checks whether all a[x][y]+a[y][x]==0.
method(~,                                 // Input x.
    ~ map(i,\,                            // Map all x's rows (index i):
        \ map(I,V,                        //     Foreach the rows (index I):
            V+x at(I)at(i)                //         x[i][I] + x[I][i]
        )
    ) flatten                             // Flatten the resulting list
    unique                                // Uniquify the list
    ==list(0)                             // Does this resulting list *only* contain the item 0?
)

Hi "new contributor" +1~~~

JavaScript (ES6), 42 bytes
Returns false for antisymmetric or true for non-antisymmetric.
m=>m.some((r,y)=>r.some((v,x)=>m[x][y]+v))

Try it online!

Pyth, 5 bytes
qC_MM

Try it online!
Explanation
qC_MM
q      : Check if input equals
 C     : Transpose of
  _MM  : Negated input

Japt, 5 bytes
eUy®n

Try it
e       compare input with :
 Uy       columns of input
   ®n     with each element negated

Previous version ÕeËËn didn't work, corrected using the ® symbol

MATL, 5 bytes
!_GX=

Try it online!
Explanation
!_GX=
        // Implicit input on top of stack
!       // Replace top stack element with its transpose
 _      // Replace top stack element with its negative
  G     // Push input onto stack
   X=   // Check for equality

Charcoal, 10 bytes
⁼θＥθＥθ±§λκ

Try it online! Link is to verbose version of code. Outputs a Charcoal boolean, i.e. - if the matrix is antisymmetric, nothing if not. Explanation:
  Ｅθ        Map over input matrix rows (should be columns, but it's square)
    Ｅθ      Map over input matrix rows
       §λκ  Cell of transpose
      ±     Negated
⁼θ          Does matrix equal its negated transpose?

Wolfram Mathematica, 20, 7 bytes
There is a built-in function for this task:
AntisymmetricMatrixQ
But one can simply write a script with less byte counts:
#==-#ᵀ&
The ᵀ character, as it is displayed in notebooks, stands for transpose. But if you copy this into tio, it won't be recognized because these characters are only supported by Mathematica notebooks.

I don't think the transpose sign (Unicode: F3C7) should count as one byte?

@M.Stern Maybe I am wrong, but I look at it the same way as ⍉ in the highest voted answer counts as one byte.

@polfosolఠ_ఠ APL has a custom code page. The character for Transpose is , which is 3 bytes. Try it online!

Julia 1.0, 9 bytes
A->A==-A'

A straightforward anonymous function checking the equality.
Try it online!

Haskell, 49 47 bytes
import Data.List
f x=x==transpose(map(0-)<$>x)

Try it online!

saved 2 thanks to @Unrelated String

My first Haskell.
Function tacking a matrix and checking if input is equal to input mapped to (0-value) and transposed

-2 with <$>

Ruby 2.7, 40 bytes
->a{a==a.transpose.map{|r|r.map{|c|-c}}}

Try it online!

I learned a bit of Ruby golfing and fixed it.

Probably this is what you're referring to, but Tips for golfing in Ruby is a good resource if you haven't seen it.

Not saying much but using _1 for either of the map blocks saves two bytes.

it's on tio which used 2.7 or something. guess i'll just add the version number

Scala, 32 bytes
l=>l.transpose==l.map(_.map(-_))

Finally, something that Scala has a builtin for!
The function's pretty straightforward - it compares the transpose of a List[List[Int]](doesn't have to be a List, could be any Iterable) to the negative, found by mapping each list inside l and using - to make it negative.
Try it in Scastie

Google Sheets, 90 88 41
(Now with lambdas)
Closing parens discounted.
Named Functions (name, args, and formula text all count):

Name
args
Formula

P
a, b
a+b

Q
a
MAP(a,TRANSPOSE(a),P)

Formula:
=SUM(Q(A1:C3))

No, I cannot currently use ADD instead of P as it is not a lambda.
How it Works:
Add the matrix to its transpose. If the resulting matrix is all 0's, then the sum of all elements is 0, which means we the two are equal.
Return 0 if equal, some positive number otherwise.

Husk, 5 bytes
§=T†_

Try it online!

Haskell, 40 bytes
(==)<*>foldr(zipWith(:).map(0-))z
z=[]:z

Try it online!
Uses this tip for shorter transpose and the idiom of (==)<*> to check invariance under an operation.

Pip, 5 bytes
Z_=-_

A function submission; pass a nested list as its argument. Try it online!
Explanation
Z_     The argument, zipped together
  =    Equals
   -_  The argument, negated

gorbitsa-ROM, 8 bytes
r1 R A1 B0 T

This is an awful abuse of rule

Input and output can assume whatever forms are most convenient.

If input takes form of "arr[i][j] arr[j][i]", the problem becomes "is sum = 0?".
This code takes pairs of values and outputs their sum if it's not 0
Thus if you provide matrix as previously mentioned pairs, code will return some value for not-anti-symmetric ones and will not return anything for anti-symmetric ones.
r1 R A1 B0 T
r1           #store first number
   R         #read second number
     A1      #add first number
        B0   #if sum==0, jump to the beginning
           T #else output the sum

Java (JDK), 89 87 86 bytes

-2 bytes thanks to Calculuswhiz!

m->{int i=0,j,r=1;for(;++i<m.length;)for(j=0;++j<i;)r=m[i][j]!=-m[j][i]?0:r;return r;}

Try it online!
Returns 0 for false and 1 for true.

How about int i=0,j then j=0 in the inner loop?

@Calculuswhiz Thanks! I almost never use commas for assignments and totally forgot about them

Oh, I found something better at 76: m->{int l=m.length,i=l*l;while(--i>=0&&m[i%l][i/l]==-m[i/l][i%l]);return i;}. This returns -1 only if antisymmetric, something bigger otherwise. Your original code might also have needed to start at -1's instead of 0's.

@Calculuswhiz That's really cool, you should post your own answer!

Jelly, 3 bytes
N⁼Z

Try it online!
Posting before caird coinheringaahing finds this question.

05AB1E, 3 bytes
ø(Q

Try it online or verify all test cases.
Explanation:
ø    # Zip/transpose the (implicit) input-matrix; swapping rows/columns
 (   # Negate each value in this transposed matrix
  Q  # And check if it's equal to the (implicit) input-matrix
     # (after which the result is output implicitly)

Factor + math.matrices, 19 bytes
[ dup flip mneg = ]

Try it online!

dup make a copy of the input
flip transpose it
mneg negate it
= are they equal?

Raku, 26 bytes
{none flat $_ »+«[Z] $_}

Try it online!

$_ is the input matrix, in the form of a list of lists of integers.
[Z] $_ is the transpose of the input matrix.
»+« adds the input matrix to its transpose.
flat flattens the matrix into a single list of numbers.
none converts that list of numbers into a junction which is true if and only if none of the numbers is truthy, that is, nonzero.

The none-junction is returned.  It is truthy only if adding the matrix to its transpose results in a matrix containing all zeroes.

J-uby, 28 bytes
Port of Razetime's Ruby answer.
:=~&(:transpose|:*&(:*&:-@))

Attempt This Online!
Explanation
:=~ & (:transpose | :* & (:* & :-@))

       :transpose |                   # Transpose input, then
                    :* & (        )   # Map with
                          :* & :-@    #   Map with negate
:=~ & (                            )  # Equal to input

k, 7 bytes
Similar to the APL solution. Compare (x~) original matrix against negated transpose (-+x}
{x~-+x}

Nekomata + -e, 3 bytes
Ť_=

Attempt This Online!
Ť     Transpose
 _    Negate
  =   Check equality

J, 5 bytes
--:|:

Attempt This Online!
--:|:
-      NB. negate
   |:  NB. transpose
 -:    NB. match?