text:
Hot moo shuffle: milk an array
Background
Milking the deck is the name given to the following card shuffling method:

'Pinch' the deck to remove the top and bottom cards simultaneously. (With lots of imagination, this action resembles milking a cow.) This pair of cards forms the base of a new pile.
Repeat, adding each pair of cards to the top of the new pile, until the whole deck has been used.

Example
Suppose we start with a deck of six cards, [1, 2, 3, 4, 5, 6] (lower-indexed elements are nearer to the top). Let's milk the deck:

old = [1, 2, 3, 4, 5, 6], new = []
Remove [1, 6]: old = [2, 3, 4, 5], new = [1, 6]
Remove [2, 5]: old = [3, 4], new = [2, 5, 1, 6]
Remove [3, 4]: old = [], new = [3, 4, 2, 5, 1, 6]

After milking, the deck is therefore ordered [3, 4, 2, 5, 1, 6].
Challenge
Your task in this code-golf challenge is to implement the milking operation on a given array and output/return the result. The input array will contain only positive integers, not necessarily distinct. If the input array contains an odd number of elements, then the last milking step transfers only one element (the last one remaining) from the input to the output array.
Test cases
Input -> Output
[1, 2, 3, 4, 5, 6] -> [3, 4, 2, 5, 1, 6]
[1, 2, 3, 4, 5, 6, 7] -> [4, 3, 5, 2, 6, 1, 7]
[9, 7, 5, 3, 1, 2, 4, 6, 8, 10] -> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
[1, 1, 2, 1, 2] -> [2, 1, 1, 1, 2]
[] -> []

@Third-party'Chef' You're right, it is the inverse of pendulum encoding when length is odd. When length is even, though, it ends up with every pair flipped. Eg. [1,2,3,4,5] → [4,2,1,3,5] → [1,2,3,4,5] but [1,2,3,4,5,6] → [6,4,2,1,3,5] → [2,1,4,3,6,5]. (First I applied the pendulum encoding, then the milk shuffle.)

@AviFS So the inverse of pendulum encoding is therefore the milk shuffle, then pendulum encoding and then finally the milk shuffle again.

@Noodle9 Haha, exactly!!

Closely related

R, 53 50 48 bytes
f=function(x,y=rev(x))if(c(y,F))c(f(y[-1]),y[1])

Try it online!
Repeatedly takes the bottom card & flips the deck.

I really like this approach. Well done!

This is a great approach. But it's not the golfiest in R :-) 37 bytes

R, 36 bytes
function(x)rbind(rev(x),x)[-seq(!x)]

Try it online!
Takes integer(0) (a length 0 integer vector) for empty input.
Stacks the reversed array onto itself, giving something like:
     [,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,]    7    6    5    4    3    2    1
[2,]    1    2    3    4    5    6    7
And then removes the first n=length(x) elements, going down the columns, then across the rows.

Wow - I can't believe you've beaten me by so much!  Well done!

Haskell with -XParallelListComp, 52 49 bytes
f l=drop(length l)$id=<<[[x,y]|x<-reverse l|y<-l]

Try it online!
Explanation
This is for my old answer. The only difference is that the riffling has been golfed from a call to zip and a flattening step to a parallel list comprehension and a flattening step.
This works by taking two copies of the input deck. You reverse the first copy, then riffle it with the second. Then remove as many cards as there were in the input deck, leaving behind the answer. In the code,
f l=drop(length l)$(\(x,y)->[x,y])=<<zip(reverse l)l
                   (\(x,y)->[x,y])=<<zip(reverse l)l  riffling
                                     zip                riffle
                                         reverse l      the reversed deck
                                                   l    the deck
                   (\(x,y)->[x,y])=<<                 flattening
    drop(length l)                                    removing
    drop                                                discard (from top)
         length l                                       length of input

The flattening portion does as follows. When riffled, the deck looks like [(6,1),(5,2),(4,3),(3,4),(2,5),(1,6)] (list of tuples). We "flatten it" to look like [6,1,5,2,4,3,3,4,2,5,1,6].
I remain convinced that this approach might be shorter than the port of Dominic van Essen's answer. I think the (\(x,y)->[x,y]) function can be shortened or removed, as well as the annoying use of length.
Pointfree Haskell, 61 bytes
Just for fun; I initially thought it would be shorter.
foldr(pure tail).((\(x,y)->[x,y])=<<).(zip.reverse<*>id)<*>id

At least in R your conviction turns out to be correct...

@DominicvanEssen there’s a certain irony to your method being shorter for haskell and mine being shorter for R.

Haskell, 38, 33 bytes
g(x:y)=f y++[x]
g x=x
f=g.reverse

Try it online!
-5 bytes thanks to @Zgarb.
Very simple port of Dominic van Essen's solution. Go upvote theirs instead.
I was going to put this as a reference to compare to in my other answer, but figured it was more in the spirit of cgcc to submit twice.

33 bytes with a helper function that can pattern match.

Also 33 bytes. I wonder if we can get it lower somehow but I'm not seeing it.

Perl 5 + -p, 33 bytes
$\=" $` $'".$\,$_=$1while/ (.+) /

Try it online!
Explanation
This approach utilises -p which allows work on input implicitly, by putting it in $_ for each line of STDIN and implicitly printing $_ at the end of the program. $\ is used as this magic variable is automatically printed after the contents passed to print. The main body is a while loop that checks if $_ m//atches (.+) (a space followed by one or more characters followed by another space), while $_ does march (m// implicitly checks $_ when not called via =~) $\ is set to a space, the remaining string after the match ($') followed by another space and the preceding string contents before the match ($` ), concatenated with the existing contents of $\. $_ is then set to the matched string (excluding the spaces) which is captured in $1. At the end of the script, this leaves the central characters (either one or two depending on whether the list has an even or odd number of entries) in $_, which is implicitly printed, followed by the content of $\, which contains a leading space and the rest of the list "milked".

I'm afraid I accidentally clicked on the 'downvote' arrow and this is now 'locked in'.  If you can make an edit I'll remove it.  I do apologize!

@DominicvanEssen No problem, thanks for letting me know rather than me wondering what I did wrong! :)

05AB1E, 9 8 7 bytes
Âsø˜2äθ

-1 byte thanks to @Neil
Try it online or verify all test cases.
Or alternatively, a port of @DominicVanEssen's approach is 7 bytes as well:
vRćˆ}¯R

Try it online or verify all test cases.
Explanation:
Â        # Bifurcate the (implicit) input-list (short for Duplicate & Reverse copy)
         #  i.e. [1,2,3,4,5,6,7] → [1,2,3,4,5,6,7] and [7,6,5,4,3,2,1]
 s       # Swap so the input-list is at the top again
         #  → [7,6,5,4,3,2,1] and [1,2,3,4,5,6,7]
  ø      # Zip/transpose the lists together to create pairs
         #  → [[7,1],[6,2],[5,3],[4,4],[3,5],[2,6],[1,7]]
   ˜     # Flatten it
         #  → [7,1,6,2,5,3,4,4,3,5,2,6,1,7]
    2ä   # Split it into 2 equal-sized parts
         #  → [[7,1,6,2,5,3,4],[4,3,5,2,6,1,7]]
      θ  # Pop and push just the last part
         #  → [4,3,5,2,6,1,7]
         # (after which it is output implicitly as result)

v        # Loop the (implicit) input-list amount of times:
         #   i.e. we'll loop 7 times for input [1,2,3,4,5,6,7]
 R       #  Reverse the list at the top of the stack,
         #  which will use the (implicit) input-list in the first iteration
         #   i.e. [1,2,3,4,5,6,7] → [7,6,5,4,3,2,1]
  ć      #  Extract head; pop and push remainder-list and first item separated
         #   → [6,5,4,3,2,1] and 7
   ˆ     #  Pop this first item, and add it to the global array
}¯       # After the loop: push the global array
         #  → [7,1,6,2,5,3,4]
  R      # Reverse it
         #  → [4,3,5,2,6,1,7]
         # (after which it is output implicitly as result)

I think Rsø˜2ä¤ works for 7 bytes? Not sure whether it's the best implementation though...

I knew there would be something better and θ is that thing.

6 bytes by porting isaacg's Pyth answer.

@petStorm Thanks, but I'm afraid the output is incorrect. If I use RI (or Âs) instead so the input is above the reversed input on the stack, it would be correct. It's basically the same as my first approach, where ø˜ and the builtin .ι act the same in this case.

Python 3, 36 bytes
M=lambda a:a and M(a[-2::-1])+a[-1:]

Try it online!
Uses Dominic van Essen's approach: repeatedly takes the bottom card and recurses on the reverse of the rest of the deck.

C (gcc), 65 62 60 bytes
i;f(c,z)int*c;{for(i=0;i||(i=z-=2)>0;)*c^=c[i--]^=*c^=c[i];}

Try it online!
The loop iterates backwards from the last - 1 element and swaps it with the first element.
Then it restarts iteration two elements backwards until finished.
Saved 3 using loop reset in loop check instead of recursion.
Saved 2 more because i>0 check is no more needed.
Example

1 2 3 4 5 6 7 8 => 4 5 3 6 2 7 1 8
7           1
6.        7
5.      6
4.    5
3.  4
2 3 4 5 6 7 1 8
6       2
5     6
4.  5
3 4 5 6 2 7 1 8
5   3
4 5

APL (Dyalog Classic), 7 bytes
-4 bytes thanks to Ada
-3 bytes thanks to Bubbler
-1 byte thanks to ngn!
≢↓∘∊⌽,⍪

Try it online!
Port of Kevin Cruijssen's 05AB1E answer and streetster's K solution - don't forget to upvote them!

I think a train would save you four bytes ≢↓(,∘↑⌽,¨⊢)

,∘↑ can be ∊, and you can remove () by adding a ∘: Try it online!

⌽,¨⊢ -> ⌽,⍪

Pyth, 6 bytes
ec2.i_

Try it online!
Looking through the Pyth documentation reminded me of the interleave function .i, which is extremely useful here.
How it works:

.i: Interleave the following two lists:

_: The reversal of the input (implicit), and

The input (implicit).

c2: Split the result in half.

e: Output the second half.

Pyth, 11 10 bytes
-1 byte thanks to @FryAmTheEggman
L&bay_Pbeb

port of Dominic van Essen's solution to Pyth.
Try it online!
Explanation
L&bay_Pbeb
L              define function named y with argument b which returns
 &b            short circuiting and of b and
   a    eb     the last element of b appended to
    y          the return value of y when called on
     _         the reverse of
      Pb       b without its last element

