text:
Counts Of Orderings Containing At Most K Of The Kth Class
This challenge is about the number of orderings which contain at most \$n\$ classes and at most \$k\$ of the \$k^{\text{th}}\$ class.
One way to represent such an ordering is as a sequence of positive integers with these three restrictions:

A number may only appear after all lower numbers have appeared
All numbers which appear must be less than or equal to \$n\$
Any number may only appear up to as many times as its own value

As such the number of such sequences is itself a sequence, \$a(n)\$ where:
\$a(0) = 1\$, since only the empty sequence, [], works;
\$a(1) = 2\$, since [1] now also works;
\$a(2) = 4\$, since both [1, 2] and [1, 2, 2] also work*;
\$a(3) = 16\$:
[], [1], [1, 2], [1, 2, 2], [1, 2, 3], [1, 2, 2, 3], [1, 2, 3, 2], [1, 2, 3, 3], [1, 2, 2, 3, 3], [1, 2, 3, 2, 3], [1, 2, 3, 3, 2], [1, 2, 3, 3, 3], [1, 2, 2, 3, 3, 3], [1, 2, 3, 2, 3, 3], [1, 2, 3, 3, 2, 3], [1, 2, 3, 3, 3, 2]

\$a(4) = 409\$:
[], [1], [1, 2], [1, 2, 2], [1, 2, 3], [1, 2, 2, 3], [1, 2, 3, 2], [1, 2, 3, 3], [1, 2, 3, 4], [1, 2, 2, 3, 3], [1, 2, 2, 3, 4], [1, 2, 3, 2, 3], [1, 2, 3, 2, 4], [1, 2, 3, 3, 2], [1, 2, 3, 3, 3], [1, 2, 3, 3, 4], [1, 2, 3, 4, 2], [1, 2, 3, 4, 3], [1, 2, 3, 4, 4], [1, 2, 2, 3, 3, 3], [1, 2, 2, 3, 3, 4], [1, 2, 2, 3, 4, 3], [1, 2, 2, 3, 4, 4], [1, 2, 3, 2, 3, 3], [1, 2, 3, 2, 3, 4], [1, 2, 3, 2, 4, 3], [1, 2, 3, 2, 4, 4], [1, 2, 3, 3, 2, 3], [1, 2, 3, 3, 2, 4], [1, 2, 3, 3, 3, 2], [1, 2, 3, 3, 3, 4], [1, 2, 3, 3, 4, 2], [1, 2, 3, 3, 4, 3], [1, 2, 3, 3, 4, 4], [1, 2, 3, 4, 2, 3], [1, 2, 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3, 4, 4, 3, 2, 4, 4, 3], [1, 2, 3, 4, 4, 3, 3, 2, 4, 4], [1, 2, 3, 4, 4, 3, 3, 4, 2, 4], [1, 2, 3, 4, 4, 3, 3, 4, 4, 2], [1, 2, 3, 4, 4, 3, 4, 2, 3, 4], [1, 2, 3, 4, 4, 3, 4, 2, 4, 3], [1, 2, 3, 4, 4, 3, 4, 3, 2, 4], [1, 2, 3, 4, 4, 3, 4, 3, 4, 2], [1, 2, 3, 4, 4, 3, 4, 4, 2, 3], [1, 2, 3, 4, 4, 3, 4, 4, 3, 2], [1, 2, 3, 4, 4, 4, 2, 3, 3, 4], [1, 2, 3, 4, 4, 4, 2, 3, 4, 3], [1, 2, 3, 4, 4, 4, 2, 4, 3, 3], [1, 2, 3, 4, 4, 4, 3, 2, 3, 4], [1, 2, 3, 4, 4, 4, 3, 2, 4, 3], [1, 2, 3, 4, 4, 4, 3, 3, 2, 4], [1, 2, 3, 4, 4, 4, 3, 3, 4, 2], [1, 2, 3, 4, 4, 4, 3, 4, 2, 3], [1, 2, 3, 4, 4, 4, 3, 4, 3, 2], [1, 2, 3, 4, 4, 4, 4, 2, 3, 3], [1, 2, 3, 4, 4, 4, 4, 3, 2, 3], [1, 2, 3, 4, 4, 4, 4, 3, 3, 2]

\$a(5) = 128458\$;
\$a(6) = 612887198\$;
...and so on.
* Note, for example, that [2, 1, 2] violates (1) while [1, 1, 2] violates (3).
(Other interpretations of the underlying objects being counted no doubt exist too, feel free to comment regarding these, or, even better, explain them as part of an answer.)
The Challenge
Write a program or function which does any of the following:

Takes a non-negative integer, \$n\$ and outputs either:

\$a(n)\$
\$[a(0),\cdots ,a(n)]\$

Takes a positive integer, \$n\$ and outputs either:

\$a(n-1)\$
\$[a(0),\cdots ,a(n-1)]\$

Takes no input and outputs the sequence \$a\$ forever

This is code-golf so try to achieve the shortest solution in your chosen language.
Also insightful answers that are not necessarily the shortest, so long as they are still well golfed, will probably be received well!

This sequence is not currently in the OEIS, and as far as I can tell neither is any trivially related sequence (e.g. [1,1,2,11,393,12442,...]) - if you spot any do comment.

Somewhat related sequences: A105748 and A192012

I find it unacceptable that you did not provide all the examples for a(5).

@NickKennedy it's meant to represent the first $n$ elements, so 0 gives [], while 3 gives [1,2,4]... is there better notation I could employ? Thanks!

I guess (it allows 0 to give [], but so does the second) - I can just remove it, thanks!

This is a fun, novel question! Good job, thanks for posting it.

Wonder if (6)=612887198 and further can be found mathematically instead of the brute forcey ways of the answers here.

@KjetilS. I should think so.

Can we make the assumption that the input is $<10$ given how quickly the results grow, or should it (given enough time/resources) work for any input (in theory)? I think I already know the answer, but asking just in case I could save a byte. ;)

@KevinCruijssen It should work in theory for unbounded $n$ or output $a$ for ever in theory - allowing for memory/precision/overflow issues in real world implementations.

JavaScript (ES6),  91 ... 76  74 bytes
A recursive approach. This is very fast up to \$n=5\$. Computing \$a(6)\$ takes approximately 2 minutes on my laptop.
n=>(g=a=>1+(h=i=>i&&h(i-1)+(a[i]^i&&a[i-1]?g(b=[...a,0],b[i]++):0))(n))`1`

Try it online!
How?
Instead of explicitly building the sequences, we just keep track of how many times each value appears. This gives us enough information to decide which values are allowed to be added at any given time, assuming they're always added at the end of the sequence.
Commented
n => (                     // n = input
  g = a =>                 // g is a recursive function taking an array a[] holding
                           // how many times each value appears in the sequence
  1 + (                    // increment the final result
    h = i =>               // h is a recursive function taking i = next value to try
      i &&                 //   stop if i = 0
      h(i - 1) + (         //   otherwise, do a recursive call to h with i - 1
        a[i] ^ i &&        //   if i does not appear i times (rule #3)
        a[i - 1] ?         //   and i - 1 appears at least once (rule #1):
          g(               //     add the result of a recursive call to g:
            b = [...a, 0], //       define b[] as a copy of a[] with an extra '0'
                           //       so that b[i] is guaranteed to be defined
                           //       (at this point, we know that a[0] to a[i-1] exist)
            b[i]++         //       increment b[i]
          )                //     end of recursive call to g
        :                  //   else:
          0                //     add nothing
      )                    //
  )(n)                     // initial call to h with the maximum value i = n (rule #2)
)`1`                       // initial call to g with a[0] = '1', which is required to
                           // to allow i = 1 to be added as per rule #1