I don't think you need to include the final y, since defining a function is an acceptable submission type by default. I think the approach in the Haskell answer is shorter when ported: >lQs_C_B.

@FryAmTheEggman, Feel free to post the port of the haskell answer as a seperate answer

Brainfuck, 64 Bytes
,[>,]<[[->>+<<]<[<]>[-<+>]<[->>[>]>+<<[<]<]>>[[-<+>]>]<<]>>>[.>]

Try it online!
,[>,] Read input array into memory
<[[->>+<<] Move last number of input to the right of the input array
<[<]>[-<+>] Move the first number of input to the left the input array
<[->>[>]>+<<[<]<] Move the number left of the input array to the left side of the number(s) to the right of the input array
>>[[-<+>]>]<<] Move the input array to the left to make some space, then repeat
>>>[.>] Print output array

Python 3, 45 bytes
M=lambda a:a and M(a[1:-1])+a[::len(a)-1or 1]

Try it online!
Performs milking in the same procedure as specified.

Brachylog, 10 bytes
Same approach as Dominic van Essen's answer, so upvote that.
Ė|tT&k↔↰,T

Try it online!
Ė|tT&k↔↰,T
Ė          input is an empty list
 |         or
  tT       save the input's last element as T
    &      and
     k     the input without the last element
      ↔    reverse it
       ↰   recursively call this predicate
        ,T and append T

Charcoal, 14 bytes
Ｉ⮌Ｅθ§⎇﹪κ²θ⮌θ⊘κ

Try it online! Link is to verbose version of code. Works by calculating the reverse of the first half of the flattened zip of the reversed list with itself. Explanation:
   θ            Input array
  Ｅ             Map over elements
       κ        Current index
      ﹪ ²       Modulo literal 2
         θ      Input array
     ⎇          If index was odd otherwise
          ⮌     Reverse of
           θ    Input array
    §           Indexed by
             κ  Current index
            ⊘   Halved
 ⮌              Reverse the result
Ｉ               Cast to string
                Implicitly print

That's 14 characters, but it's 35 bytes...

@JesseWilliams Charcoal has a single byte character set for ease of golfing. Each one of these characters maps to one byte, but they have been selected to make reading/writing the code easier (well, hopefully easier, anyway).

@FryAmTheEggman interesting - good to know.