Pyth, 13 bytes
lfUI{T{.ysmRh

Try it online!
Let's go through this step by step, starting at the end:

mRh: This autoexpands to mRhdQ. This means "Map the function m with right input hd over the input Q."

Q is an integer (e.g. 3) so it gets automatically cast to a range (e.g. [0, 1, 2]).
The m function is the map function.
d is defined to be the input to the map function.
h is the + 1 function (head).
m with two numeric inputs just replicates the left input a number of times equal to the right input.
As a result, mRh outputs a list like this: [[0], [1, 1], [2, 2, 2]].

s: Flatten (sum). Now we have a list like [0, 1, 1, 2, 2, 2].
.y: All permuted subsets.
{: Uniquify (remove duplicates). Now we have a list like [[], [0], [1], [2], [0, 1], ... ]
fUI{T: Filter that list on the function UI{T.

T is the input to the filter.
{: Uniquify the list to be filtered. Uniquify orders the unique elements in the order they first appear.
UI: Invariant under the function U:

U: Cast to range. So the unique elements must be [], or [0], or [0, 1], etc. to pass this test.

l: Length. The result is implicitly printed.

To see the orderings, just remove the l.

Jelly, 18 bytes
x`€FŒ!QJƑ$Ƈ¹Ƥ€ẎQL‘

Try it online!
An initial attempt at a Jelly answer. A monadic link taking an integer and returning an integer. Too slow for n>3 on TIO.
Explanation
x`€                | Repeat each of 1..n itself times
   F               | Flatten
    Œ!             | Permutations
         $Ƈ        | Keep those where the following is true:
      Q            | - Uniquify
       JƑ          | - Check whether invariant when a sequence along the list is generated
           ¹Ƥ€     | Prefixes of each
              Ẏ    | Join outer lists
               Q   | Uniquify
                L  | Length
                 ‘ | Add one (to account for the empty list)

Longer but handles \$n=5\$ in under 25 seconds on TIO
Jelly, 24 bytes
ċⱮṀ$;0ḣ³<J$T;€)Ẏ
“”WÇƬẈS

Try it online!
Thanks to @JonathanAllan for improving the final bit of the faster version!

R, 113 106 98 bytes
g=function(n,N=1:n,B=N*0){for(e in N[c(1,B)[-n-1]>0&(F=all(B<=N))])F=F+g(n,,'[<-'(B,e,B[e]+1));+F}

Try it online!

-9 bytes thanks to @RobinRyder
-2 bytes using @Arnauld idea of storing occurrences table only (I just noticed that basically I was using the same approach, but creating the actual list too)

I don't understand your code yet, but double() can be 1[0] for -4 bytes. It seems that setting x=0 also works, for -7 bytes instead.

@RobinRyder I'm really rusty... thanks! :D

Welcome back! 102 bytes

Ruby, 100 bytes
Relatively simple answer similar to the Jelly solution, but it's able to calculate for n=4 without timing out on TIO (albeit taking 30 seconds to do so), which Jelly can't at time of writing.
->n{r=(1..n).flat_map{|j|[j]*j};i=0;r.sum{r.permutation(i+=1).uniq.count{|a|a.uniq==[*1..a.max]}}+1}

Try it online!

Raku, 94 bytes
{1+set map ~*,grep {all .unique Z==^$_},.permutations>>[[\,] ^$_][*;*]}o{(^$_ Zxx 1..$_)[*;*]}

Try it online!
Times out for \$n>3\$, mostly since it is running the same filter for all prefixes of all permutations of the largest list (i.e. [1,2,2,3,3,3,...n]). This results in a lot of duplicates that have to filtered out later.

05AB1E, 19 18 17 bytes
ÝDÅΓœ€Œ€`ÙʒÙāQ}g>

Pretty slow (\$n=3\$ in about 5.5 0.5 seconds on TIO), but it works.
Inspired by @isaacg's Pyth answer.
I have the feeling this can definitely be golfed by at least a few bytes, though.
-1 byte thanks to @ExpiredData.
-1 byte and sped up by changing the order of some operations thanks to @Grimmy.
Try it online or verify a few more test cases.
Explanation:
Ý                  # Push a list in the range [0, (implicit) input]
                   # (NOTE: `L` cannot be used here, because input=0 would become [1,0])
 D                 # Duplicate this list
  ÅΓ               # Run-length encode the lists, to have each value repeat itself that
                   # many times (i.e. [1,2,3,4] → [1,2,2,3,3,3,4,4,4,4])
    œ              # Take all permutations of this list
     ʒ             # Filter this list of lists by:
      Ù            #  Uniquify it
       ā           #  Push a list in the range [1, length] (without popping the list itself)
        Q          #  Check if both lists are equal
         }€η       # After the filter: take the prefixes of each remaining permutation
            €`     # Flatten one level
              Ù    # Uniquify the list of lists
               g   # After the filter: get the amount of remaining lists by taking the length
                >  # + 1 for the missing `[]`
                   # (after which this is output implicitly)

Minor (but even slower) alternative: $ÝDÅΓœ€Œ€`ÙvyÙāQO: Try it online or verify a few more test cases.
$                  # Push 1 and the input
 ÝDÅΓœ             # Same as above
      €Œ           # Get all sublists of each permutation
        €`Ù        # Same as above
           v       # Loop over each inner list `y`
            y      #  Push list `y`
             ÙāQ   #  Same as above
                O  #  Take the sum of the stack
                   # (after the loop, the result is output implicitly)

Why do you need to sort the list of suffixes? Since permutations for any ordering of the same list should be the same shouldn't they?

@ExpiredData Oops, you're completely right, thanks. The sort was still there from a previous attempt of generating all permutations of all lengths, for which 05AB1E unfortunately doesn't have any builtins a.f.a.i.k., unlike Pyth.

Ý¦.s˜ => ÝD×S for -1. €Œ before filtering => €η after filtering for a massive speedup at no cost in bytes. TIO with both changes.

@Grimmy ÝD×S would fail for inputs $>9$, though. I've asked OP whether we can assume the input is $<10$, although I have the feeling I know the answer already. I will edit to add the sped up though, thanks!

Oh whoops. You can use ÝDÅΓ then.

@Grimmy That works, thanks!

Perl 5, 150 bytes
sub f{my$n=pop;$n?do{my%e;@f=f($n-1);push@f,map{$f=$_;grep!$e{$_}++,map$f=~s/.{$_}/$&$n/r,$n==1?0:index($f,$n-1)+1||9e9..length$f}@f for 1..$n;@f}:''}

Try it online!
Produces the correct output in about two seconds for up to n=5.
Out of memory for n=6. And would not work anyway for n>9 (two digit numbers).
Thought about using a permutation solution like @Value Ink's Ruby answer, but could'nt find a core perl function or module that generated perm's and including a permutation function would probably add just way too many bytes.
With indentation, comments and test run:
sub f {
    my $n = pop;
    $n == 0 ? ('')
  : $n == 1 ? ('',1)
  : do {
      my %e;                                   #keep track of existing elements (strings)
      @f = f($n-1);                            #start with f(n-1) array
      push @f, map{                            #expand f array n times
        $f = $_;                               #f = current @f element
        grep !$e{$_}++,                        #don't add if already exists
          map $f =~ s/.{$_}/$&$n/r,            #insert n char at current position
            index($f,$n-1)+1||9e9 .. length$f  #loop positions from first occurence of n-1 to end
      } @f
        for 1..$n;
      @f                                       #return expanded @f array (string sequences)
    }
}

# test:
for my $n (0..5){
  my @f = f($n);
  my $list = $n<5 ? '['.join(',',map"'$_'",@f).']' : '';
  print "$n: ".@f." $list\n";
}

Output:
0: 1 ['']
1: 2 ['','1']
2: 4 ['','1','12','122']
3: 16 ['','1','12','122','123','1232','1223','1233','12332','12323','12233','12333','123332','123323','123233','122333']
4: 409 ['','1','12','122','123','1232','1223','1233','12332','12323','12233','12333','123332','123323','123233','122333','1234','12342','12324','12234','12343','12334','123432','123342','123324','123423','123243','123234','122343','122334','123433','123343','123334','1234332','1233432','1233342','1233324','1234323','1233423','1233243','1233234','1234233','1232433','1232343','1232334','1223433','1223343','1223334','12344','123442','123424','123244','122344','123443','123434','123344','1234432','1234342','1234324','1233442','1233424','1233244','1234423','1234243','1234234','1232443','1232434','1232344','1223443','1223434','1223344','1234433','1234343','1234334','1233443','1233434','1233344','12344332','12343432','12343342','12343324','12334432','12334342','12334324','12333442','12333424','12333244','12344323','12343423','12343243','12343234','12334423','12334243','12334234','12332443','12332434','12332344','12344233','12342433','12342343','12342334','12324433','12324343','12324334','12323443','12323434','12323344','12234433','12234343','12234334','12233443','12233434','12233344','123444','1234442','1234424','1234244','1232444','1223444','1234443','1234434','1234344','1233444','12344432','12344342','12344324','12343442','12343424','12343244','12334442','12334424','12334244','12332444','12344423','12344243','12344234','12342443','12342434','12342344','12324443','12324434','12324344','12323444','12234443','12234434','12234344','12233444','12344433','12344343','12344334','12343443','12343434','12343344','12334443','12334434','12334344','12333444','123444332','123443432','123443342','123443324','123434432','123434342','123434324','123433442','123433424','123433244','123344432','123344342','123344324','123343442','123343424','123343244','123334442','123334424','123334244','123332444','123444323','123443423','123443243','123443234','123434423','123434243','123434234','123432443','123432434','123432344','123344423','123344243','123344234','123342443','123342434','123342344','123324443','123324434','123324344','123323444','123444233','123442433','123442343','123442334','123424433','123424343','123424334','123423443','123423434','123423344','123244433','123244343','123244334','123243443','123243434','123243344','123234443','123234434','123234344','123233444','122344433','122344343','122344334','122343443','122343434','122343344','122334443','122334434','122334344','122333444','1234444','12344442','12344424','12344244','12342444','12324444','12234444','12344443','12344434','12344344','12343444','12334444','123444432','123444342','123444324','123443442','123443424','123443244','123434442','123434424','123434244','123432444','123344442','123344424','123344244','123342444','123324444','123444423','123444243','123444234','123442443','123442434','123442344','123424443','123424434','123424344','123423444','123244443','123244434','123244344','123243444','123234444','122344443','122344434','122344344','122343444','122334444','123444433','123444343','123444334','123443443','123443434','123443344','123434443','123434434','123434344','123433444','123344443','123344434','123344344','123343444','123334444','1234444332','1234443432','1234443342','1234443324','1234434432','1234434342','1234434324','1234433442','1234433424','1234433244','1234344432','1234344342','1234344324','1234343442','1234343424','1234343244','1234334442','1234334424','1234334244','1234332444','1233444432','1233444342','1233444324','1233443442','1233443424','1233443244','1233434442','1233434424','1233434244','1233432444','1233344442','1233344424','1233344244','1233342444','1233324444','1234444323','1234443423','1234443243','1234443234','1234434423','1234434243','1234434234','1234432443','1234432434','1234432344','1234344423','1234344243','1234344234','1234342443','1234342434','1234342344','1234324443','1234324434','1234324344','1234323444','1233444423','1233444243','1233444234','1233442443','1233442434','1233442344','1233424443','1233424434','1233424344','1233423444','1233244443','1233244434','1233244344','1233243444','1233234444','1234444233','1234442433','1234442343','1234442334','1234424433','1234424343','1234424334','1234423443','1234423434','1234423344','1234244433','1234244343','1234244334','1234243443','1234243434','1234243344','1234234443','1234234434','1234234344','1234233444','1232444433','1232444343','1232444334','1232443443','1232443434','1232443344','1232434443','1232434434','1232434344','1232433444','1232344443','1232344434','1232344344','1232343444','1232334444','1223444433','1223444343','1223444334','1223443443','1223443434','1223443344','1223434443','1223434434','1223434344','1223433444','1223344443','1223344434','1223344344','1223343444','1223334444']
5: 128458

Is there a fix you can make to have this work (at least in theory given enough resources) for any $n$? Otherwise it's not currently a valid answer (I still up-voted it as it is a nice method),

It DO work for any n in theory – even though the computer needed would quickly grow beyond the size of the universe and run the age of it as n grows.  I think your comment also apply at least as much for at least a couple of the other answers here as well (I see permutation methods), with more up-votes and ability to do lesser n's. So unfair...go figure :-)

I'm talking about the fact that there is a limit to numbers which are less than 10 due to you use of grep & the like.

Charcoal, 34 bytes
Ｎθ⊞υυＦυＦθＦ∧∨¬κ№ι⊖κ‹№ικ⊕κ⊞υ⁺ι⟦κ⟧ＩＬυ

Try it online! Link is to verbose version of code. Builds up all a(n) lists in memory, so TIO will only go up to n=5. Explanation:
Ｎθ

Input n.
⊞υυ

Start with a sequence with no digits. (Alternatively, I could start with a list containing -1; this would cost 3 bytes here and then save 3 bytes because I don't need to special case the first digit below.)
Ｆυ

Loop through each sequence as it is discovered.
Ｆθ

Loop through each available digit. (These are 0-indexed, so each digit i must be less than n and can be added if there are no more than i digits i so far.)
Ｆ∧∨¬κ№ι⊖κ‹№ικ⊕κ

Check that the digit is legal.
⊞υ⁺ι⟦κ⟧

If so then append this sequence to the list.
ＩＬυ

Output the total number of sequences found.


text:
Minigolf Solitaire
Inspired by this question on the puzzling stack exchange.
Rules
Given 5 stacks of 5 cards with numbers from 1 to 7, output the moves needed to empty all stacks. A move is defined as the index of a column to pull the card off of, and a move is only valid if:

The stack is non-empty
The value of the card at the top of the stack is exactly 1 lower or higher than the value of the last card removed from any of the stacks. Note 1 and 7 wrap.

Input
This challenge has loose input rules. You can use any format as input for the 25 numbers so long as the input is unambiguous among all possible inputs. The same token must be used for every instance of a card's representation. That is, if you use 2 to represent a 2, you must use that everywhere in your input. But you may use 2 to represent 2 and 532jv4q0fvq!@$$@VQea to represent 3 if this is somehow beneficial.
Output
The list of moves needed to empty all stacks without getting stuck. This format is also loose, but it needs to represent a list of indices, where 0 is the leftmost stack.
Your program may assume that the input provided is solvable. That is, you may have undefined behaviour in the case of unsolvable input.
Note: If the input has multiple possible solutions, outputting at least 1 valid solution is acceptable
Example/Test Case explained
Input: Representing the 5 stacks, where stack one is 5,5,3,2,6 with 5 being the top of the stack. Likewise for the other 4 stacks. Again, as stated in the question, this input format is loose and can be changed to facilitate the answer
5 5 3 2 6
2 4 1 7 7
4 2 7 1 3
2 3 3 1 4
4 6 5 5 1

Output: List of moves representing the order in which the cards are pulled off the stacks. I'll explain the result of the first 3 moves. The first 3 pops 2 off of the 4th stack (2 3 3 1 4 stack). The second 3 pops 3 off of the same stack. And then the 1 pops the 2 off of the 2nd stack. If you follow these moves on the input you will end up with empty stacks
[3, 3, 1, 3, 1, 0, 4, 0, 4, 4, 2, 0, 2, 1, 1, 3, 2, 2, 0, 2, 3, 4, 0, 1, 4]

You might consider providing some test cases.

@ExpiredData Sure, I'll do that. In the interim, the linked question in puzzling has a working example

A bit confusing have zero based numbering for the stacks and then referring to 4th, 2nd, &c stack! :-(

May we output without any separator, e.g. 3313104044202113220234014?

@Arnauld yeah, sure. That's an unambiguous output format as there are no indexes bigger than 9

"with 5 on the bottom", shouldn't this be "with 5 at the top"? I'm confused that 55326 is a stack with 5 at the bottom, but in your output example you pop this bottom card from the (4th and 2nd) stacks.

@KevinCruijssen Yeah sorry. I meant bottom as the way you would look at it if you were playing solitaire. It's physically lowest. But it's the top of the stack in the sense that it's the first item you can pull off. I used these terms inconsistently in the question. I will edit

Are 1-indexed stacks fine? The way it's written suggests we must use 0-indexing ("This format is also loose, but it needs to represent a list of indexes, where 0 is the leftmost stack.").

@JonathanAllan Well, I said that because that's how we think about lists. But as you can see in my example output, a serialized list doesn't communicate how the list is indexed. 0-indexed, 1-indexed, whatever, it still gets output as a list. Do you have an example of the output you want to use?

I mean can the output refer to the stacks as 1 to 5 instead of 0 to 4 (FWIW we only use 0-indexing in many languages because the numbers are offsets, which is from memory access roots IMO 1-indexing is far more natural [first, second, ...] :)) see my Jelly answer for an example.

@JonathanAllan Oh, yeah. That's totally acceptable

The problem with such a loose input without any constraint is that one can simply put the payload of the program in each value.

@Arnauld what do you mean exactly?

What I mean is that nothing prevents me from doing this (JS, 19 bytes).

@Arnauld I'm not convinced that passes the unambiguous rule. Adding a constant block to the start of your input and claim that it's part of the representation of the input I don't think holds water

@Arnauld For example it fails on this input which represents the same board

I fail to see your point. You've turned => into > in your example, so the identifiers are no longer valid.

Jelly,  31  28 bytes
The 31 byte answer:
ṖÞZṪs5J€Ƒ
ŒṪŒ!ÇƇðœịIA%5=1ẠðƇḢZḢ

Accepts the stacks as a list of lists, [s1, s2, s3, s4, s5] where each stack has the first playable card on its left; returns a list of the 1-indexed stacks to from which to play, left to be played first.
Get a list of all ways by replacing ḢZḢ with Ḣ€€.
Since this is way too inefficient for a 5 by 5...
Try a 3 by 3 version online! (5 replaced by 3 in the code)
- this still takes ~45s and the code is \$O(n^2!)\$.
How?
ṖÞZṪs5J€Ƒ - Link 1: check each stack used in order: list [[stackIndex1, cardIndex1],...]
 Þ        - sort by:
Ṗ         -   pop (i.e. sort by stackIndex values)
  Z       - transpose -> [[1,1,1,1,1,2,2,...,4,4,5,5,5,5,5], cardIndicesSortedByStack]
   Ṫ      - tail -> cardIndicesSortedByStack
    s5    - split into chunks of five - i.e. split up by stacks
        Ƒ - invariant under?:
       €  -   for each:
      J   -     range of length (i.e. equals [[1,2,3,4,5],[1,2,3,4,5],...]?)

ŒṪŒ!ÇƇðœịIA%5=1ẠðƇḢZḢ - Main Link: list of lists of integers, M
ŒṪ                    - truthy multi-dimensional indices
  Œ!                  - all permutations
     Ƈ                - filter keep those for which:
    Ç                 -   call last Link (1) as a monad
                 Ƈ    - filter keep those for which:
      ð         ð     -   the dyadic chain - i.e. checkCardOrder(2d-indices, M)
       œị             -     multidimensional index into M (vectorises)
         I            -     deltas - i.e. [a,b,c,d,...]->[b-a,c-b,d-c,...]
          A           -     absolute values
           %5         -     mod five
             =1       -     equals one
               Ạ      -     all?
                  Ḣ   - head - i.e. first valid 2d-inices pemutation
                   Z  - transpose -> [stackIndices, cardIndices]
                    Ḣ - head -> stackIndices

           ...OR: Ḣ€€ - head each of each -> list of all such stackIndices

The 28 byte answer:
Using the rule You can use any format as input for the 25 numbers so long as the input is unambiguous among all possible inputs we may choose seven numbers such that a new dyadic function which accepts a list of such numbers and returns a list with 1s for adjacent neighbouring numbers and 0 for non-adjacent neighbouring numbers replaces the code IA%5=1. I chose the following:
^ƝẒ - list of numbers from [2,7,12,14,25,28,91] (mapping to [1,2,3,4,5,6,7])
 Ɲ  - neighbours
^   - XOR
  Ẓ - is prime?

Here is a table of the XOR results:
 ^ |  2  7 12 14 25 28 91
---+----------------------
 2 |  0  5 14 12 27 30 89
 7 |  5  0 11  9 30 27 92
12 | 14 11  0  2 21 16 87
14 | 12  9  2  0 23 18 85
25 | 27 30 21 23  0  5 66
28 | 30 27 16 18  5  0 71
91 | 89 92 87 85 66 71  0

And if we check primality:
^Ẓ |  2  7 12 14 25 28 91
---+----------------------
 2 |  0  1  0  0  0  0  1
 7 |  1  0  1  0  0  0  0
12 |  0  1  0  1  0  0  0
14 |  0  0  1  0  1  0  0
25 |  0  0  0  1  0  1  0
28 |  0  0  0  0  1  0  1
91 |  1  0  0  0  0  1  0

Here is the equivalent to the 3 by 3 version above

Many other mappings work with this code, e.g.:
[1, 2, 3, 4, 5, 6, 7] : [2, 5, 6, 13, 16, 37, 39]

or
[1, 2, 3, 4, 5, 6, 7] : [7, 12, 17, 18, 21, 32, 34]

Very nice, I love when people come up with a super inefficient different way of looking at the problem that nobody would ever come up with outside of code golf. We think of brute force as the naive solution, and then there's real brute force

JavaScript (V8), 86 bytes
This version is similar to the other one but takes advantage of the loose input format.
The cards are expected as follows:
\$[\text{Ace}, 2, 3, 4, 5, 6, 7] = [ 16, 37, 31, 91, 44, 41, 1 ]\$
f=(a,p,o='')=>o[24]?print(o):a.map((c,i)=>(v=c.pop())&&c.push((p^v)%3?v|f(a,v,o+i):v))

Try it online!
How?
The numbers \$a_n\$ representing the card values were chosen in such a way that:

\$a_i \bmod 3\neq0\$ for any \$i\in[1..7]\$
\$(a_i \operatorname{xor} a_j)\bmod 3\neq0\$ for any \$i,j\in[1..7]\$ iff the \$i\$-th and \$j\$-th cards are consecutive

Example:
Here is what we get for an Ace (\$v=16\$):
 previous card |     p     | p xor 16 | (p xor 16) mod 3
---------------+-----------+----------+------------------
     none      | undefined |    16    |        1
      ace      |     16    |     0    |        0
       2       |     37    |    53    |        2
       3       |     31    |    15    |        0
       4       |     91    |    75    |        0
       5       |     44    |    60    |        0
       6       |     41    |    57    |        0
       7       |      1    |    17    |        2

JavaScript (V8),  105 ... 92  91 bytes
Takes input as an array of 5 columns with 1-indexed cards (Ace = 1, Two = 2, etc.). Prints all solutions as strings of 0-indexed columns.
f=(a,p,o='')=>o[24]?print(o):a.map((c,i)=>(v=c.pop())&&c.push((p-~v*6)%7%5?v:v|f(a,v,o+i)))

Try it online!
How?
Given the previous card \$p\$ and the current card \$v\$, we compute:
$$k=((p+(v+1)\times6) \bmod 7) \bmod 5$$
The cards are consecutive iff \$k=0\$.
$$
\begin{array}{c|ccccccc}
&1&2&3&4&5&6&7\\
\hline
1&1&0&4&3&2&1&0\\
2&0&1&0&4&3&2&1\\
3&1&0&1&0&4&3&2\\
4&2&1&0&1&0&4&3\\
5&3&2&1&0&1&0&4\\
6&4&3&2&1&0&1&0\\
7&0&4&3&2&1&0&1\\
\end{array}
$$
We could, in theory, use \$v+(p+1)\times 6\$ just as well. But in the JS implementation, we want the result to be NaN (falsy) if \$p\$ is undefined (first iteration), which is why the bitwise operation (-~v) may only be applied to \$v\$.
Commented
f = (                  // f is a recursive function taking:
  a,                   //   a[] = input
  p,                   //   p = previous card (initially undefined)
  o = ''               //   o = solution
) =>                   //
  o[24] ?              // if o has 25 characters:
    print(o)           //   we have a complete solution: print it
  :                    // else:
    a.map((c, i) =>    //   for each column c at position i in a[]:
      (v = c.pop())    //     pop the last card v from this column
      &&               //     abort if it's undefined
      c.push(          //     otherwise:
        (p - ~v * 6)   //       use our magic formula
        % 7 % 5 ?      //       if it's not equal to 0 or NaN:
          v            //         just push v back
        :              //       else:
          v |          //         because v belongs to the global scope,
                       //         we need to use its current value right away
          f(           //         do a recursive call to f:
            a,         //           pass a[]
            v,         //           set p = v
            o + i      //           append i to o
          )            //         end of recursive call
      )                //     end of push()
    )                  //   end of map()

Was it easier to print all solutions instead of just the first?

@Cruncher I think so. We could return the last solution for the same byte count (all solutions are still computed) but stopping the recursion on the 1st solution would probably cost more.

How on earth did you come up with that formula for determining the consecutiveness of p and v

@Cruncher $m=6$ is the minimum multiplier such that there's no 'consecutive/non-consecutive' collision for $p\times m+v$. The 2 modulos can be easily found by trial-and-error from there. But I'm actually not quite satisfied with this formula. I feel like I'm missing something more straightforward.

Something like abs(p-v) maybe? Is absolute value a built-in?

@Cruncher That would be Math.abs(p-v) in JS, which is a bit lengthy. We could use (p-v)**2 instead. But it wouldn't work for the Ace<->7 wrapping anyway.

Hmm can check if (p-v)**2 is one of 1 or 36. That's probably longer than what you have

@Cruncher ((p-v)%5)**2-1 would work. But it's 1 byte longer.

(p-v)**2%7-1 also works and saves a pair of parentheses.

There may be possibility for abuse in the looseness of the input definition in the question. As you're allowed any input format that is unambiguous, you could potentially encode the allowed transitions in the symbols used in the input. Off the top of my head: '127' can be used in place of all 1's to say that this is symbol 1, and from it we can go to symbol 2 or 7. Not sure if it can help in this case, but there may be some way to parse it efficiently enough to make sense

@Cruncher You're right. See my new version.

Jelly, 43 bytes
““”;WA;"ị@Ṫ;ɗ¥¥ⱮT>Ƈ2Ɗ$€ẎIḢAfƑʋƇ1,6Ʋ25¡2ịⱮ_3

Try it online!
A monadic link taking a list of lists of integers (representing the stacks) and returning a list of lists of integers (representing the possible sequences of moves).
Explanation (method)
Works iteratively on 1 or more lists, each of which contains the sequence of cards so far at index 1, the sequence of stacks used at index 2 and the current stacks at positions 3 through 7. As such, the stacks are 3-indexed, and get changed to 0-indexing at the end. At each iteration, all possible moves are created, and then the sequence of cards is tested to check that the differences are all either -1, -6, 1 or 6. All valid moves are kept, and the next cycle of the loop is processed.
Explanation (code)
““”;                                        | Prepend two empty lists
    W                                       | Wrap in a further list
                                  Ʋ25¡      | Repeat the following 25 times:
                     $€                     | - For each current working list:
               Ɱ    Ɗ                       |   - Using each of the following as the right argument:
                T                           |     - Truthy indices (effectively here the indices of non-empty lists)
                 >Ƈ2                        |     - Keep only those greater than 2
              ¥                             |   - ... do the following as a dyad:
     A                                      |     - Absolute (used here for the side effect of copying the list)
             ¥                              |     - Following as a dyad:
      ;"    ɗ                               |       - Concatenate to following, using zipped arguments:
        ị@                                  |         - Index into list using reversed arguments
          Ṫ                                 |         - Tail, popping from list
           ;                                |         - Concatenate (to the list index)
                       Ẏ                    | - Join outer lists together
                             ʋƇ             | - Keep those lists where the following is true:
                        I                   |   - Increments (vectorises)
                         Ḣ                  |   - Head
                          A                 |   - Absolute
                           fƑ  1,6          |   - Invariant when filtered to only contain 1s and 6s
                                      2ịⱮ   | 2nd sublist of each (i.e. the sublist containing the list indices used)
                                         _3 | Minus 3

Ruby, 140...121 119 bytes
->n{w=[*0..4].product;w.find{|x|5.times{|j|((n[j][x.count j]||99)-n[a=x[-1]][~-x.count(a)])**2%35==1&&w<<x+[j]};x[24]}}

Try it online!
How:
Breadth-first search:

initialize the solution vector with the single cards on top of the stacks. (w=[[0],[1],[2],[3],[4]])
for every solution in the vector, check the possible next step. For example, [0] could expand to [0,2] or [0,4]. Append these new solutions to the vector.
now check if the solution has 25 elements: if it does, it's complete, and we can stop.

The check could be more efficient, but since I only save the stack numbers, I have to get the cards from the stacks on every iteration. Changing the stack in a non-recursive solution is out of the question, and saving the card numbers would require more code.

source: Stack Exchange

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

sort: votes


text:
Approximating the amount of prime numbers below `x`
Background
We define the prime-counting function, \$\pi(x)\$, as the number of prime numbers less than or equal to \$x\$. You can read about it here.
For example, \$\pi(2) = 1\$ and \$\pi(6) = 3\$.
It can be shown, using dark magic, that
\$ \lim_{x \to \infty} \frac{\pi(x)}{x/\log x} = 1 \$
which means we can approximate \$ \pi(x) \$ by \$ x/\log x\$.
Your task
Your purpose is to write a function/program that takes x as input and outputs the approximation of \$\pi(x)\$ as given by the ratio of the input and the logarithm of the input, with exactly \$\pi(x)\$ decimal places. Either rounding works fine.
Test cases
f(4) = 2.89
f(10) = 4.3429
f(19.3) = 6.52003877
f(60) = 14.6543602005583370
f(173) = 33.570776430488395580723956088340374417691
f(499) = 80.3205598921264941447922062868184315657020413225943243128931714242910058741601601524983152243502
f(1024) = 147.73197218702985291365628733459375487248854570526575965547001926974558404415335218027792618429504967649254587490842053177273361276604002741459580500208428403451262667619517

Scoring
This is code-golf so shortest solution wins... With a twist! If the code you wrote gives the right answer for results with up to  p decimal places and your code has b bytes, then your score is
\$(e^{-p/64} + \frac13)b \$
which essentially means you get a better score if the precision is really high, as the factor multiplying by b decays rapidly as the precision increases until flattening at \$\frac13\$.
If you can't tell for sure the precision up to which your code works, you can take p to be the number of decimal places of the last test case your code can handle exactly.
For this challenge, the minimum score is 1/3, which would be attainable by a 1-byte long submission with arbitrary precision.
Admissible solution
To wrap up, your code is a valid solution if and only if it computes the approximation of \$\pi(x)\$ as given by the formula and, when it gives the output, the output has exactly \$\pi(x)\$ decimal places. The p for the scoring will be how many decimal places you can get right.
Notice the distinction. The code linked outputs square root of 2 with 1000 decimal places BUT python only gets some of the decimal places right.

Standard loopholes are forbidden

with exactly () decimal places. How do we know how many decimal places there are? Doesn't that imply that we have to calculate () exactly as a part of this challenge, and not just estimate it?

@Cruncher either your programming language has a built-in for pi(x), or you compute for small values of x (with a sieve, for example) or you investigate how well the approximation works and round it down/up to get the correct number of decimal places to be used.

So if we give more decimal places it's wrong? and if we give less decimal places it's right but negatively affects score?

@Noodle9 there are 8 primes below 19.3 so the function should return the approximation for pi(19.3) with 8 decimal places.

@ExpiredData you have to give that exact number of decimal places. I am just giving the possibility that at some point they start being wrong. Check the python answer below, for larger inputs the decimals all become 0

@RGS what do you mean by at some point they start being wrong. Either it is a requirement of the challenge that it would work for arbitrary values or it isn't? Why can't that at some point be the first point and hence p = 0. and if it can't then you need to much more clearly define at what point that at some point is

@ExpiredData the requirement is the amount of decimals, not their correctness.

@RGS I'm not sure I understand, which I think probably means your question is not very clear. Is the requirement that there is exactly pi(x) decimals for all possible x? In which case are you saying a language cannot answer if it does not have arbitrary decimal precision, or are you saying the answer is still valid?

@ExpiredData I tried rewriting the final section to make it better. Is it clearer now?

Dank so basically just need to append pi(x) zeroes on to my solution.. I've downvoted as I don't think this is a good challenge - It wasn't very clear and appears to have lots of very arbitrary steps.

Is rounding to $ \pi (x) $ precision mandatory or optional? You say you have to do it exactly, but then you base scoring on how accurate the precision is?

@JoKing you have to display pi(x) decimal places. If you get all those decimal places right, then that boosts your score. If you know your code can never get the decimal places from the 17th onward right, then your p is 16. So basically you can always append enough zeros to the output to have as many decimal places as requested,but then those 0s won't be correct so they won't boost your score.

Do we have to display trailing 0 decimal places? Is the current Python 3 answer valid?

@JoKing as of the time of writing, the Python answer is not valid because it doesn't print any decimal places whatsoever.

@RGS Something seems wrong here:  $\pi(19.3)$ is 6.52..., but you seem to be saying it must return 8 decimal places because the non-approximate value is 8?  This seems to be saying we must not only calculate the approximation, but also the non-approximation?  Shouldn't we be expected to return 6 digits for $\pi(19.3)$?

@DavidG. Supposedly I was requiring you to return 8 decimal places. But I don't know what to do to my life anymore :/

@RGS: OK, even more confused.  I wrote a new solution in a partly new language to do both calculations, and the test cases seem to be missing a few digits in some cases.  like $\pi(60)=17$ so f(60) should be 14.65436020055833703 (nearest) or 14.65436020055833702 (down).   Did you mean the test cases to be off?

Python 3, 61 bytes \$\approx\$ 77.6375 score
import math
def f(x):p=x/math.log(x);print(f"{p:.{int(p)}f}")

Try it online!
Correct up to 4 decimals for \$\pi(10)\$.
Original post solution:
Python 3, 41 bytes \$\approx\$ 54.66 score
lambda x:int(x/__import__('math').log(x))

Try it online!
Saved 20 bytes thanks to Expired Data!!!
Taking a leaf out of Expired Data's book and going for zero precision so \$p=0\$.

Up to what p does your answer work?

41 bytes * (1 + 1/3) = 54 + (2/3) score

@ExpiredData That's brilliant! Didn't know about the dunder method __import__. Thanks! :-)

@Noodle9 Yeah I found it on google, I don't really speak python. It's probably smaller if you said the import is counted in the byte count and then just specify it as the extra 11 bytes. Relevant

Your solution doesn't meet the requirement of "outputting a number with exactly pi(x) decimal places.

Fixed that - thanks! :-)

05AB1E, 17 14 bytes - Score = 22.6... 18.6...
-3 bytes/4 score thanks to Kevin Cruijssen
žr.n÷'.0IÅPg×J

Try it online!
As far as I'm aware 05ab1e doesn't have arbitrary length decimal precision. You can probably come up with an answer which calculates pi(x) decimal points of x/log(x) in less than 68 bytes and then concats them but frankly I'm not interested in this question any more.

Old answer before the question was revised
05AB1E, 6 bytes = 8 score
žr.n/ò

Try it online!
Does x/ln(x) and then rounds to the nearest integer, hence p = 0

@JoKing The old question never prints any decimal places so it is not valid

@JoKing oh sorry, only noticed now they changed. Before the edit, the Python answer would print as many trailing zeroes as needed.

Bash + bc, 89 bytes,  arbitrary precision, final score \${89\over3} \approx 29.67\$
f(){
a=`primes 1 $((${1%.*}+1))|wc -l`
echo "scale=$a+20;a=$1/l($1);scale=$a;a/1"|bc -l
}

Try it online!
${1%.*} strips off the fraction
$(( ... +1))) adds one, as primes doesn't output the final number if prime.
primes 1... outputs the list of primes
|wc -l counts them
At this point, a contains \$\pi(x)\$.
The echo puts together a bc program, which is then piped to bc.

Set the scale to 20 more than needed (to get the accuracy)
do the approximation
set the scale to the exact number of digits
do a division by 1 so the scale is applied

bc, 61,51,46,45 bytes +2 for -l, (almost) arbitrary precision, final score \$\approx{47\over3} \approx 15.6666744835...\$
define f(x){scale=999
return(scale=x/l(x))/1}

Try it online!
Unlike the test cases, I don't give too many digits.  I give the number of digits based on the approximation, not the counted value.
Precision degrades with this solution when the result reaches 1000, at f(9119).  At that point, one must add another 9 on the first line.  A general solution would be possible, but longer.  I guess this makes the score for this version 15.6666744835...
It turns out, with initial scale=99 the score is 25.127..., and with initial scale=9999 the score is 16 + 6.75...E-67.
I could write scale=9^9, get 387420489 digits of precision (probably a few less accurate), but it would take too long to run.  TIO doesn't even let 9^4 get passed the second test case.  This would get a score of 15.6666666666..., but still slightly more the 15⅔.
Edit: Saved 10 bytes by eliminating scale=0 and rounding on scale=a
Edit: saved 5 bytes by eliminating a temporary
Edit: saved 1 byte by eliminating whitespace

Mathematica, \$\approx\$ 7.67 score
25 23 bytes, arbitrary precision, final score \$ \frac{23}{3}\$
N[#/Log@#,PrimePi@#+1]&

-2 bytes, courtesy of @ExpiredData
Here is a benchmarking solution. Try it online!.

2.88539008177792681482 doesn't this output only make sense for f(4) if 4 has 20 primes lower than it? Or am I misunderstanding the requirement with exactly () decimal places.?

@Cruncher you are not interpreting it wrong, TIO just doesn't work really well with N, for some reason. Running this function locally, the roundings are done well. In TIO they show up after the ` at the end of the number.

Can't you get -2 bytes with N[#/Log@#,PrimePi@#+1]&

@ExpiredData yes I can, thanks

To fix the TIO link, run the outputs through ToString before Print.

@NickKennedy Thanks a lot! Can you explain me what was happening under the hood?

@RGS I don’t know why it wasn’t working on TIO, but I reasoned that the output of N is storing the data and the number of digit, but converting the output of N to a string should fix the formatting using that number of digits.

@NickKennedy good thinking

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


text:
Elastic collisions between blocks
The 3Blue1Brown Youtube channel released a video a year ago called "Why do colliding blocks compute pi?" which describes a model where a block A of mass \$a\$ slides into a block B of mass \$b\$, which then pushes block B into a wall, causing it to bounce off the wall and then collide again with block A.
The miracle of this process is that if \$a/b = 10^{2n-2}\$ the number of total collisions (both between A and B and between B with the wall) is given by the first \$n\$ digits of \$\pi\$.

Example output
+-------+---+--------+
| a     | b | output |
+-------+---+--------+
| 1     | 1 | 3      |
| 2     | 1 | 5      |
| 3     | 1 | 5      |
| 4     | 1 | 6      |
| 5     | 1 | 7      |
| 10    | 3 | 6      |
| 7     | 2 | 6      |
| 9     | 2 | 7      |
| 1     | 2 | 3      |
| 1     | 5 | 2      |
| 100   | 1 | 31     |
| 10000 | 1 | 314    |
+-------+---+--------+

(These values were calculated using this web applet from Reddit user KyleCow1. Please let me know if I've made any mistakes.)

Challenge
Your challenge is to take two positive integers \$a, b \in \mathbb N_{>0}\$, and output the number of collisions in this scenario. Your program should be able to handle all \$a, b \leq 10\,000\$. This is a code-golf challenge, so the shortest program wins.

can we input b,a instead of a,b?

..or a+ib as a complex number?

Sure, either of these inputs is fine.

@ngn in what way would the complex number help?

@RGS if your language has a concise way of getting the argument of a complex number (the "theta"), then arctg(b/a) could be theta(a+ib), but i'm not sure it would help much in this case, as b/a is under a sqrt

The case where b=1 is now on the OEIS as A331859.

Jelly, 10 9 bytes
My first Jelly submission :')
÷½ÆṬØP÷Ċ’

-1 byte thanks to Mr.Xcoder
Uses the formula as in the video. Receives the input flipped; OP gave permission. It probably has room for further golfing, so be sure to give me feedback!
÷½        divide b by a and take square root
  ÆṬ      take the ArcTan of that; then
      ÷   divide
    ØP    pi
          by the number we had.
       Ċ  Round up
        ’ and subtract one

Try it online

9 bytes. This gives a different result for the pair 3,1->5 (test case #3), but the current 10-byter wrongly gives 6 due to floating point inaccuracies, so it's actually a "fix" too :)

@Mr.Xcoder thanks for your feedback!

APL (Dyalog Classic), 18 16 bytes
¯1+⌈○÷¯3○.5*⍨⎕÷⎕

Try it online!
rendered as the equivalent {¯1+⌈○÷¯3○.5*⍨⍵÷⍺} in the tio link, to facilitate testing; ⎕ means evaluated input; ⍺ and ⍵ are the arguments to an anonymous function
$$\left\lceil\frac\pi{\textrm{arctg}\sqrt\frac ba}\right\rceil-1$$
(that's the formula from the video. i recommend watching it. it's well explained and the animations are great for building intuition.)

You could go Extended for .5*⍨ → √

JavaScript (ES7),  41  39 bytes
Takes input as (a)(b).
a=>b=>3.14159265/Math.atan((b/a)**.5)|0

Try it online!
How?
Instead of using a ceil function and subtracting \$1\$, we deliberately use a slightly underestimated approximation of \$\pi\$ and floor the result with a bitwise OR.
For \$a,b\le 10000\$, it was empirically proven to give the same results as this safer 44-byte version:
with(Math)f=a=>b=>ceil(PI/atan((b/a)**.5))-1

Try it online!

I'm assuming you tried reducing the number of decimal places in your pi approximation? I'm quite sad because 355/113 is a really nice approximation of pi and would allow you to golf even more.

@RGS That's correct. Going from memory here, but I think I need either 3.14159264 or 3.14159265.

The simplest fraction in that range is 99378/31633, which isn't short enough to golf, unfortunately

Haskell, 32 bytes
a#b=ceiling(pi/atan(sqrt$b/a))-1

Try it online!

Mathematica, 30 29 bytes, 25 characters
⌈Pi/ArcTan@Sqrt[#2/#]⌉-1&

Try it online
-1 byte thanks to ExpiredData
Uses the formula explained in the video.

You can just use # instead of #1

@ExpiredData thanks :D

Ruby, 49 43 bytes
->a,b{(-1.arg/((a*b)**0.5+b.i).arg).ceil-1}

Try it online!
-5 thans to G B, nicely done
-1 replacing 1i*b with b.i

I suppose it would be acceptable to take floats as input so that ->a,b{(Math::PI/Math.atan((b/a)**0.5)).ceil-1} works -- but you may want to ask the OP.

You can use -1.arg for Math::PI

And ((a*b)**0.5+1i*b).arg is the same as Math.atan(b**0.5/a**0.5)

C (gcc), 63 \$\cdots\$ 47 46 bytes
f(a,b){a=ceil(acos(-1)/atan(sqrt(b*1./a)))-1;}

Try it online!
Saved 11 12 bytes thanks to ceilingcat!!!
Uses the formula from the video as ngn recommended.

Excel, 35 37 bytes
-2 bytes thanks to @Chronocidal
=CEILING(PI()/(ATAN((B1/A1)^.5)),1)-1

You seem to have an unnecessary set of brackets around ATAN, for 35 bytes

05AB1E, 30 bytes
/t©ažq;‚Δ{ÐO;Å¼®‹èsO;‚}нžqs/î<

Try it online!
Almost definitely golfable..
Implements the formula but because 05AB1E doesn't have arctan we have to calculate it, this does it by bisection.

Explanation
/t                                - sqrt(a/b)
  ©                               - store this value
   ažq;‚                          - the array [0, pi/2]
        Δ                         - repeat until the array passed in does not change
         {Ð                       - sort then triplicate array
           O;Å¼                   - arctan of the average of the array (bisection)
               ®‹                 - is this greater than the sqrt(a/b)? 0 if so 1 if not
                 èsO;‚            - Take the index from the current two guesses and combine with their average
                      }н          - Stop looping and get the first value
                                  - (this should be close enough to arctan(sqrt(a/b))
                        žqs/      - push pi then divide it by the atan(sqrt(a/b)) guess
                            î<    - ceil and decrement

Rust, 59 bytes
|a:f64,b:f64|(f64::acos(-1.)/(b/a).sqrt().atan()).ceil()-1.

Try it online!

J, 19 bytes
_1+1p1>.@%_3 o.2%:%

Try in Jconsole as the TIO seems to be quite weird.
Usage: f=:_1+1p1>.@%_3 o.2%:%
Example
f 10000 => 314

This is not a valid answer because it is not a syntactically valid function by itself. A function should be either a train _1+1p1>.@%_3 o.2%:% or an explicit definition {{_1+>.1p1%_3&o.%:1%y}}. TIO example showing a train.

@Bubbler changed to a train

Python 3, 55 bytes
lambda a,b:ceil(pi/atan((b/a)**.5)-1)
from math import*

Try it online!

AWK, 56 55 bytes
{x=atan2(0,-1)/atan2(($2/$1)^.5,1);$0=int(x);$0-=$0~x}1

Try it online!
I know I can save a few bytes by hardcoding Pi to some arbitrary precision, but I'm not sure how accurate it is outside of the provided test cases.

PHP, 46 bytes
<?=ceil(pi()/atan(($argv[2]/$argv[1])**.5))-1;

Try it online!
Not very original I guess, applying the formula from the video..


text:
Given a list of strings, find all elements which are still in the list when any character is deleted
Write a program using the fewest bytes of source code which given a list of strings finds all elements which are still in the list when any character is deleted.
For example, given a list of all English words boats would be output because oats, bats, bots, boas, boat are all English words and thus would be in the list.
Simple Pyhon code example, assuming words is the input list:
for w in words:
    has_all = True
    for i in range(len(w)):
        test = w[:i] + w[i+1:]
        if test not in words:
            has_all = False
            break
    if has_all
        print(w)

Example input list with some strings:
aorn (+)
aor (+)
arn
aon
orn (+)
ao
ar
or
rn
on

The strings marked with (+) are the ones that should be the output.
arn and aon shouldn't be output because we can delete the middle character to get an, which is not in the input list.
You should test that aba is not present on the output of this list:
aba
ba
aa
b

I would not recommend to copy-paste a large dictionary in the challenge. But I think you should include a test dictionary (say ~100 words) so that the solutions can be easily tested.

Edited with a small list of examples. Added code-golf tag.

"when any character is deleted" -> then "arn" and "aon" should be positive I think, you remove "a" or "n" and it's in the list.. or are the first and last char not removeable? in that case should't say "any"

@Kaddath when r is removed from arn, the result is an, which is not in the list. It should be possible to remove any character, not just one of them.

Might the input have repeated characters?

Yes, repeated characters are allowed. Indeed most English examples I am aware of have repeated characters.

Nice first question!  Could I ask you to repeat the information of the title, as well as the relevant bits from [tag:code-golf] into the body of the question?  It is how most challenges are written here so it makes this easier to read.  In addition the code-golf tag has important rules that can be easily missed by newcomers since they require clicking on a specific element to be found.  Thanks.

I have added the requested bits.

I think you should add some test cases with repeat characters like ["aba","ab","aa","b"] to catch solutions that try remove every copy of a character, or always remove the first copy. Having more test cases is good in general.

Are we really supposed to support 1-character words? If yes, are we also supposed to support the empty string, which would make 1-character words valid? (cc @xnor)

J, 11 bytes
*/@e.~1<\.]

Try it online!
J's "outfix" adverb \. does exactly what we need here.
Take the dictionary as the left arg (implicitly, via the overall dyadic hook), and the string to test as the right arg.

1<\.] Returns the box of every length 1 outfix of our right arg, that is, every copy with exactly 1 char deleted.
e.~ Asks if each of those is an element of the dictionary given  as the left arg. Returns a list of boolean zeros and ones.
*/@ Multiplies them all together, that is, are they all one?

Python 3, 69 bytes
lambda L:[w for w in L if{w[:i]+w[i+1:]for i in range(len(w))}<={*L}]

Try it online!
Python 2, 71 bytes
lambda L:[w for w in L if{w[:i]+w[i+1:]for i in range(len(w))}<=set(L)]

Try it online!

JavaScript (ES6), 74 bytes
a=>a.filter(w=>[...w].every((_,i)=>a.includes(w.slice(0,i)+w.slice(i+1))))

Try it online!

75 bytes
A bit more fun, but 1 byte longer:
a=>a.filter(w=>w.replace(/./g,"$`$',").split`,`.every(w=>!w|a.includes(w)))

Try it online!
or:
a=>a.filter(w=>!+w.replace(/./g,_=>+!a.includes(r["$`"]+r["$'"])),r=RegExp)

Try it online! (SpiderMonkey)

Jelly, 7 6 bytes
e-ƤẠ¥Ƈ

Try it online!
A monadic link taking a list of words and returning a list of words.
Thanks to @JonathanAllan for saving a byte!
Explanation
    ¥Ƈ | Keep only those where the following is true:
e-Ƥ    | - Check whether each outfix with sublists length 1 removed is in the original list
   Ạ   | - All

Save a byte using exists in with e-ƤP¥Ƈ - TIO (P can  of course be Ạ)

Ruby, 51 48 45 bytes
->a{a.reject{|i|i.gsub(/./m){[$`+$']-a}[?"]}}

Try it online!
For each character in a string, generate the string with it deleted, then replace the character with either that string, if it's not in a, or an empty array, using - for the set complement operation. Then check whether the result contains any string representations.
Edit: -3 bytes from Value Ink by not converting arrays to booleans.

This is incredible

[45 bytes -- use [$\+$']-aand check if the string contains a"` instead.](https://tio.run/##KypNqvyfZvtf1y6xOlGvKDUrNbmkuiazJlMvvbg0SUNfTz9XszpaJUFbRT1WN7E22l4ptrb2f4FCWnS0elJ@Ykmxug6IhlJAEioGpCBCYApGQpTBKPXY2P8A "Ruby – Try It Online")

GolfScript, 34 bytes
~:a{.,,{1$.2$<\@)>+a?)}%{and}*\;},

Try it online!
Explanation
~   # Evaluate the inplicit list input
 :a # Assign to the variable a w/o popping
    # (To be golfed)
{                           }, # Huge filter block
 .   # Copy the current string
  ,, # Generate a length list
    {                 }% # Map the length list:
     1$.2$<\@)>+      # Remove the character at the index
                a?)   # Is this string still in the list?
    {and}*               # logical AND all of the results
    \;                # Discard the extra operand

Charcoal, 11 bytes
Φθ⬤ι№θΦι⁻ξμ

Try it online! Link is to verbose version of code. Explanation:
 θ          Input array
Φ           Filter where
   ι        Current word
  ⬤         All characters satisfy
    №       (Non-zero) Count of
       ι    Current word
      Φ     Filtered where
         ξ  Character index
          μ Inner index
        ⁻   Differ (i.e. filter out that character index)
     θ      In input array
            Implicitly output each matching word on its own line

Ruby, 64 bytes
->l{l.select{|w|(1..w.size).all?{|a|l&[w[0,a-1]+w[a..-1]]!=[]}}}

Try it online!

PHP, 112 bytes
for(;$s=$argv[++$i];$j=0){for($t=1;$s[$j];)$t&=in_array(substr($s,0,$j).substr($s,++$j),$argv);if($t)echo"$s,";}

Try it online!
That's still pretty ugly and throws a lot of notices, but it works..
Pretty straightforward:
for(;$s=$argv[++$i];$j=0){ //loops on arguments skipping the first (script name) and resetting $j each turn
  for($t=1;$s[$j];)        //loops on all chars indexes initializing $t to true
    $t&=in_array(substr($s,0,$j).substr($s,++$j),$argv); //checks if in arguments array, with deleted char -> bitwise AND the result to $t
  if($t)echo"$s,";         //if $t still true, displays argument with a coma
}

caveat: can lead to false positive if the name of the script is a word that can be a match in the list (".code.tio" in TIO, so OK here)
Try it online! for the added second test case [aba, ba, aa, b]
EDIT: saved 3 bytes using bitwise assign operator &=in_array instead of logical operator =$t&&in_array
EDIT2: saved another 3 by initializing $j to zero and moving ++ inside substr
EDIT3: saved another one by resetting $j to zero in first loop declaration, saving the , (it is undefined on first iteration, causing a bunch of new notices, but PHP is a smart guy)

C# (Visual C# Interactive Compiler), 67 bytes
a=>a.Where(x=>x.Select((y,_)=>x.Remove(_,1)).All(y=>a.Contains(y)))

Try it online!

Java 10, 137 130 121 bytes
L->L.stream().filter(w->{var b=1>0;for(int i=0;i<w.length();)b&=L.contains(w.substring(0,i)+w.substring(++i));return b;})

-7 bytes thanks to @ExpiredData.
Try it online.
Explanation:
L->                      // Method with String-List parameter & String-Stream return-type
  L.stream().filter(w->  //  Filter the words in the input-Stream by:
    var b=1>0;           //   Create a boolean, starting at true
    for(int i=0;i<w.length();)
                         //   Loop `i` in the range [0, word-length)
      b&=                //    Check if all are truthy for:
         L.contains(w.substring(0,i)+w.substring(++i)
                         //     Remove the `i`th character from the word
                      ); //     and check if this is in the input-list
    return b;})          //   And return the resulting boolean

130 using streams? bare in mind I'm not good at java - so probably golfable

@ExpiredData Ah, didn't realize that ended up being shorter. I indeed had that approach in my head as well after seeing the JS, C#, and 05AB1E answers using a filter, but figured it would be too long due to the java.util.stream.IntStream.range(0,a.length()) being so long, so didn't bother trying. Thanks!

C++ (clang), 216 \$\cdots\$ 164 160 bytes
#import<string>
#import<set>
void f(std::set<std::string>d){for(auto w:d){int h=1,i=0;for(;w[i]*h;){auto t=w;h=d.find(t.erase(i++,1))!=end(d);}h&&puts(&w[0]);}}

Try it online!
Saved 10 bytes thanks to ceilingcat!!!
Ungolfed:
#include <iostream>
#include <set>
#include <string>

void f(const std::set<std::string>& words) {
    for (auto word : words) {
        bool hit = true;
        for (size_t i = 0; i < word.size(); ++i) {
            auto temp = word;
            temp.erase(i, 1);
            if (words.find(temp) == end(words)) {
                hit = false;
                break;
            }
        }
        if (hit) {
            std::cout << word << "\n";
        }
    }
}

AWK, 101 94 bytes
{a[$0]++}END{for(w in a){e=split(w,x,"");for(i in x){t=w;sub(x[i],"",t);e*=a[t]}if(e)print w}}

Try it online!

Haskell 42 bytes
f l=[e|e<-l,all(\c->filter(/=c)e`elem`l)e]

In f I'm just literally asking for all elementes e in the list l, such that, for all characters c in that element, if I filter c from e (filter(/=c)e), the result is still in the list (filter(/=c)e`elem`l).

What if a string has repeated characters? Won't this remove all instances of that character rather than just one?

Japt -f, 11 10 9 bytes
I am horribly out of practice; (now slightly less) convinced this can be shorter!
¬e@NÎøUjY

Try it

Perl 6, 44 42 bytes
crossed out 44 is still 44
{@^a.grep:{m:ex/^(.*).(.*)$/>>.join⊂@a}}

Try it online!
Filter from the input list elements where the possible regex matches excluding one letter are a subset of the input.

05AB1E, 8 bytes
ʒæ¤g<ùåP

Try it online!
ʒ            # filter the list of words by:
 æ           #  powerset of the word
  ¤g<        #  length of the word - 1
     ù       #  elements of the powerset that have this length
      åP     #  are they all in the list of words?

@downvoter care to explain what’s wrong with this answer?

Zsh, 58 bytes
for x;(repeat $#x (($@[(I)$x[0,i]${x: ++i}]))||exit;<<<$x)

Try it online!
I abuse a (subshell) to remove the need to reset i on each iteration, and to use exit instead of continue 2.
for x;(repeat $#x (($@[(I)$x[0,i]${x: ++i}]))||exit;<<<$x)
for x;                                                      # for each element
      (repeat $#x                                  ;     )  # repeat for the length
      (                   $x[0,i]${x: ++i}               )  # 1-indexed substring, zero-indexed substring
      (             $@[(I)                ]              )  # get smallest index of match
      (           ((                       ))||exit;     )  # if zero, exit the subshell
      (                                             <<<$x)  # if we didn't exit, print the string
      (                                                  )  # exit subshell, which unsets i.