K (oK), 16 15 bytes
Solution:
{(#x)_,/|x,'|x}

Try it online!
Port of Kevin's solution.
Explanation:
{(#x)_,/|x,'|x} / the solution
{             } / lambda taking implicit x
            |x  / reverse x
         x,'    / join each with x
        |       / reverse
      ,/        / flatten
     _          / drop
 (  )           / do this together
  #x            / count x

Extra:

-1 byte thanks to @ngn

It seems that the output has a leading comma when the input contains exactly one element. Is this a TIO thing, perhaps? I notice something similar happens when I remove all but one of the test cases.

' means "each both" so for each "left" and each "right", the left is only 1 long so gets used as the "left" every time. In order to apply f to an empty list you would just do f () which returns () :)

And for a bit more info, the , is used to signify something is a list - but ,1 2 3 would mean a list containing 1 item, the 3-item list 1 2 3.

+(|x;x) -> |x,'|x

C (gcc), 88 71 62 60 59 bytes
Saved 9 bytes thanks to ceilingcat!!!
Saved a byte thanks to G. Sliepen!!!
t;i;f(l,n)int*l;{for(;n>1;l[n]=t)t=*l,wmemcpy(l,l+1,n-=2);}

Try it online!
Inputs a pointer to the array and its length and milks the array in place.
Code actually does the moo-shuffle: tucking the first element away, shifting all but the last down one, and putting the first one just in front of the last.  This is repeated, shifting down 2 elements from the end each time, until there are only two elements left and we're done.

GNU sed (-E), 54 bytes
:l;s/(\w+, )(.* )(\w+.*)\]/\2\]\1\3/;tl;s/\]//;s/$/\]/

This assumes the array is passed over stdin as text in exactly the same format as in the problem statement (in particular, whitespace is important).
Explanation/Example
Let's consider the input [1, 2, 3, 4, 5, 6] and look at the script statement-by-statement.

:l: Create a label called l to branch to later.
s/(\w+, )(.* )(\w+.*)\]/\2\]\1\3/: [1, 2, 3, 4, 5, 6] -> [2, 3, 4, 5, ]1, 6.
tl: did the last s command do something? Yes, so branch to l.
s/(\w+, )(.* )(\w+.*)\]/\2\]\1\3/: [2, 3, 4, 5, ]1, 6 -> [3, 4, ]2, 5, 1, 6.
tl: did the last s command do something? Yes, so branch to l.
s/(\w+, )(.* )(\w+.*)\]/\2\]\1\3/: pattern doesn't match!
tl: did the last s command do something? No, so don't branch.
s/\]//: [3, 4, ]2, 5, 1, 6 -> [3, 4, 2, 5, 1, 6.
s/$/\]/: [3, 4, 2, 5, 1, 6 -> [3, 4, 2, 5, 1, 6].

Note that this works for arrays of text consisting of alphanumeric characters or underscores, not just positive integers.
Try it online!

x86-16 machine code, 21 20 bytes
Binary:
00000000: 8bde 03f1 4e03 f94f fda4 e201 c38a 0743  ....N..O.......C
00000010: aae2 f6c3                                ....

Listing:
8B DE       MOV  BX, SI             ; BX = beginning of input array
03 F1       ADD  SI, CX             ; SI = end of input array
4E          DEC  SI                 ; adjust to last element
03 F9       ADD  DI, CX             ; DI = end of output array
4F          DEC  DI                 ; adjust to last element
FD          STD                     ; set direction flag to descend
        MILKLAST:
A4          MOVSB                   ; write end of input array value to output array
E2 01       LOOP MILKFIRST          ; if not end of array, move first value
C3          RET                     ; otherwise, return to caller
        MILKFIRST:
8A 07       MOV  AL, BYTE PTR[BX]   ; AL = start of input array value
43          INC  BX                 ; increment pointer
AA          STOSB                   ; write to output array
E2 F6       LOOP MILKLAST           ; loop until end of array
C3          RET                     ; return to caller

Callable function, input array in [SI], length in CX. Output array to buffer at [DI].
Tests using DOS DEBUG:

Japt, 6 bytes
Looking through the rest of the solutions after posting this, I feel like I must be missing something.
ÊÆÔvÃÔ

Try it or run all test cases
JavaScript "translation":
U=>[...Array(U.length)].map(_=>U.reverse().shift()).reverse()

ÊÆÔvÃÔ     :Implicit input of array U
Ê          :Length
 Æ         :Map range
  Ô        :  Reverse U
   v       :  Remove and return first element
    Ã      :End map
     Ô     :Reverse

Mapping the original array would be one byte shorter but, as both methods used in the map modify that array, it wouldn't work.

APL+WIN, 40 bytes
Prompts for input of a vector if indices:
(,⊖⍉(2,n)⍴(n↑(-n)↓m),⌽(-n←⌈.5×⍴m)↑m←⎕)~0

Try it online! Courtesy of Dyalog Classic
A simpler approach, 26 bytes
m[(-⍴m)↑,⌽⍉n,[.1]⌽n←⍳⍴m←⎕]

Try it online! Courtesy of Dyalog Classic

JavaScript (ES6), 43 bytes
Using a variant of Dominic van Essen's approach:
f=(a,x=a.pop())=>x?[...f(a.reverse()),x]:[]

Try it online!

JavaScript (ES6),  41  40 bytes
If we can take the length of the array as an extra parameter, the following non-recursive algorithm is shorter:
n=>a=>a.map((_,k)=>a[n+++n%2*(~k-k)>>1])

Try it online!

Husk, 8 bytes
↓L¹Σze↔¹

Try it online!
↓L¹Σze↔¹
    z     Zip
      ↔¹  the list with its reverse
     e    into a list of 2 elements
   Σ      Flatten it
↓         Drop
 L¹       the first n elements

7 bytes using →½ instead of ↓L¹

C# (Visual C# Interactive Compiler), 102 bytes
IEnumerable<int>f(int[]o)=>o.Length==0?new int[0]:o.Length==1?o:f(o[1..^1]).Concat(new[]{o[0],o[^1]});

Try it online!

100 bytes

Wolfram Language (Mathematica), 36 bytes
f@a___:=a
f[a_,b__,c_]:=##&[f@b,a,c]

Try it online!
Boring, but less boring approaches seem to be more verbose. Returns a Sequence containing the deck.

Brachylog, 7 bytes
↔;?zcḍt

Try it online!
Explanation
Same idea as Kevin's 05AB1E answer (the first one). Suppose the input list is [1,2,3,4,5]:
↔        Reverse                      [5,4,3,2,1]
 ;?      Pair with the input again    [[5,4,3,2,1],[1,2,3,4,5]]
   z     Zip                          [[5,1],[4,2],[3,3],[2,4],[1,5]]
    c    Concatenate sublists         [5,1,4,2,3,3,2,4,1,5]
     ḍ   Split into two halves        [[5,1,4,2,3],[3,2,4,1,5]]
      t  Take the second half         [3,2,4,1,5]

Clojure, 40 bytes
#(drop(count %)(mapcat vector(rseq %)%))

Try it online!

Keg, 34 bytes
÷(!½;|")!2%[!1>[$]. ,]{!|$(2|. ,)'

Try it online!
+5 due to bug fix

If we're allowed to output the list in reverse, it's just going to be 5 bytes... (Without separator)

@ThirdParty'chef' I figured that much. Hopefully, it is allowable.

It seems that this fails when the input contains exactly 1 element?

@Dingus fixed. It was because it was trying to swap the top two items when there was only one item.

Io, 53 bytes
Port of @Neil's Charcoal answer.
method(x,x map(i,v,x at(if(i%2>0,i,-i-1)>>1))reverse)

Try it online!
Io, 68 bytes
Port of @DominicvanEssen's answer.
f :=method(x,if(x size>0,list(x pop,f(x reverse))reverse flatten,x))

Try it online!

Do you have no "bitwise not" operator for -i-1?

@Neil Io doesn't have bitwise not. Try it online!

Scala 3, 46 45 bytes
It appears @cole already had the same answer in Haskell, so you should upvote that.
| =>(|reverse)zip|flatMap(Seq(_,_))drop|.size

Please forgive the name |. I did it to save a byte.
Try it online
Scala 2, 57 55 54 51 bytes
| =>(|reverse,|).zipped.flatMap(Seq(_,_))drop|.size

Same thing, but needed the parameter to be a single tuple instead of having 2 parameters.
Try it online
Ungolfed:
s => s.reverse.zip(s).flatMap{ case(a,b) => List(a,b) }.drop(s.size)

And a recursive solution, just because (71 bytes):
def*(l:List[Int]):List[Int]=if(l.size<2)l else*(l.init.reverse):+l.last

Try it online

Dyalog APL, 28 bytes
{⍵≡⍬:⍬⋄0~⍨(∇¯1↓1↓⍵),¯2↑1⌽⌽⍵}

Try it online!

J, 15 bytes
#}.],/@|:@,:~|.

Try it online!
Port of Kevin Cruijssen's 05AB1E answer and streetster's K solution - don't forget to upvote them!

10 bytes.

Ruby, 38 37 bytes 34 bytes
f=->x{(b=x.pop)?f[x.reverse]<<b:x}

Try it online!
-3 bytes thanks to @Dingus
Uses Dominic van Essen's approach: repeatedly takes the bottom card and recurses on the reverse of the rest of the deck.

reverse is a long word. Is there any golfing alternative?

T-SQL, 46 bytes
Input is a table variable
DECLARE @ table(v int,i int identity(1,2))
INSERT @ values(1),(2),(3),(4),(5),(6)

SELECT v
FROM @
ORDER BY abs(sum(1)over()-i),i

Try it online

Jelly, 7 bytes
ṖṚ$ƬZṪ€

A monadic Link accepting a list which yields the shuffled list.
Try it online!
How?
ṖṚ$ƬZṪ€ - Link: list, A
   Ƭ    - apply & collect while different - i.e. [A, f(A), f(f(A)), ..., []]
  $     -   last two links as a dyad:
Ṗ       -     remove the rightmost item
 Ṛ      -     reverse
    Z   - transpose the (ragged) result
     Ṫ€ - last item of each

A couple of alternative approaches which are longer:

sort the indices by their absolute difference from the centre and
index back into the list: JạÞL‘HƊị
use the beauty of the factorial number system and its relation to the sort order of permutations: J’:2ṚÆ¡‘œ?

A few more 7 byters

@cairdcoinheringaahing Nice, here's another along the same track.

Vyxal, 7 bytes
(Ṙḣ)WṘ'

Try it Online!

@Dingus Sorry, got mixed up, fixing

Red, 60 bytes
func[b][reverse collect[while[[]<> b][keep take reverse b]]]

Try it online!
Inspired by  Dominic van Essen's R solution

Japt -Q -m, 17 16 bytes
[UoUÊ/2 ,U]Õcf w

Try it
[UoUÊ/2            take the last half elements( reversed )
        ,U]        and the remaining
           Õ       transpose
            cf      flatten after removing null
               w   reverse

Flags used for pretty output

Thunno 2 t, 5 bytes
r$I2Ẇ

Try it online!
Explanation
r$I2Ẇ  # Implicit input
r      # Reverse the input
 $     # Push the input again
  I    # Interleave them
   2Ẇ  # Split into two
       # Leave only the last part
       # Implicit output


text:
Verify a Superpermutation
A superpermutation on n symbols is a string which contains every permutation of n symbols in its body. For instance, 123121321 is a superpermutation on three symbols because it contains 123, 132, 213, 231, 312 and 321 as substrings.
The Challenge
Given a string composed of n unique symbols (and, optionally, n), output whether it is a superpermutation on n symbols.
Rules

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

Assume only valid input will be given.

Assume n is greater than 0

Input and output can assume whatever form is most convenient, e.g. the series of symbols can be a string, a list, an integer, a set of n bitmasks, etc, so long as it is indicated in the answer. Additionally, anything may be used as a symbol provided it is distinct from all the other symbols.

Test Cases
In: 1234
Out: False

In: 1
Out: True

In: 11
Out: True

In: 123121321
Out: True

In: 12312131
Out: False

See also: this question about generating superpermutations

Is $n$ always equal to the unique amount of digits? If yes, do we even need input $n$? If no, could you add a test case for this?

You are correct, I will edit this quickly before there are too many responses @KevinCruijssen

I would make the input $n$ optional, since the Japt and APL answer are already using the input $n$.

Good idea @KevinCruijssen

This is probably asking for too much, but may we take the list/set of unique symbols as input?

Imaginary bonus for answers that takes polynomial time in the input...

It's probably too late for that now, sorry @cole

@golf69 no problem, I don’t think it would’ve helped my answer anyway.

do we need to consider n=0?

No, and I will edit to clarify @att

are "unique symbols" number-only or possibly other ones too?

Whatever is most convenient may be used as a symbol @NooneAtAll

05AB1E, 4 bytes
ÙœåP

Only takes input \$J\$ (I don't need \$n\$ with this approach).
Try it online or verify all test cases.
Explanation:
Ù     # Uniquify the digits of (implicit) input-integer
 œ    # Get all permutations of this uniquified integer
  å   # Check for each if it's a substring of the (implicit) input-integer
   P  # And check if this is truthy for all of them
      # (after which the result is output implicitly)

APL (Dyalog Unicode), 20 bytes
{(!⍺)=+/⍺=⍴∘∪¨∪⍺,/⍵}

Try it online!
Takes n on the left and J on the right
How?
⍺,/⍵   ⍝ Overlapping sublists of length n in J
∪      ⍝ Unique sublists
⍴∘∪¨   ⍝ Length of the unique elements of each unique sublist
+/⍺=   ⍝ How many are equal to n?
(!⍺)=  ⍝ Is this equal to the number of permutations of n symbols?

You should be aware: n is now optional (though your answer is still valid)

You can use ∪/ instead of ∪¨,/, giving 18 bytes dfn and 16 bytes tacit (tacit is 18.0 only): Try it online!

Python 3, 79 bytes
lambda s:all(''.join(p)in s for p in permutations({*s}))
from itertools import*

Try it online!

Python 2, 81 bytes
lambda s:all(''.join(p)in s for p in permutations(set(s)))
from itertools import*

Try it online!

JavaScript (ES6),  83 82  81 bytes
Returns 0 if the input string is a superpermutation, or 1 if it's not.
f=(s,a=[...new Set(s)],p)=>!s.match(p)|a.some((c,n)=>f(s,a.filter(_=>n--),[p]+c))

Try it online!
How?
If all permutations of the \$N\$ symbols are present in the input string \$s\$, so are all prefixes of said permutations. Therefore, it's safe to test that all \$p\$ are found in \$s\$ even when \$p\$ is an incomplete permutation whose size is less than \$N\$.
That's why we can use a function that recursively builds each permutation \$p\$ of the symbols and tests whether \$p\$ exists in \$s\$ at each iteration, even when \$p\$ is still incomplete.
Commented
f = (                     // f is a recursive function taking:
  s,                      //   s = input string
  a = [...new Set(s)],    //   a[] = list of unique characters in s
  p                       //   p = current permutation, initially undefined
) =>                      //
  !s.match(p) |           // force the result to 1 if p is not found in s
                          // NB: s.match(undefined) is truthy because it's equivalent
                          //     to looking for an empty string in s
  a.some((c, n) =>        // for each character c at position n in a[]:
    f(                    //   do a recursive call:
      s,                  //     pass s unchanged
      a.filter(_ => n--), //     remove the n-th character in a[] (0-indexed)
      [p] + c             //     coerce p to a string and append c to p
    )                     //   end of recursive call
  )                       // end of some()

Possible 80 bytes? Passes the test cases, at least.

@Shaggy That would not generate all permutations and report many false-positive such as "1232131".

Thought it might have been too good to be true. Discovered far too many false positives meself while working on my own solution. We could do with a few more test cases covering more edge cases.

Japt v2.0a0, 10 8 bytes
Saved 2 bytes with the clarification that the string can only contain the digits in [1,n].
â á e!øU

Try it
â á e!øU     :Implicit input of string U
â            :Deduplicate
  á          :Permutations
    e        :All
     !øU     :  Contained in U

You should be aware: n is now optional (though your answer is still valid)

Io, 104 bytes
method(x,n,K :=Range 1 to(n)asList;x map(i,v,x slice(i,i+n))unique select(x,x sort==K)size==K reduce(*))

Try it online!
Explanation (Ungolfed)
method(x,n,                        // Take the string and the num of uniquified integers
    K := Range 1 to(n)asList       // K = [1..n]
    x map(i,v,x slice(i,i+n))      // All slices of x of length n
    unique                         // Uniquify these slices
    select(x,                      // Filter: (x : current item)
        x sort==K                  //     sort(x) == [1..n]?
    ) size                         // Number of items that satisfy this
    == K reduce(*)                 // == factorial(n)?
)

You are answering a lot with Io recently. Care to create another Increment room?

@HighlyRadioactive Io is a simple, concise, and fun langauge. You should really try it! (The Increment is created btw.)

I don't have time to try it LOL. I'm busy with 1+ minimalization. I'll post more in the Increment room and you should really join it.

Wolfram Language (Mathematica), 44 bytes
Union[##~Partition~1]~Count~{a__/;0!=a}<#2!&

Try it online!
Takes a list of characters and \$n\$ as input. Returns False if the string is a superpermutation, and True otherwise.
Verifies that the number of unique sequences of \$n\$ distinct characters is (un)equal to \$n!\$.

Brachylog, 7 bytes
dpᶠ~sᵛ?

Same algorithm as @Kevin Cruijssen, so upvote that.
Try it online!
How it works
dpᶠ~sᵛ?
d       deduplicate input
 pᶠ     find all permutations
   ~sᵛ  all of them must be substrings of
      ? the input

R + gtools, 79 bytes
function(x,n)all(sapply(apply(permutations(n,n),1,paste0,collapse=""),grepl,x))

Try it online!
An example of some awfully-verbose names for R functions and mandatory arguments!
Generates all permutations of digits 1..n, pastes them together as strings, and checks that all are present in the input string.
An alternative 66 byte solution using the R "combinat" library would be: function(x,n,`[`=sapply)all(permn(n)[paste0,collapse=""][grepl,x]),
but unfortunately this library isn't installed on TIO.

If an interpreter exists with that library installed then your 66 byte solution should be valid.

Haskell, 57 bytes
import Data.List
s p=all(`isInfixOf`p)$permutations$nub$p

Try it online!

Wolfram Language (Mathematica), 44 bytes
Subsequences@#~SubsetQ~Permutations@Union@#&

Try it online!
@att saved 31 bytes

44 bytes

Jelly, 5 bytes
Œ!ẇ€Ạ

A dyadic Link accepting \$n\$ on the left and the candidate as a list of integers on the right which yields 1 (is) or 0 (is not) as appropriate.
Try it online!
How?
Œ!ẇ€Ạ - Link: n, L
Œ!    - all permutations of [1..n]
   €  - for each (permutation, p):
  ẇ   -   is (p) a sublist of (L)?
    Ạ - all?

Scala -deprecation -encoding=UTF-8 -feature -unchecked -language:postfixOps -language:implicitConversions -language:higherKinds -language:existentials -language:postfixOps -Xfuture -Yno-adapted-args -Ywarn-dead-code -Ywarn-numeric-widen -Ywarn-value-discard -Ywarn-unused, 44 bytes
s=>s.distinct.permutations forall s.contains

Pretty straightforward. Finds all the distinct symbols, generates all their permutations, and then checks if each permutation is in the input string.
Try it online
Scala, 56 54 bytes
(s,>)=>(1 to>).mkString.permutations forall s.contains

As you can tell, the superpermutation string is | s(lot less readable now) and n is >. It basically just generates every permutation in the range 1 to n and checks if each of those are in the input string.
Try it online!

Husk, 5 bytes
Λ€¹Pu

Try it online!
Same as the Jelly answer.

Pyth, 10 bytes
.Am}dz.p{z

Try it online!

Explanation:
.Am}dz.p{z
        {z  Deduplicate, yielding the distinct digits
      .p    Permutate
  m         Map with d as variable
   }dz      Check if d is a substring of z
.A          Verify that all elements are truthy

Charcoal, 35 bytes
Ｎθ⁼ΠＥθ⊕ιＬΦＥη✂ηκ⁺κθ¹∧⁼κ⌕ηι⁼θＬΦι⁼μ⌕ιλ

Try it online! Link is to verbose version of code. Outputs a Charcoal boolean, i.e. - for a superpermutation, nothing if not. Explanation:
Ｎθ

Input n as a number.
⁼ΠＥθ⊕ι

n! must equal...
ＬΦＥη✂ηκ⁺κθ¹

... the number of truncated suffixes of the string...
∧⁼κ⌕ηι

... that have not already been seen earlier in the string, and...
⁼θＬΦι⁼μ⌕ιλ

... contain n distinct characters.

Vyxal, 9 bytes
UṖƛ∑⁰$c;A

Try it Online!
A mess.

Ruby -nl, 44 bytes
p$_.chars.uniq.permutation.all?{|x|$_[x*'']}

Try it online!

T-SQL, 186 bytes
Returns 1 for true, 0 for false.
This struggles with more than 6 unique characters
WITH B as(SELECT distinct substring(@,number,1)a FROM spt_values),C
as(SELECT a y FROM b UNION ALL SELECT y+a FROM B,C
WHERE y like'%'+a+'%')SELECT 1/sum(1)FROM C WHERE replace(@,y,'')=@

Try it online ungolfed

Java 10, 291 287 233 229 bytes
n->{var t="";for(var d:n.split(t))t+=t.contains(d)?"":d;return p(n,"",t);}boolean p(String n,String p,String s){int l=s.length(),i=0;var r=n.contains(p);for(;i<l;)r&=p(n,p+s.charAt(i),s.substring(0,i)+s.substring(++i));return r;}

-4 bytes by taking inspiration from what @Arnauld mentioned in his JavaScript answer:

If all permutations of the \$N\$ symbols are present in the input string \$s\$, so are all prefixes of said permutations. Therefore, it's safe to test that all \$p\$ are found in \$s\$ even when \$p\$ is an incomplete permutation whose size is less than \$N\$.
That's why we can use a recursive function that recursively builds each permutation \$p\$ of the symbols and tests whether \$p\$ exists in \$s\$ at each iteration, even when \$p\$ is still incomplete.

Takes the integer-input as String.
Try it online.
Explanation:
n->{                    // Method with String as parameter and boolean return-type
  var t="";             //  Temp String, starting empty
  for(var d:n.split(t)) //  Loop over the digits of the input:
    t+=                 //   Append to String `t`:
       t.contains(d)?   //    If `t` contains this digit already:
        ""              //     Append nothing
       :                //    Else (it doesn't contain this digit yet):
        d;              //     Append this digit
  return p(n,"",t);}    //  Call the separated recursive method to check if each
                        //  permutation of `t` is a substring of `n` and return it as

// Separated recursive method to get all permutations of String `t`, and check for each
// if it's a substring of String `n`
boolean p(String n,String p,String s){
  int l=s.length(),    //  Get the length of the input-String `s`
      i=0;             //  Set the index `i` to 0
  var r=               //  Result-boolean, starting at:
        n.contains(p); //   Check that String `n` contains part `p` as substring instead
                       //   (this doesn't necessary have to be the full permutation,
                       //    but it doesn't matter if the part is smaller)
  for(;i<l;)           //  Loop `i` in the range [0, length):
    r&=                //   Add the following to the boolean-return (bitwise-AND style):
      p(               //    Do a recursive call with:
        n,p            //     The current part,
          +s.charAt(i),//     appended with the `i`'th character as new part
          s.substring(0,i)+s.substring(++i));
                       //     And the String minus this `i`'th character as new String
                       //     (and increment `i` for the next iteration in the process)
  return r;}           //  And return the resulting boolean

source: Stack Exchange

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

sort: votes


text:
The ASCII character countdown!
Since this is a answer-chaining challenge, you might want to sort answers by oldest.

Your task is simple: Choose any printable ASCII character that's not chosen in the previous answers. And then, you need to print your chosen character in your program to standard output. (You can ONLY print your chosen character, without printing other garbage to STDOUT)
The catch
Let's say you picked x as your chosen character, and your answer is the answer numbered y. You have to insert y x's into the previous source code, at any position you like. For the first answer, the previous answer is the empty program.
An example
Answers have to start with the number 1. So for example, I chose the character #, and I posted a 1 byte answer in /// that prints the # mark.
#

And then, the second answer (numbered 2) has to insert 2 of their picked x character into the previous source code, such that the modified code will print their x character. So assume this is written in Keg:
x#x

And then, the third answer has to do the same, and so on, until 95 is reached.
Answer format
I'd love to see an explanation of your code as well, preferably with an online interpreter link!
# [{Language name}]({link-to-language}), {code-length} bytes

\$y= {The number of your answer}\$. Used so far: <code>{Characters used in answers so far}</code>

    {your code}

The winning criterion & other rules

The first user whose answer stays without a succeeding answer for a month wins the challenge. If that's not satisfied, the first person who reaches the number 95 wins the challenge.
You are not allowed to put any other character in your code other than printable ASCII characters.
You need to wait 2 answers before you post a new answer after your submission.
Please make sure your answer is valid. If yours is not valid, chaining answers aren't allowed to be posted.
You can answer in a language that is used in previous answers.
You could only insert y x's into the source code.
Your are not allowed to take input.
Your program can output to STDERR, as long as the output to STDOUT is as intended.

I suggest adding a requirement to add the text "$y=$ Used so far: " below the standard header (I added this to the first answer to get it going).

Can we output using our favourite language's natural output format?  For R, this would be a variable containing the particular ASCII character.

@DominicvanEssen You have to output through STDOUT, unless you mention an I/O default in which setting variables is acceptable.

I posted an answer but I deleted 'cause I'm not sure it fits. The source code of the answer can only contain the previous chosen characters? e.g. I can only post print('a') if the characters p,r,i,n,t,(,',) were already chosen?

@yyyyyyyan It's stricter than that: see the very last rule. You're only allowed to insert one unique character, $y$ times. You can't rearrange any characters from the previous answers.

@Third-party'Chef' The current answers in 05AB1E, 2sable, and R all output a trailing newline. Also, I don't see how this is [tag:kolmogorov-complexity]? There's no fixed string or dataset to compress.

Does the program have to exit cleanly?  Or can it have an incidental error while producing the correct output?

Can we also output to stderr, if the only stdout is our character?

@AdHocGarfHunter You can output to STDERR, as long as the output to STDOUT is correct.

2sable, 36 bytes
//9#999999//,#,#,221'/,#q',#q,qq2///

\$y=8\$. Used so far: 1'2q#,9/
Try it online.
Maybe this opens up some other languages that use // to comment. :)
Explanation:
2sable is an old version of 05AB1E (legacy) (which of itself is an old version of 05AB1E).
The legacy version outputs a leading newline however: try it online.
And the latest 05AB1E version outputs three leading newline: try it online.
//                                    # Divide twice, no-ops with an empty stack
  9                                   # Push 9
   #                                  # Pop and split it by spaces
                                      # (since it contains no spaces, it only pops)
    999999                            # Push 999999
          /                           # Divide the empty stack by this, popping the integer
           /                          # No-op divide again with an empty stack
            ,                         # No-op print (which would output a newline in the
                                      # newer versions)
             #,#,                     # Some more no-ops
                 221                  # Push 221
                    '/               '# Push "/"
                      ,               # Pop and print this "/" to STDOUT
                       #              # Split the 221 on spaces, so it just pops
                        q             # Exit the program
                         ',#q,qq2/// '# No-ops

But he waited 2 answers. He answered 5 and now 8.

@yyyyyyyan thanks, apparently counting from 5 to 8 is too much for me. I probably need to leave the counting to my two-year-old.

@Giuseppe yyyyyyyan is indeed correct, there are 2 answers in between. I actually already have a plan to add some more answers (if the two characters I need are still available by then) for when it's my turn again. ;) Although I'm going on vacation starting tomorrow for a week, and I'm not sure I have wifi (or whether I'm in the mood for codegolf) over there, so I doubt I'm able to add the two I had planned.

Polyglot, 3 bytes
1''

\$y=2\$. Used thus far: 1'.
This works in a bunch of stack-based languages, which basically all do the following:
1    # Push a 1 to the stack
 ''  # Push the string "'" to the stack
     # (output the top of the stack implicitly as result)

Try it online in ,,,.
Try it online in 05AB1E.
Try it online in Japt.
etc.

 Tip: Using a similar stack-based language, it's easy to insert almost any character by interleaving.

It's possible?!

05AB1E, 10 bytes
\$y=4\$. Used so far: 1'2q
221'q'qqq2

Try it online!
221         # push 221 to the stack
   'q'q     # push character q (twice for good measure)
       q    # quit; implicitly print top-of-stack q
        q2  # no-ops

Befunge-98, 45 bytes
\$y=9\$. Used so far: 1'2q#,9/j
//9#999999//j,#,#,221'j/,#qjjjjj'j,#jq,qq2///

Try it online!
Explanation
Mainly (ab)uses j to skip sections we don't want to execute.
//                                              # Divide twice (no-ops, as 0/0 is 0 in Befunge-98)
  9                                             # Push 9
   #9                                           # No-op (skipped by #)
     99999                                      # Push more 9s
          /                                     # Divide, results in 9/9 = 1
           /                                    # Divide, results in 9/1 = 9
            j                                   # Jump forward 9 instructions
             ,#,#,221'                          # (not executed)
                      j                         # Jump forward 9 instructions
                       /,#qjjjjj                # (not executed)
                                'j              # Push the character 'j'
                                  ,             # Print the character
                                   #j           # No-op
                                     q          # Quit program
                                      ,qq2///   # (not executed)

Trigger, 55 bytes
\$y=10\$. Used so far: 1'2q#,9/j\
\//9#9\99999//j,\\\#,#,221'j/\,#\\qjjjjj'j,#\jq,qq2/\//

Try it online!
This took a lot longer than I'm willing to admit...

explanation is in the works... (I'll finish it in the morning)

05AB1E, 15 bytes
###221'#q'#qqq2

\$y=5\$. Used thus far: 1'2q#
Try it online.
Maybe this opens up some other languages that use # to comment. :)
Explanation:
###              # Split by spaces three times (no-ops without input)
   221           # Push integer 221
      '#        '# Push character "#"
        q        # Stop the program
                 # (after which the top of the stack is output implicitly as result)
         '#qqq2 '# No-ops

Thank-you from one of the '# to comment' language-users!

@DominicvanEssen You're welcome. :)

Befunge-98, 21 bytes
#,#,#,221',#q',#q,qq2

\$y=6\$. Used so far: 1'2q#,
Try it online!

#                         # Skip the next instruction
 ,                        # (skipped)
  #,                      # (skipped)
    #,                    # (skipped)
      221                 # Push 2, 2, 1 onto the stack
         ',               # Push character ','
           #q             # (skipped by #)
             ',           # Push character ','
               #q         # (skipped)
                 ,        # Output character
                  q       # Quit program
                   q2     # (not executed)

Befunge-98 (FBBI), 66 bytes
\$y=11\$. Used so far: 1'2q#,9/j\;
;\//9#9\99999//j,\\\#,#,221;';;j/\;,;#\\;qjjjjj'j,#\jq,qq2/\//;;;;

Try it online!
; is the comment character in Befunge, and this program works by running ';,q with inapplicable parts commented out. Doesn't work in Pyfunge for reasons I can't figure out.

Befunge-98, 253 bytes
\$y=22\$. Used so far: 1'2q#,9/j\;0"35s46%7*x
*7%7*77%*7*77%666666%x*77*7%*7*77%6*666666666655555555555555444444%***4%44*4*444444xxxx"033333%33333333s;s\/s/90*%35*s46#"9\s99%%9%90s9/"/j0s,\"\*0\"#s,#,22s01;"*'s"*;0;j/x\xxxx"s;xxx,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q2/"\%s//s;0;%;;0"s77*77777xxxxxx

Try it online!
After running the part before the first x, the top of the stack is 6 0 (from the code 666%). Thus, the x instruction sets the program delta to (6, 0), meaning that the instruction pointer moves right 6 spaces every step. This skips over most of the remaining instructions, leaving %%66554*44"33s0s\9/,\,;*x",\q0'j0%0"7x to be executed. %%66544*44 does some stack manipulation, "33s0s\9/,\,;*x" pushes the string x*;,\,/9\s0s33, and , prints the first character of that string, which is x. Finally, \ swaps the top two elements of the stack (which we don't care about) and q ends the program.

R, 28 bytes
9#999999,#,#,221',#q',#q,qq2

\$y=7\$. Used so far: 1'2q#,9
Try it online!
Based on a combination of functions may output via their return values and the fact that R functions naturally output their return values to STDOUT (albeit with some prepended characters to indicate index of the outputed value), I hope that this is Ok.
Explanation:
9               # integer value 9; output by default
 #              # comment character; everything after this (on the same line) is ignored
  999999,#,#,221',#q',#q,qq2
                # not run

Big thank-you to Kevin Cruijssen for putting the # character at the beginning of answer #5, which (as he suspected) was critical to make this answer work!

Keg, -hr, 78 bytes
\$y=12\$. Used so far: 1'2q#,9/j\;0
0;\//90#9\999909//j0,\\0\#,#,2201;';0;j/\;,0;#\\;qjj0jjj'j,#\jq,q0q2/\//;0;;;0

Try it online!
And this kids, is why we use languages where single digits auto push! This pushes a whole bunch of stuff, a 0, then prints the t.o.s using the -hr flag.

Trigger, 190 bytes
\$y=19\$. Used so far: 1'2q#,9/j\;0"35s46%
%%%666666%%%6666666666655555555555555444444%4%444444444"033333%33333333s;s\/s/90%35s46#"9\s99%%9%90s9/"/j0s,\"\0\"#s,#,22s01;"'s";0;j/\"s;,0;%#\"\;qsjj"0j%%jj'j,#\"j%qs,q0q2/"\%s//s;0;%;;0"s

Try it online!
Here's hoping using % makes a lot of languages a lot harder to use

% is no issue for me.  However starting your answer with 3 of the same character is.

Trigger, 276 bytes
\$y=23\$. Used so far: 1'2q#,9/j\;0"35s46%7*x@
@@@*@@@@@@@@7%7*77%*7*77%666666%@x*77*7%*7*7@7%6*@666666666655555555555555444444%*@**4%44*4*444444xx@xx"033333%33333333s;s\/s@/90*%35*s46#"9\s99%%9%90s9/"/j0s,\"\*0\"#s,#,22s01;"*'s"*;0;j/@x\xxxx"s;x@xx,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q2/"\%s@//s;0;%;;0"s77*77777@xxxxxx@@

Try it online!
Hopefully @ makes even more languages harder to use.... looking at you Befunge-98

Trigger, 351 bytes
\$y=26\$. Used so far: 1'2q#,9/j\;0"35s46%7*x@f8.
...ffffffffff.ffffffffffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%666666%@x*78.8.87*7%*7*.7@7%6*@66666666.6655555555555555444444%*@**4%44*4*444444xx@xx".033333%33333333s;s\/s@/90*%35*s46#".9\s99%%9%90s9/"/j0s,.\"\*0\"#s,#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@//s;0;%;;0"s.77*7.7777@xxxxxx@@..

Try it online!
We're out of digits now, that should make things a little more interesting. I think we've made every language other than Trigger unusable at this point...

///, 1 byte
\$y=1\$ Used so far: 1
1

Try it online!
Just to start things off.
Explanation:
1     # since this isn't a / or \, the character is simply printed and removed.
      # no characters left so the program terminates.

Japt, 6 bytes
\$y=3\$ Used so far: 1'2
221''2

Test it
Explanation
The code is transpiled to 221, "'", 2 and Japt only implicitly prints the last expression so outputs 2

HTML, 630 bytes
\$y = 35\$, Used so far: 1'2q#,9/j;0"35s46%7*x@f8.a`&Hb=cd<

<<dddcccccccccccccccccccccccccccccdc==d=b=b=b=`HH&&&a&&a&a&&.&&&&&&&&&&&&&&&&&&&&&aaaaaaaaaaaaaaaaaaaaaaaa..ffffffffff.ffffffffffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%666666%@x*78.8.87*7%*7*.7@7%6*@66666666.66555555b55HHbHHHHHHHHHHHHHHHHHHHHHHHHHH555555444444%*@**4%44*4*444444xx@xx".==033333%33333333s;s\/s@/90*%35*s46#".9\s99%%9%90s9/"/j0s,.`\`ccdc"`\*0\"#s,`#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@//s;0;%;;0"s.77*7.========================7777@xxxxxx@@..```````````````````````bbbbbbbbbbbbbbbbbbbbbbbbbbdddddddddddddddddddddddddddd<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Save as index.html and run with w3m -dump index.html, so it goes to stdout as expected.
<dd.... is an un-closed html tag, which rendered into nothing. So the first < character rendered as HTML content.
w3m is an old school browser which use text I/O to render HTML. As this question is requiring stdout output. I'm also surprised that w3m may successfully parse and render such a malformed HTML.

Keg, -hr, 105 bytes
\$y=14\$. Used so far: 1'2q#,9/j\;0"3
"03333333333333;\//903#"9\999909/"/j0,\"\0\"#,#,2201;"'";0;j/\";,0;#\"\;qjj"0jjj'j,#\"jq,q0q2/"\//;0;;;0"

Try it online! or Check it!

Trigger, 231 bytes
\$y=21\$. Used so far: 1'2q#,9/j\;0"35s46%7*
*7%7*77%*7*77%666666%*77*7%*7*77%6*666666666655555555555555444444%***4%44*4*444444"033333%33333333s;s\/s/90*%35*s46#"9\s99%%9%90s9/"/j0s,\"\*0\"#s,#,22s01;"*'s"*;0;j/\"s;,0;%#\"\;qsj*j"0j%%jj'j,#\"j%qs,q0q2/"\%s//s;0;%;;0"s77*77777

Try it online!
This language is really weird. I got this working by pure luck after about an hour

Keg, -hr, 325 bytes
\$y=25\$. Used so far: 1'2q#,9/j\;0"35s46%7*x@f8
ffffffffffffffffffffffff888888888888888888888@@@*@@@@@@@@7%7*77%*7*77%666666%@x*78887*7%*7*7@7%6*@666666666655555555555555444444%*@**4%44*4*444444xx@xx"033333%33333333s;s\/s@/90*%35*s46#"9\s99%%9%90s9/"/j0s,\"\*0\"#s,#,22s01;"*'s"*;0;j/@x\xxxx"s;x@xx,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@//s;0;%;;0"s77*77777@xxxxxx@@

Try it online!
(no explanation because I have no idea how Keg works)

Stax, 91 bytes
\$y=13\$. Used so far: 1'2q#,9/j\;0"
"0;\//90#"9\999909/"/j0,\"\0\"#,#,2201;"'";0;j/\";,0;#\"\;qjj"0jjj'j,#\"jq,q0q2/"\//;0;;;0"

Try it online!
I know that OPs aren't intended to answer their own questions, but after seeing that nobody has the enthusiasm to add the quote character...

Stax, 136 bytes
\$y = 16\$, Used so far: 1'2q#,9/j\;0"35s
55555555555555"03333333333333s;s\/s/9035s#"9\s99990s9/"/j0s,\"\0\"#s,#,22s01;"'s";0;j/\"s;,0;#\"\;qsjj"0jjj'j,#\"jqs,q0q2/"\s//s;0;;;0"s

Try it online!

Keg -hr, 153 bytes
\$y = 17\$, Used so far: 1'2q#,9/j\;0"35s4
555555555555554444444444444444"03333333333333s;s\/s/9035s4#"9\s99990s9/"/j0s,\"\0\"#s,#,22s01;"'s";0;j/\"s;,0;#\"\;qsjj"0jjj'j,#\"jqs,q0q2/"\s//s;0;;;0"s

Try it online!

Keg, - hr, 171 bytes
\$y=18\$. Used so far: 1'2q#,9/j\;0"35s46

66666666666666666555555555555554444444444444444"03333333333333s;s\/s/9035s46#"9\s99990s9/"/j0s,\"\0\"#s,#,22s01;"'s";0;j/\"s;,0;#\"\;qsjj"0jjj'j,#\"jqs,q0q2/"\s//s;0;;;0"s

Try it online!

Octave, 210 bytes
\$y=20\$. Used so far: 1'2q#,9/j\;0"35s46%7
7%777%777%666666%777%777%6666666666655555555555555444444%4%444444444"033333%33333333s;s\/s/90%35s46#"9\s99%%9%90s9/"/j0s,\"\0\"#s,#,22s01;"'s";0;j/\"s;,0;%#\"\;qsjj"0j%%jj'j,#\"j%qs,q0q2/"\%s//s;0;%;;0"s7777777

Try it online!
Except for MATLAB/Octave, you mean?

Trigger, 528 bytes
\$y=32\$, Used so far: 1'2q#,9/j;0"35s46%7*x@f8.a`&Hb=
===b=b=b=`HH&&&a&&a&a&&.&&&&&&&&&&&&&&&&&&&&&aaaaaaaaaaaaaaaaaaaaaaaa..ffffffffff.ffffffffffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%666666%@x*78.8.87*7%*7*.7@7%6*@66666666.66555555b55HHbHHHHHHHHHHHHHHHHHHHHHHHHHH555555444444%*@**4%44*4*444444xx@xx".==033333%33333333s;s\/s@/90*%35*s46#".9\s99%%9%90s9/"/j0s,.`\`"`\*0\"#s,`#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@//s;0;%;;0"s.77*7.========================7777@xxxxxx@@..```````````````````````bbbbbbbbbbbbbbbbbbbbbbbbbb

Try it online!

Keg, -hd,  300 bytes
\$y=24\$ Used so far: 1'2q#,9/j\;0"35s46%7*x@f

ffffffffffffffffffffffff@@@*@@@@@@@@7%7*77%*7*77%666666%@x*77*7%*7*7@7%6*@666666666655555555555555444444%*@**4%44*4*444444xx@xx"033333%33333333s;s\/s@/90*%35*s46#"9\s99%%9%90s9/"/j0s,\"\*0\"#s,#,22s01;"*'s"*;0;j/@x\xxxx"s;x@xx,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q2/"\%s@//s;0;%;;0"s77*77777@xxxxxx@@

Try it online!
Harder? It actually made it easier. @ starts a function in Keg, and because there aren't any closing ƒs (and there won't be because it ain't ascii), everything after the first @ is ignored. What a clanger!

Trigger, 378 bytes
\$y = 27\$, Used so far: 1'2q#,9/j\;0"35s46%7*x@f8.a
aaa.aaaaaaaaaaaaaaaaaaaaaaaa..ffffffffff.ffffffffffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%666666%@x*78.8.87*7%*7*.7@7%6*@66666666.6655555555555555444444%*@**4%44*4*444444xx@xx".033333%33333333s;s\/s@/90*%35*s46#".9\s99%%9%90s9/"/j0s,.\"\*0\"#s,#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@//s;0;%;;0"s.77*7.7777@xxxxxx@@..

Try it online!

Keg, -rn, 406 bytes
\$y=28\$, 1'2q#,9/j;0"35s46%7*x@f8.a`

`aaa.aaaaaaaaaaaaaaaaaaaaaaaa..ffffffffff.ffffffffffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%666666%@x*78.8.87*7%*7*.7@7%6*@66666666.6655555555555555444444%*@**4%44*4*444444xx@xx".033333%33333333s;s\/s@/90*%35*s46#".9\s99%%9%90s9/"/j0s,.`\`"`\*0\"#s,`#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@//s;0;%;;0"s.77*7.7777@xxxxxx@@..```````````````````````

Try it online!
Hehe. I used the power of strings to essentially make those .s nops.

Gol><>, 465 bytes
\$y=30\$, Used so far: 1'2q#,9/j;0"35s46%7*x@f8.a`&H
`HH&&&a&&a&a&&.&&&&&&&&&&&&&&&&&&&&&aaaaaaaaaaaaaaaaaaaaaaaa..ffffffffff.ffffffffffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%666666%@x*78.8.87*7%*7*.7@7%6*@66666666.6655555555HHHHHHHHHHHHHHHHHHHHHHHHHHHH555555444444%*@**4%44*4*444444xx@xx".033333%33333333s;s\/s@/90*%35*s46#".9\s99%%9%90s9/"/j0s,.`\`"`\*0\"#s,`#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@//s;0;%;;0"s.77*7.7777@xxxxxx@@..```````````````````````

Try it online!
Explanation
`   Push codepoint of next character:
 H  'H'
  H Halt, printing TOS as a character

Trigger, 496 bytes
\$y=31\$, Used so far: 1'2q#,9/j;0"35s46%7*x@f8.a`&Hb
bbb`HH&&&a&&a&a&&.&&&&&&&&&&&&&&&&&&&&&aaaaaaaaaaaaaaaaaaaaaaaa..ffffffffff.ffffffffffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%666666%@x*78.8.87*7%*7*.7@7%6*@66666666.66555555b55HHbHHHHHHHHHHHHHHHHHHHHHHHHHH555555444444%*@**4%44*4*444444xx@xx".033333%33333333s;s\/s@/90*%35*s46#".9\s99%%9%90s9/"/j0s,.`\`"`\*0\"#s,`#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@//s;0;%;;0"s.77*7.7777@xxxxxx@@..```````````````````````bbbbbbbbbbbbbbbbbbbbbbbbbb

Try it online!

Explode, 741 bytes
\$y=38\$. Used thus far: 1'2q#,9/j;0"35s46%7*x@f8.a`&Hb=cd<AB  (trailing space)
AAB<<dddcccccccccccccccccccccccccccccdc==d=b=b=b=`HH&AAAAAAAAAAAAAAAAAAAAAAB&&a&&a&a&&.&&&&&&&&&&&&&&&&&&&&&aaaaaaaaaaaaaaaaaaaaaaaa..ffffffffff.ffffffffffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%6AAAB66666%@x*78.8.87*7%*7*.7@7%6*@66666666.66555555b55HHbHHHHHHHHHHHHHHHHHHHHHHHHHH555555444444%*@**4%44*4*444444xx@xx".==033333%33333333s;s\/s@/90*%35*s46#".9\s99%%9%90s9/"/j0s,.`AB\`ABccdcAAAAAAAB"`\*0\"#s,`#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@//s;0;%;;0"s.77*7.========================7777@xxxxxx@@..```````````````````````bbbbbbbbbbbbbbbbbbbbbbbbbbdddddddddddddddddddddddddddd<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB                                      B

Try it online.
Explanation:
I just went looking for some random languages that might work, to have something different than Keg and Trigger in the chain. I had never heard about Explode prior, but apparently the tape starts with the amount of spaces equal to the number of lines of the program; which is a single line, thus a single space in this case.
This tape is printed implicitly when the program terminates. Since the program (apparently) doesn't modify the tape in any way, this single space the tape started with is output as our result.
I might try to analyze what each character actually does in the program above, or try to use the language Explode for another challenge, but this will do for now.

Keg, -hr, 120 bytes
\$y = 15\$, Used so far: 1'2q#,9/j\;0"35

55555555555555"03333333333333;\//9035#"9\999909/"/j0,\"\0\"#,#,2201;"'";0;j/\";,0;#\"\;qjj"0jjj'j,#\"jq,q0q2/"\//;0;;;0"

Try it online!
Yeah, you can pretty much tell that I'm gonna do this a lot.

Trigger, 435 bytes
\$y = 29\$, Used so far: 1'2q#,9/j;0"35s46%7*x@f8.a`&
`&&&a&&a&a&&.&&&&&&&&&&&&&&&&&&&&&aaaaaaaaaaaaaaaaaaaaaaaa..ffffffffff.ffffffffffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%666666%@x*78.8.87*7%*7*.7@7%6*@66666666.6655555555555555444444%*@**4%44*4*444444xx@xx".033333%33333333s;s\/s@/90*%35*s46#".9\s99%%9%90s9/"/j0s,.`\`"`\*0\"#s,`#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@//s;0;%;;0"s.77*7.7777@xxxxxx@@..```````````````````````

Try it online!
It seriously looks like Trigger and Keg are the only viable choices now.
The second-twelfth bytes do the magic; it jumps to the second ".", so I could hide my ampersands.
Also, it looks like the "used so far" bit is broken now.

Welcome to Code Golf.SE, nice first answer!

Trigger, 595 bytes
\$y = 34\$, Used so far: 1'2q#,9/j;0"35s46%7*x@f8.a`&Hb=c
dddcccccccccccccccccccccccccccccdc==d=b=b=b=`HH&&&a&&a&a&&.&&&&&&&&&&&&&&&&&&&&&aaaaaaaaaaaaaaaaaaaaaaaa..ffffffffff.ffffffffffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%666666%@x*78.8.87*7%*7*.7@7%6*@66666666.66555555b55HHbHHHHHHHHHHHHHHHHHHHHHHHHHH555555444444%*@**4%44*4*444444xx@xx".==033333%33333333s;s\/s@/90*%35*s46#".9\s99%%9%90s9/"/j0s,.`\`ccdc"`\*0\"#s,`#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@//s;0;%;;0"s.77*7.========================7777@xxxxxx@@..```````````````````````bbbbbbbbbbbbbbbbbbbbbbbbbbdddddddddddddddddddddddddddd

Try it online!

Keg -rn, 703 bytes
\$y=37\$, Used so far: 1'2q#,9/j;0"35s46%7*x@f8.a`&Hb=cd<AB
AAB<<dddcccccccccccccccccccccccccccccdc==d=b=b=b=`HH&AAAAAAAAAAAAAAAAAAAAAAB&&a&&a&a&&.&&&&&&&&&&&&&&&&&&&&&aaaaaaaaaaaaaaaaaaaaaaaa..ffffffffff.ffffffffffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%6AAAB66666%@x*78.8.87*7%*7*.7@7%6*@66666666.66555555b55HHbHHHHHHHHHHHHHHHHHHHHHHHHHH555555444444%*@**4%44*4*444444xx@xx".==033333%33333333s;s\/s@/90*%35*s46#".9\s99%%9%90s9/"/j0s,.`AB\`ABccdcAAAAAAAB"`\*0\"#s,`#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@//s;0;%;;0"s.77*7.========================7777@xxxxxx@@..```````````````````````bbbbbbbbbbbbbbbbbbbbbbbbbbdddddddddddddddddddddddddddd<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

Try it online!

Keg, -rn, 561 bytes
\$y=33\$, Used so far: 1'2q#,9/j;0"35s46%7*x@f8.a`&Hb=c

cccccccccccccccccccccccccccccc===b=b=b=`HH&&&a&&a&a&&.&&&&&&&&&&&&&&&&&&&&&aaaaaaaaaaaaaaaaaaaaaaaa..ffffffffff.ffffffffffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%666666%@x*78.8.87*7%*7*.7@7%6*@66666666.66555555b55HHbHHHHHHHHHHHHHHHHHHHHHHHHHH555555444444%*@**4%44*4*444444xx@xx".==033333%33333333s;s\/s@/90*%35*s46#".9\s99%%9%90s9/"/j0s,.`\`ccc"`\*0\"#s,`#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@//s;0;%;;0"s.77*7.========================7777@xxxxxx@@..```````````````````````bbbbbbbbbbbbbbbbbbbbbbbbbb

Try it online!
;P

Keg, -rn, 666 bytes
\$y=36\$ , Used so far: 1'2q#,9/j;0"35s46%7*x@f8.a`&Hb=cd<A
AA<<dddcccccccccccccccccccccccccccccdc==d=b=b=b=`HH&AAAAAAAAAAAAAAAAAAAAAA&&a&&a&a&&.&&&&&&&&&&&&&&&&&&&&&aaaaaaaaaaaaaaaaaaaaaaaa..ffffffffff.ffffffffffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%6AAA66666%@x*78.8.87*7%*7*.7@7%6*@66666666.66555555b55HHbHHHHHHHHHHHHHHHHHHHHHHHHHH555555444444%*@**4%44*4*444444xx@xx".==033333%33333333s;s\/s@/90*%35*s46#".9\s99%%9%90s9/"/j0s,.`A\`AccdcAAAAAAA"`\*0\"#s,`#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxqsj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@//s;0;%;;0"s.77*7.========================7777@xxxxxx@@..```````````````````````bbbbbbbbbbbbbbbbbbbbbbbbbbdddddddddddddddddddddddddddd<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Try it online!
Yet another one. Just like the other one.

Trigger, 780 bytes
\$y=39\$. Used thus far: 1'2q#,9/j;0"35s46%7*x@f8.a`&Hb=cd<AB _
__AAB<<dddccccccccc___ccccccccccccccccccccdc==d=b=b=b=`HH&_AAAAAAAAA_AAAAAAAA_AAAAAB&&a&_&a&a&&.&&&&&&&&&&&&&&&&&&&&&aaaaaaaaaa__aaaaaaaaa__aaaaa..ffffffffff.ffffffffffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%6AA__AB66666%@x*78.8.87*7%*7*.7@7%6*@66666666.66555555b55HHbHHHHHHHHHHHHHHHHHHHHHHHHHH555555444444%*@**4%4_4*4*444444xx@xx".==033333%33333333s;s\/s@/9_________0*%35*s46#".9\s99%%9%____90s9/_____"/j0s,.`AB\`ABccdcAAAAAAAB"`\*0\"#s,`#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxq__sj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@_//s;0;%;;0"s.77*7.========================7777@xxxxxx@@..```````````````````````bbbbbbbbbbbbbbbbbbbbbbbbbbdddddddddddddddddddddddddddd<<<<<<<<<<<<__<<<<<<<<<<<<<<<<<<<<<BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB                                      B

Try it online!

Trigger, 820 bytes
\$y=40\$. Used so far: 1'2q#,9/j\;0"35s46%7*x@f8.a`&Hb=cd<AB _z.
(I have restored \, which disappeared from this string earlier in the thread.)
zzz_z_AAzB<<ddzdcccczccccc__z_cccccccczccccccccccccdc==d=b=b=b=`HH&_AAAAzAAAAA_AAAAzAAAA_AAAAAB&&a&_&a&a&&.&&&&z&&&&&z&&&&&z&&&&&&&aaaazaaaaaa__aaaazaaaaa__aaaaa..fffffzfffff.ffffzffffzffffff.88888.88888.88888.8888.88@.@@*@@@@@@@@7.%7*77%*7*77%z6AA__zAB66666%@x*78.8.87*7%*7*.7@7%6*@66666666.66555555b55HHbHHHHHHzHHHHHHHzHHHHHHHHHzHHHH555555444444%*@**4%4_4*4*444444xx@xx".==033333%3333z3333s;s\/s@/9____z_____0*%35*s46#".9\s99%%9%____90s9/_____"/j0s,.`AB\`ABccdcAAzAAAAAB"`\*0\"#s,`#,22s01;"*'s"*;0;j/@x.\.xxxx"s;x@xx..,0;%#x\"\;xxq__sj*j"0j%%jj'j,#\"j%qs,q0q28/"\%s@_//s;0;%;;0"s.77*7.========z================7777@xxxxxx@@..`````````z``````````````bbbbbbbbbbbbbbbbbbbbbbbzbbbddddzddddddddddddddddzdddddddd<<<<<<z<<<<<<__<<<<<<<<<z<<<<<<<<<<<<zBBBBBBBBBBBBzBBBBBBBBBBBBBBBBBB                                      zzBzz

Try it online!
The previous answer has stood unchallenged for three weeks so it's time to spoil the party. The first three characters really sum up how I feel about the inventiveness of the present submission. It's perfectly set up for a FizzBuzz finish, however.

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


text:
Cantor Function, Cruel
A ripoff of this challenge. Go upvote it!
Objective
Given a rational number amongst \$[0,1]\$, apply the Cantor function to it and output the rational number that's produced.
The Cantor function
The Cantor function is continuous everywhere and constant almost everywhere, but has an average slope of 1:

The Cantor function \$f(x)\$ can be expressed as a limit \$f(x)=\lim\limits_{n\to\infty} f_n(x)\$ of a sequence of functions \$f_0, f_1, f_2, \dots\$, which are defined recursively as:
\$f_0(x)=x\$
\$f_{n+1}(x)=\left\{\begin{matrix}\frac{1}{2}f_n(3x)&x\in[0,\frac{1}{3})\\ \frac{1}{2}&x\in[\frac{1}{3},\frac{2}{3})\\ \frac{1}{2}+\frac{1}{2}f_n(3x-2)&x\in[\frac{2}{3},1] \end{matrix}\right.\$

Your task is to compute \$f(x)\$ for the rational \$x \in [0,1] \cap \mathbb{Q}\$ given as input.
How?
Though this task might seem impossible, this is actually possible, for the Cantor function is computable.
A step-by-step solution for \$x \in \mathbb{R}\$:

Ternary-expand \$x\$ to \$0.t_1t_2t_3\cdots\$.

Write "0.".

Set \$n=1\$.

If \$t_n = 1\$, write "1" and halt.

Otherwise, if \$t_n = 0\$, write "0", increment \$n\$, then continue doing step #4.

Otherwise (\$t_n = 2\$), write "1", increment \$n\$, then continue doing step #4.

Parse the resulting string as a binary expansion of a real number.

As \$x\$ actually is in \$\mathbb{Q}\$ in this challenge, you should exploit the fact that the ternary expansion of \$x\$ repeats. It follows that the output is also in \$\mathbb{Q}\$.
Examples
$$
\begin{array}{r|c|c|c|c|c|c|c|c|c|c}
x & 0 & ½ & ⅓ & ¼ & ⅕ & ⅚ & 1 \\ \hline
\text{Ternary expansion of }x & 0.\overline{0} & 0.\overline{1} & 0.1\overline{0} & 0.\overline{02} & 0.\overline{0121} & 0.2\overline{1} & 0.\overline{2}  \\ \hline
\text{Binary expansion of } f(x) & 0.\overline{0} & 0.1 & 0.1 & 0.\overline{01} & 0.01 & 0.11 & 0.\overline{1} \\ \hline
f(x) & 0 & ½ & ½ & ⅓ & ¼ & ¾ & 1
\end{array}
$$
Rules

Invalid inputs fall in don't care situation. In particular, you don't need to deal with numbers outside of \$[0,1]\$.

Input and output must be exact rational numbers. If your language doesn't natively support rational number arithmetic, use a pair of integers.

Input and output must be exact rational numbers. I think this implicitly bans a usage of floating-point numbers.

''If your language doesn't natively support rational number arithmetic, use a pair of integers.'' Must the pair of integers be relative prime?

You may want to add some test cases that cannot be expressed as 1/x. For instance: 1/787 ~> 7/512.

I found the "How?" section kind-of confusing. Taken literally, going digit by digit is an endless process that doesn't terminate. As you say, the idea is to, for rationals, notice that the repeating pattern of ternary digits creates a repeating pattern of binary digits, and so creates a rational. But that's not what the written algorithm is doing. Working only with the ternary up to the repeating block of digits would make this clearer.

@Abigail No. But it will be preferred to have an irriducible fraction.

Another test case to consider is 4/39 -> 3/14.

Is: Otherwise, write "1", increment n, then continue... really: Otherwise, if tn is 2, write "1", increment n, then continue....?

@Noodle9 Yes. Though "if $t_n$ is 2" is redundant because $t_n \in {0,1,2} $ always holds.

It would be clearer as Otherwise tn is 2, write "1", increment n, then continue.....

"Bad news": Mathematica has a built-in for this.

Some properties that might be useful for golfing: The non-repeating part has length at most b (the denominator), and the repeating part has length divides phi(b) (Euler totient function).

Wolfram Language (Mathematica), 15 bytes
CantorStaircase

Try it online! Just a built-in function.

JavaScript (ES7),  141 ... 128  125 bytes
Saved 2 bytes thanks to @Ada
Expects the fraction \$p/q\$ as (p)(q). Returns \$P/Q\$ as [P,Q].
p=>q=>(k='0b'+(n=0,g=p=>(r=n-g[p])?'':p/q&1||[p/q>>1]+g(p%q*3,g[p]=n++))(p),r?[((k>>r)*(m=2**r-1)+(k&m))*2,m<<n-r]:[+k,1<<n])

Try it online!
How?
Ternary and binary expansions
k =                    // build a binary string
  '0b' + (             // append the binary prefix
    n = 0,             // n is a bit counter
    g = p =>           // g is a recursive function taking the numerator p
      (r = n - g[p]) ? //   if p was already encountered, we have a repeating
                       //   pattern, whose length is stored in r; in that case:
        ''             //     stop the recursion
      :                //   else:
        p / q & 1 ||   //     if p/q = 1, append a '1' and stop the recursion
        [p / q >> 1] + //     otherwise, append '1' if p/q = 2 or '0' if p/q = 0
        g(             //     append the result of a recursive call to g:
          3 * (p % q), //       update p to 3 * (p modulo q)
          g[p] = n++   //       store the position of p in g and increment n
        )              //     end of recursive call
  )(p)                 // initial call with the numerator provided in the input

Turning the binary expansion into a decimal fraction
If \$r\$ is NaN after the first step, it means that the binary expansion has no repeating pattern. In that case, the numerator is \$k\$ and the denominator is \$2^n\$.
If \$r\$ is defined, we compute the following bitmask:
m = 2 ** r - 1

The numerator is:
((k >> r) * m + (k & m)) * 2

and the denominator is:
m << n - r

Can 3*(p%q) be p%q*3 for -2 bytes?

@Ada Indeed! Thank you.

Python 3.8 (pre-release), 120 119 117 bytes
-2 bytes thanks to @Neil!
f=lambda p,q,P=0,Q=1,*R:p in R and(P-P//(i:=1<<R.index(p)+1),Q-Q//i)or f((d:=p*3//q+1)%2*(p*3%q),q,P*2+d//2,Q*2,p,*R)

Try it online!
Same idea as below, but as a lambda function instead.

Python 2, 133 131 125 122 bytes
-3 bytes thanks to @Neil!
def f(p,q,P=0,Q=1,*R):
 if p in R:i=1<<R.index(p)+1;return P-P/i,Q-Q/i
 d=p*3/q+1;return f(d%2*(p*3%q),q,P*2+d/2,Q*2,p,*R)

Try it online!
A recursive function that takes input as 2 integers p and q. Outputs 2 integers (P,Q) representing the fraction \$P/Q\$ (might not be reduced to lowest term).
Explanation
This solution follows the suggested algorithm in the question.
Ternary expansion
To ternary expand p/q, we divide 3p by q, resulting in the quotient d and remainder r. d is the next ternary digit. To get the digits after that, we simply recurs on r/q.
d, r = p*3/q, p*3%q

Get the binary result
P/Q represents the current result, with Q always be a power of 2.

If d == 1, we append 1 to the result, aka (P*2+1, Q*2). To stop the recursion, we set the remainder to 0: f(0, q, P*2+1, Q*2, ...)
If d == 0, we append 0 to the result and continue: f(r, q, P*2, Q*2, ...)
If d == 2, we append 1 to the result and continue: f(r, q, P*2+1, Q*2, ...)

We can compress all cases into a single expression. For additional golf, first we increase d by 1: d=p*3/q+1. The 4 cases above become:
return f(
  d%2*r,     # 0 if d==2, else r
  q,
  P*2+d/2,   # P*2 if d==1, else P*2+1
  Q*2,
  ...)

This happens to also work for when the input fraction is 1 (p == q), in which case d == 4, and f(0, q, 2, 2, ...) is called, which results in the fraction 4/4.
Termination
The function has to terminate once it finds a repeating block of digits in the ternary expansion. In order to do this, we keep track of all previous numerators in the tuple R. After each iteration, we prepend p to the list of seen numerators: f(..., p, *R).
At the start of each iteration, we check if p is in R. If so, every digit after that will be repeated. The length of the repeated block of ternary digits can be calculated from the position of the previous occurrence of p: n = R.index(p)+1
Let's say that currently, the binary form of P is \$XXXabc\$, where \$abc\$ is the repeated block of digits (aka n = 3). Then
$$P' = XXXabc.abcabc... = \left(P- \left\lfloor{\frac{P}{2^n}}\right\rfloor \right)\frac{2^n}{2^n-1}$$
and the final result is:
$$\frac{P'}{Q} = \frac{\left( P- \left\lfloor{\frac{P}{2^n}}\right\rfloor \right) 2^n}{Q(2^n-1)}$$
Edit: @Neil found a better simplification:
$$\frac{P-\left\lfloor\frac{P}{2^n}\right\rfloor}{Q-\left\lfloor\frac{Q}{2^n}\right\rfloor}$$

I just came up with a similar formulation to golf a further 15 bytes from my answer, although I noted that $\frac{Q(2^n-1)}{2^n}=Q-\frac Q{2^n}=Q-\left\lfloor\frac Q{2^n}\right\rfloor$ so my final formula is $\frac{P'}{Q'}=\frac{\left(P-\left\lfloor\frac P{2^n}\right\rfloor\right)}{\left(Q-\left\lfloor\frac Q{2^n}\right\rfloor\right)}$.

@Neil thanks for the formula!

I think you can actually use Q-Q/i; I only added in the integer division because I was mapping over both P and Q, so it made sense to use integer division both times.

Python 2, 347 337 bytes
exec"B=L,d:B(x/3,d-1)+[x%3]if d else[];V=L:0if x%3else 1+V(x/3);r=L,b,n=1:(3**n-1)%b and r(x,b,n+1)or[n,B((3**n-1)*x/b,n)];F=L:x>[]and(x[-1]>0)+2*F(x[:-1])".replace("L","lambda x")
def c(a,b):
 v=V(b);b/=3**v;N=B(a/b,v);n,R=r(a%b,b);D=N+R
 if 1in D:d=D[:D.index(1)+1];print F(d),2**len(d)
 else:print F(N)*(2**n-1)+F(R)or a,2**v*(2**n-1)

Try it online! (modified to return statements for verification)
Takes and returns pairs of integers (numerator, denominator). The input pair must be relatively prime.
How it works
The program separately identifies the repeating and non-repeating portions of the ternary representation of a/b, then splits into 2 cases:

If there is a 1 in either portion, then the numerator is (converted from binary with 2→1) the concatenation of the two portions up to the 1, and the denominator is 2 to the power of the length of that section

If there is no 1, then the number retains the repeating portion, so in base 2 (after converting 2s to 1s),
$$\frac{a}{b}=0.x_1x_2\ldots x_k\overline{y_1y_2\ldots y_n}=0.\mathbb{x}\overline{\mathbb{y}}$$
Then $$\frac{a}{b}=\frac{1}{2^k}\left(\mathbb{x} + \frac{1}{2^n-1}\mathbb{y}\right)=\frac{(2^n-1)\mathbb{x}+\mathbb{y}}{(2^n-1)(2^k)}$$

# Most-significant ternary digit first
base3 = lambda x, d: base3(x//3, d-1)+[x%3] if d else []
# Largest exponent of a power of 3 that divides x
v3 = lambda x: 0 if x%3 else 1+v3(x//3)
# Base 3 representation of a/b as 0.xyz repeating, where b contains no factors of 3
def rep3(a,b,n=1):
    if (3**n-1)%b==0:
        return n, base3((3**n-1)*a//b,n)
    else:
        return rep3(a,b,n+1)

# Base 2 to int, including converting '2's to '1's
from_base2 = lambda l: eval('0b0'+''.join(map(str,l)).replace('2','1'))

def cantor(a, b):
    # Extract the non-repeating portion of the ternary expansion of a/b
    v = v3(b)
    b //= 3**v
    non_repeating = base3(a//b,v)
    # Repeating portion
    n, repeating = rep3(a%b, b)
    digs = non_repeating + repeating
    if 1 in digs:
        # Take only the part up to/including the first 1, and use it as a binary decimal
        d = digs[:digs.index(1)+1]
        return from_base2(d), 2**(len(d))
    else:
        x = from_base2(non_repeating)
        y = from_base2(repeating)
        # `or a` accounts for the a=b=1 case, which gets treated otherwise as 0.0
        return y+x*(2**n-1) or a, 2**v*(2**n-1)

You don't actually guarantee to return relatively prime integers, e.g. for an input of 9,10 (the ratio is still correct).

@Arnauld Fixed for -10 bytes (The non-repeating portion was not padded)

@Neil Whoops, the output is not actually relatively prime

Charcoal, 92 77 62 bytes
ＮθＮη≔⟦⟧ζＷ¬№ζθ«⊞ζθ≧×³θ⊞υ÷⊕÷θη²≔∧⊖÷θη﹪θηθ»ＩＥ⟦↨υ²Ｘ²Ｌυ⟧⁻ι÷ιＸ²⊕⌕⮌ζθ

Try it online! Link is to verbose version of code. I/O is a pair of integers. Does not reduce the output to lowest terms, in particular 1 1 outputs as 2 2 as that needed fewer hacks than before, which helped to save 15 bytes. Explanation:
ＮθＮη

Input the numerator and denominator.
≔⟦⟧ζ

Start a list of partial remainders.
ζＷ¬№ζθ«

Repeat while the current partial remainder has not been seen before.
⊞ζθ

Push the current partial remainder to the list.
≧×³θ

Triple it.
⊞υ÷⊕÷θη²

Push the next bit of the result. (Note that an input of 1 is treated as the illegal ternary 0.3 and massaged into the illegal binary 0.2.)
≔∧⊖÷θη﹪θηθ

Get the next partial remainder, unless the current ternary digit is 1, in which case the next partial remainder is zero.
»ＩＥ⟦↨υ²Ｘ²Ｌυ⟧

Get the raw binary fraction.
⁻ι÷ιＸ²⊕⌕⮌ζθ

Adjust it for the recurring part of the binary fraction. (In the case of a terminating fraction, this is detected a bit after the fraction terminates, effectively doubling the numerator and denominator, but the adjustment here simply halves both values again.)