text:
Was it a Superb Shuffle™
According to this question a Superb Shuffle™ is defined as a full deck of cards (including jokers) which follows this set of rules:

No two cards (except Jokers) of the same suit are adjacent.
No card (except Jokers) is adjacent to one of the same value.
No card (except Jokers) is adjacent to one of an adjacent value (one higher or one lower in this order, A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A. Notice that Ace can not be adjacent to either a 2 or a King).
The Jokers can be in any position.

The cards are expressed as a value(A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K), followed by a suit (C, D, H, S). For example 'AS' is the Ace of Spades. The Jokers are represented by a single letter J.

Write some code to indicate if an array of cards is a Superb Shuffle™ or not.
Use any language you like.
Attempt to do so in the smallest number of bytes.

Test cases:
1: This is Superb™
[
  "AS", "5D", "9H", "KC", "2D", "6H", "10C", "QS", "3H", "7C", "9S",
  "KD", "4C", "6S", "10D", "AC", "3S", "7D", "JH", "J", "4D", "8H",
  "QC", "AD", "5H", "9C", "JS", "2H", "6C", "8S", "QD", "3C", "5S",
  "9D", "KH", "2S", "6D", "10H", "J", "3D", "7H", "JC", "KS", "4H",
  "8C", "10S", "AH", "5C", "7S", "JD", "2C", "4S", "8D", "QH"
]

# true

2: This is all sorted
[
  "AS", "2S", "3S", "4S", "5S", "6S", "7S", "8S", "9S", "10S", "JS", "QS", "KS",
  "AD", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D", "10D", "JD", "QD", "KD",
  "AH", "2H", "3H", "4H", "5H", "6H", "7H", "8H", "9H", "10H", "JH", "QH", "KH",
  "AC", "2C", "3C", "4C", "5C", "6C", "7C", "8C", "9C", "10C", "JC", "QC", "KC",
  "J", "J"
]

# false

3: Aces together
[
  "AC", "AS", "AD", "AH", "5D", "9H", "KC", "2D", "6H", "10C", "QS",
  "9S", "KD", "4C", "6S", "10D", "3S", "7D", "JH", "J", "4D", "8H",
  "QC", "5H", "9C", "JS", "2H", "6C", "8S", "QD", "3C", "5S", "3H",
  "9D", "KH", "2S", "6D", "10H", "J", "3D", "7H", "JC", "KS", "4H",
  "8C", "10S", "5C", "7S", "JD", "2C", "4S", "8D", "7C", "QH"
]

# false

4: Crazy 8's
[
  "AS", "5D", "9H", "KC", "2D", "6H", "10C", "QS", "3H", "7C", "9S",
  "KD", "4C", "6S", "10D", "AC", "3S", "7D", "JH", "J", "4D", "AH",
  "QC", "AD", "5H", "9C", "JS", "2H", "6C", "QD", "3C", "5S", "10S",
  "9D", "KH", "2S", "6D", "10H", "J", "3D", "7H", "JC", "KS", "4H",
  "5C", "7S", "JD", "2C", "4S","QH", "8D", "8S", "8C", "8H"
]

# false

5: Also superb
[
  "AS", "6H", "9S", "AC", "4D", "9C", "QD", "2S", "7H", "10S", "2C",
  "5D", "10C", "KD", "3S", "8H", "JS", "3C", "6D", "JC", "AH", "4S",
  "9H", "QS", "4C", "7D", "QC", "2H", "5S", "10H", "KS", "5C", "8D",
  "KC", "3H", "6S", "JH", "AD", "6C", "9D", "J", "4H", "7S", "QH",
  "2D", "7C", "10D", "J", "5H", "8S", "KH", "3D", "8C", "JD"
]

# true

6: Ace by 2
[
  "AS", "2S", "6H", "9S", "AC", "4D", "9C", "QD",  "7H", "10S", "2C",
  "5D", "10C", "KD", "3S", "8H", "JS", "3C", "6D", "JC", "AH", "4S",
  "9H", "QS", "4C", "7D", "QC", "2H", "5S", "10H", "KS", "5C", "8D",
  "KC", "3H", "6S", "JH", "AD", "6C", "9D", "J", "4H", "7S", "QH",
  "2D", "7C", "10D", "J", "5H", "8S", "KH", "3D", "8C", "JD"
]

# false

7: Ace by King
[
  "AS", "KH", "2S", "6H", "9S", "AC", "4D", "9C", "QD",  "7H", "10S",
  "2C", "5D", "10C", "KD", "3S", "8H", "JS", "3C", "6D", "JC", "AH",
  "4S", "9H", "QS", "4C", "7D", "QC", "2H", "5S", "10H", "KS", "5C",
  "8D", "KC", "3H", "6S", "JH", "AD", "6C", "9D", "J", "4H", "7S",
  "QH", "2D", "7C", "10D", "J", "5H", "8S", "3D", "8C", "JD"
]

# false

8: Jokers together
[
  "AS", "5D", "9H", "KC", "2D", "6H", "10C", "QS", "3H", "7C", "9S",
  "KD", "4C", "6S", "10D", "AC", "3S", "7D", "JH", "J", "J", "4D",
  "8H", "QC", "AD", "5H", "9C", "JS", "2H", "6C", "8S", "QD", "3C",
  "5S", "9D", "KH", "2S", "6D", "10H", "3D", "7H", "JC", "KS", "4H",
  "8C", "10S", "AH", "5C", "7S", "JD", "2C", "4S", "8D", "QH"
]

# true

9: Adjacent suit/value separated by Jokers
[
  "AS", "6H", "9S", "AC", "4D", "J", "4H", "2S", "7H", "10S", "2C",
  "5D", "10C", "KD", "3S", "8H", "JS", "3C", "6D", "JC", "AH", "4S",
  "9H", "QS", "4C", "7D", "QC", "2H", "5S", "10H", "KS", "5C", "8D",
  "KC", "3H", "6S", "JH", "AD", "6C", "9D", "J", "QD", "7S", "QH",
  "2D", "7C", "10D", "8C", "5H", "8S", "KH", "3D", "9C", "JD"
]

# true

”If any of the cards are missing, that is not a Superb Shuffle" - Boo-urns to input validation!

I personally agree with @Arnauld and Shaggy. A challenge validating these two things of a shuffled 54-cards deck: 1. No adjacents of the same suit. 2. No adjacents of the same, one lower, or one higher values seems like a good challenge. If we should also validate: Are there exactly 54 cards (not too few or too many); are all cards in the correct format; are there no weird ASCII inputs; are there no empty strings; are there no duplicated cards; etc. etc. seems a overkill to me personally.

@KevinCruijssen I missed that one

Sequences such as 4D, J, 3D or J, JS may also result in false negatives.

@Arnauld Ah, shit.. Had a solution that I was about to post, but it indeed fails for 4D, J, 3D..

The TIO link of my Java answer contains some suggested test cases. Two truthy: one with 4D,J,4H and 9D,J,QD (same value or suit with Joker in between); and one with J,J (two adjacent Jokers). And two falsey: one with AS,2D and one with AS,KC (to test if Ace is both adjacent to 2s and Kings). (Already tested the existing Ruby and JS answers, and they are working correctly for these test cases.)

@AdmBorkBork Thanks for letting me know

@KevinCruijssen I've added them, thanks.

I prefer to deal with a Superb Owl.  (stupid joke primarily in the USA)

@CarlWitthoft I like to think that a Superb Owl would be able to produce a Superb Shuffle.

I'm not clear on what's actually guaranteed of the input. Is it always a permutation of the correct 54 cards?

@xnor that is the assumption, yes. I initially made validation of that part of the challenge, but there were some strong objections to that.

JavaScript (ES7), 88 bytes
Returns true for Superb™ or false for Ugly™.
a=>a.every(r=s=([a,b,c])=>!s|!b|!((r-(r='34567891JQKA'.search(a)))**2%13<2|s==(s=c||b)))

Try it online!
How?
Each card is split into 3 characters a, b and c, some of which might be undefined.
The rank is given by the position of a in the string "34567891JQKA" ('2' gives -1). The suit is given by b for all cards but 10's, for which we need to test c instead, and Jokers that have an undefined suit.
We keep track of the previous rank in r and the previous suit in s.
We use the expression \$(r - new\_rank)^2 \bmod 13\$ to detect invalid consecutive ranks. This gives:

\$0\$ if both ranks are equal
\$1\$ if the absolute difference between the ranks is \$1\$
\$1\$ if we have an Ace followed by a Two or a Two followed by an Ace, because the squared difference is \$144\$ and we have \$144 \equiv 1 \pmod{13}\$.
an integer greater than \$1\$ in all other cases

We simply compare the new suit with s to detect identical consecutive suits.
We use the expression !s | !b to detect that either the previous or the current card is a Joker, in which case the results of the other tests are discarded.

Definitely Ugly™ ;)

Retina 0.8.2, 68 bytes
.*,(.*)
$1,$&
J\b
--
10
T
\b\w
$&$&
T`Ao`2-9TJQKA`\b.
(\w).{2,4}\1.*

Try it online! Link includes test cases. Outputs 0 if superb, 1 if not. Explanation:
.*,(.*)
$1,$&

Copy the last card to the beginning to simulate wrap-around.
J\b
--

Replace the jokers with two-character placeholders, which is enough to ensure that the surrounding cards aren't matched with each other.
10
T

And replace the 10s with tens.
\b\w
$&$&

Duplicate the rank of each card.
T`Ao`2-9TJQKA`\b.

Calculate the adjacent rank.
(\w).{2,4}\1.*

Look for adjacent cards of the same suit or same or adjacent rank.

Java 10, 246 210 205 178 170 bytes
d->{var r=1>0;int p=-1,P=p,q,u;for(var c:d)r&=p<0|(u=(p-(p=(q=c.length())<2?-1:"A234567891JQK".indexOf(c.charAt(0))))%12)<-1|u>1&P!=(P=q<2?p:c.charAt(q>2?2:1));return r;}

Try it online.
Explanation:
d->{                   // Method with String-array parameter and boolean return-type
  var r=1>0;           //  Result-boolean, starting at true
  int p=-1,            //  Previous value, starting at -1
      P=p,             //  Previous suit, starting at -1
      q,u;             //  Temp integers
  for(var c:d)         //  Loop over the cards of the input-deck:
    r&=p<0             //   Validate whether the previous value is -1
       |(u=(p-         //   Or if the difference between the previous and current value,
          (p=          //   where the current value is:
                       //   (and replace the previous with the current value for the next
                       //   iteration at the same time)
             (q=c.length())<2?
                       //    Is it a Joker:
               -1      //     Use -1
              :        //    Else:
               "A234567891JQK".indexOf(c.charAt(0))
                       //     Use 0-12 depending on the order
        ))%12)         //   (Modulo-12 for 'A' and 'K')
              <-1|u>1  //   is more than 2
       &P!=            //   And the previous and current suits are not equal,
           (P=         //   where the current suit is:
                       //   (and replace the previous with the current suit for the next
                       //   iteration at the same time)
              q<2?     //    Is it a Joker:
               p       //     Use -1
              :        //    Else:
               c.charAt(q>2?2:1));
                       //     Use the suit-character
                       //     where the `q>2?2:1` is for cards of value 10
  return r;}           //  Return if all validations inside the loop have succeeded

Python 2, 108 bytes
lambda l:all('J'in(a,b)or(q(a[0])-q(b[0])+1)%13>2<a[-1]!=b[-1]for a,b in zip(l,l[1:]))
q='234567891JQK'.find

Try it online!

Python 3, 109 bytes
lambda l:all([(q(a[0])-q(b[0])+1)%13*(A!=B)>2for(*a,A),(*b,B)in zip(l,l[1:])if a>[]<b])
q='234567891JQK'.find

Try it online!
Python 3 wins bytes with iterable unpacking but loses bytes by refusing to chain together comparisons of differently-typed items. The unpacking needs to handle both 'J' and '10S', which means it can either extract the first value or the last value, but not both.

Ruby, 123 bytes
->a{a.each_cons(2).all?{|a,b|a==?J||b==?J||(s="A234567891JQK".chars).zip(s.rotate).all?{|f|((a.chars|b.chars)-[?0]-f)[2]}}}

Try it online!
Explanation:
Without going too much into detail:

split every pair into single characters
remove '0' if any
remove duplicate characters
try to remove pairs of adjacent values

If after the treatment, 3 characters are left, the pair is good.

Python 3, 130 125 bytes
5 bytes saved thanks to Chas Brown
v="A234567891JQK".find;s=lambda d:len(d)<2or("J"in d[:2]or 1<abs(v(d[0][0])-v(d[1][0]))<12and d[0][-1]!=d[1][-1])and s(d[1:])

My first post here, so this could probably be golfed down a little more.
Explanation
Recursive lambda; checks if the first two cards of the current list are of different suits, are different ranks, and their ranks differ by more than 1 (but less than 12, to account for Ace-King), or if one of the two cards is a Joker, in which case it's fine, then consumes the first element of the list and recurses.

Save 5 bytes by replacing v="A234567891JQK" with v="A234567891JQK".find; then you can use abs(v(d[0][0])-v(d[1][0]). Also, welcome to PPCG! Nice first answer.

@ChasBrown Ah, good catch. Thanks!

@nthistle Switching the order of Boolean logic saves a byte

124 bytes

Ruby, 119 bytes
f=->s,c=20,d=?Z{a,*b=s;a ?(x=a[-1];x==?J||(e=((i="A234567891JQK".index(a[0]))-c)%13;e>1&&e<12)&&x!=d)&&f[b,i||20,x]:!p}

Try it online!
Recursive version.
It walks through the array and compares the current card to the last card. The rank is searched in the string "A234567891JQK" and jokers are skipped. It starts with a dummy previous card "20Z" which will accept any neighbour.

If the 20Z card can accept any neighbour, aren’t it’s rules the same as the rules for Jokers? You could cut two bytes by making it a joker?

Actually jokers are made to have rank 20 and color "J", so I could change the first ?Z to ?J but I'm not sure I could save bytes. Handling the edge case of  having two consecutive jokers forces me to check explicitly for "J"

Python 2, 122 bytes
lambda a:all((12>abs(R(c[0])-R(d[0]))>1and c[-1]!=d[-1])or'J'in c[-1]+d[-1]for c,d in zip(a,a[1:]))
R='A234567891JQK'.find

Try it online!


text:
The Jumping Up Sequence
Consider the following sequence:
0 1 3 2 5 4 8 6 7 12 9 10 11 17 13 14 15 16 23 ...

Looks pretty pattern-less, right? Here's how it works. Starting with 0, jump up n integers, with n starting at 1. That's the next number in the sequence. Then, append any numbers "skipped" and that haven't been seen yet in ascending order. Then, increment n and jump from the last number appended. Repeat this pattern.
So, for example, when we reach 11, we're at n=5. We increment n to be n=6, jump up to 17, then append 13 14 15 16 since those haven't been seen yet. Our next jump is n=7, so the next element in the sequence is 23.
The Challenge
Given input x, output the xth term of this sequence, the first x terms of the sequence, or build an infinite list of the terms of the sequence. You can choose 0- or 1-indexing.
I/O and Rules

The input and output can be given by any convenient method.
The input and output can be assumed to fit in your language's native number type.
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

It's apparently not (yet?) on OEIS

@JayCe I'm not surprised - it's a pretty arbitrary sequence.

JavaScript (ES7), 41 bytes
Returns the n-th term of the sequence, 0-indexed.
n=>(d=(n--*8-23)**.5)%1?n:'121'[n]^n-~d/2

Try it online!
How?
Main case: \$n > 3\$
The first four terms of the sequence are special, so let's put them aside for now.
For \$n > 3\$, the sequence looks like that:
 n  | [4] 5 [6] 7 8 [ 9] 10 11 12 [13] 14 15 16 17 [18] 19 20 21 22 23 [24] 25 26 27 ...
----+------------------------------------------------------------------------------------
a(n)| [5] 4 [8] 6 7 [12]  9 10 11 [17] 13 14 15 16 [23] 18 19 20 21 22 [30] 24 25 26 ...
----+------------------------------------------------------------------------------------
 k  |  2  -  3  - -   4   -  -  -   5   -  -  -  -   6   -  -  -  -  -   7   -  -  - ...

We can notice that there are in fact two interleaved sub-sequences:

Most values belong to the sub-sequence \$A\$ for which we simply have:
$$A(n) = n - 1$$
Some other values belong to the sub-sequence \$B\$ (highlighted with brackets in the above diagram) whose indices follow the arithmetic sequence 3, 3, 4, 6, 9, 13, 18, 24 ... and for which we have:
$$B(n,k) = n + k - 1$$
where \$n\$ is the index in the main sequence and \$k\$ is the index in the sub-sequence \$B\$.

The indices of \$B\$ in the main sequence are given by:
$$n_k = \frac{k^2 - k + 6}{2}$$
Given \$n\$, we know that the corresponding term in the main sequence belongs to \$B\$ if \$n\$ is an integer solution of the quadratic equation:
$$x^2 - x + 6 - 2n = 0$$
whose discriminant is:
$$\Delta = 1 - 4(6 - 2n) = 8n - 23$$
and whose positive solution is:
$$x = \frac{1 + \sqrt{\Delta}}{2}$$
We expect \$\sqrt{\Delta}\$ to be an integer. Hence the test:
(d = (n-- * 8 - 23) ** .5) % 1

Special cases: \$0 \le n \le 3\$
For \$n < 3\$, the discriminant is negative and taking its square root results in NaN. For \$n = 3\$, the discriminant is \$1\$. Therefore, these first four terms of the sequence are considered to belong to the sub-sequence \$B\$.
Should we just apply our standard formula n - ~d / 2, we'd get:
$$-\frac 1 2, \frac 1 2, \frac 3 2, 3$$
instead of:
$$0, 1, 3, 2$$
Which is why we XOR these results with \$0,1,2\text{ and }1\$ respectively.

Husk, 12 bytes
Θṁṙ_1C+ḣ2tNN

Try it online!
Outputs as an  infinite list. Here is a version that prints the first N.
Explanation

Θṁṙ_1C+ḣ2tNN – Full program. Takes no input, outputs to STDOUT.
         tN  – Construct the infinite list of natural numbers, starting from 2.
      +ḣ2    – And append [1, 2] to it. Yields [1,2,2,3,4,5,6,7,8,9,10,11,...].
     C     N – Cut the infinite list of positive integers into pieces of those
               sizes. Yields [[1],[2,3],[4,5],[6,7,8],[9,10,11,12],...].
 ṁ           – Map and flatten the results thereafter.
  ṙ_1        – Rotate each to the right by 1 unit.
               Yields [1,3,2,5,4,8,6,7,12,9,10,11,...]
Θ            – Prepend a 0. Yields [0,1,3,2,5,4,8,6,7,12,9,10,11,...]

Haskell, 43 bytes
0:1:3:2:5!3
a!n=a:[a-n+2..a-1]++(a+n)!(n+1)

Try it online!
Defines an infinite list:
  0:1:3:2:(5!3)
≡ 0:1:3:2:5:4:(8!4)
≡ 0:1:3:2:5:4:8:6:7:(12!5)
≡ 0:1:3:2:5:4:8:6:7:12:9:10:11:(17!6)
≡ 0:1:3:2:5:4:8:6:7:12:9:10:11:17:13:14:15:16:(23!7) …

Jelly, 15 bytes
+‘ɼṪRṙ-œ|@
0Ç¡ḣ

This is a full program that, given n, prints the first n items of the sequence.
Try it online!
How it works
0Ç¡ḣ        Main link. Argument: n

0           Set the return value to 0.
 Ç¡         Call the helper link n times, first with argument 0, then n-1 times
            with the previous return value as argument.
   ḣ        Head; extract the first n items of the last return value.

+‘ɼṪRṙ-œ|@  Helper link. Argument: A (array)

 ‘ɼ         Increment the value in the register (initially 0) and yield it.
+           Add that value to all items in the sequence.
   Ṫ        Tail; extract the last item.
    R       Range; map k to [1, .., k].
     ṙ-     Rotate -1 units to the left, yielding [k, 1, ..., k-1].
       œ|@  Perform multiset union of A and the previous return value.

C (gcc), 73 67 64 bytes
t,d;f(x){for(t=4,d=2;d<x;t+=d++)x-t||(d+=x+=d);t=x<4?x^x/2:x-1;}

Try it online!
Defines a function f that takes 0-indexed n and produces the nth number in the sequence.
We can analyze the sequence as follows:
f(n)  = n   where n = 0, 1

f(2)  = 3   // 2 and 3 are swapped
f(3)  = 2

f(4)  = 5   // (+2,+3)
f(6)  = 8   // (+3,+4)
f(9)  = 12  // (+4,+5)
f(13) = 17  // (...)
...

f(n)  = n-1 // for all cases not yet covered

First we handle the middle section:
for(t=4,d=2;d<x;t+=d++)x-t||(d+=x+=d);

Note that the arguments on the left (4, 6, 9, 13, ...) follow a pattern: first add two, then add three, then add four, and so on. We start at t=4 and add d (which starts at 2) each iteration of the loop, incrementing d in the process.
The body of the loop is more interesting. Remember that we want to map 4 to 5, 6 to 8, 9 to 12, etc.; that's just adding d-1 if x is t. However, this logic comes before the last case, f(n) = n - 1, so we know we're going to subtract 1 at the end. Therefore, we can simply add d if x == t (x-t||(x+=d)). However, we will also need to break out of the loop immediately after this -- so we add that to d to get the absurd-looking d+=x+=d, which will always make the d<x condition fail.
This covers everything except for the first four values. Looking at them in binary, we get:
00 -> 00
01 -> 01
10 -> 11
11 -> 10

So, we want to flip the last bit if 2 <= x < 4. This is accomplished with x^x/2. x/2 gives the second least significant bit, so XORing this with the original number flips the last bit if the number is 2 or 3.

Jelly,  13  10 bytes
-3 Thanks to Dennis (use 0-indexing to save 2 from cumulative sum setup and a final decrement)
Ḷ»2Äi+_>2$

A monadic link accepting an integer, 0-indexed n, which returns an integer, a(n)
Try it online! Or see a test-suite

Nice! I had ḶÄ+3i+’, but no idea how to handle the edge cases.

I also have Ḷ»ạ¥3 for Ḋ3,2; - feels like there should be terser for this bit.

Ḷ»2Äi+_>2$ saves 3 bytes, with 0-based indexing.

Oh awesome golf! I was stuck in 1-index land.

MATL, 22 bytes
1y:"t0)@+h5M:yX-h]qw:)

Outputs the first n terms of the sequence.
Try it online!
Explanation
1         % Push 1
y         % Implicit input: n. Duplicate from below
":        % For each k in [1 2 ... n]
  t0)     %   Duplicate sequence so far. Get last entry, say m
  @+      %   Add k: gives m+k
  h       %   Concatenate horizontally
  5M      %   Push m+k again
  :       %   Range [1 2 ... m+k]
  y       %   Duplicate from below
  X-      %   Set difference
  h       %   Concatenate horizontally
]         % End
q         % Subtract 1, element-wise
w         % Swap. Brings original copy of n to the top
:)        % Keep the first n entries. Implicit display

I like the smilie at the end, now I want all my MATL programs to end with a smile. :)

@sundar Yes, I'm happy that it's a relatively common idiom in MATL :-D

Perl 5 with -pl, 70 bytes
$"="|";push@f,$;=$f[-1]+$-++,grep!/^(@f|$;)$/,0..$;for 0..$_;$_=$f[$_]

Try it online!

Haskell, 51 bytes
0:1:do(a,b)<-zip=<<(1:)$scanl(+)3[2..];b:[a+1..b-1]

Try it online!
Quite a bit longer than Lynn's Haskell answer, but the different approach might be interesting non the less.

Ruby, 73 bytes
f=->x,l,n{!l[x]&&(i=l[-1];f[x,l+[i+n]+([*(i+1...i+n)]-l),n+1])||l[0...x]}

Try it online!
Recursive function that returns the first x numbers of the list.

QBasic, 58 bytes
DO
b=r+j
?b
r=b
FOR x=a+1TO b-1
?x
r=x
NEXT
a=b
j=j+1
LOOP

Outputs indefinitely. You may want to add a SLEEP 1 inside the loop or make it LOOP WHILE b<100 or something like that in order to see the results.
This basically just implements the spec. Observe that the numbers we go back for will always be the numbers between the most recently jumped-to number and the jumped-to number prior to that. So we store these bounds as a and b and use a FOR loop to print all the numbers between them.

05AB1E, 14 bytes
0)sƒ¤N+LÁ«}Ùs£

Try it online!

R, 70 bytes
function(e){for(i in 1:e)F=c(setdiff((F+i):1-1,F),F[1]+i,F);rev(F)[e]}

Try it online!

1-indexed
-4 bytes using F constant thanks to @JAD suggestion
-5 bytes reversing the list thanks to @Giuseppe suggestion
-2 bytes removing useless braces in for loop thanks to @JAD suggestion
-2 bytes using setdiff instead of x[x %in% y]

Previous version (79 bytes)

79 bytes

@JAD : I always forgot to use F/T... I can't help it, I'm too inclined to avoid "unsafe code" :D

Constructing the list in reverse saves 5 bytes and causes a bunch of warnings!

It's not even unsafe if F/T are not redefined at function definition. It doesn't (IIRC) modify the global value for F/T

@JAD: yes it changes the value only inside the function environment. It's "unsafe" in the sense that is risky practice changing the value of F/T because it's easy to forget that you've redefined them, and use F/T later in the same environment with unexpected behavior :D

@Giuseppe: great! I'm pretty newbie... are warnings allowed in R code-golf ?

@digEmAll yep, warnings are perfectly fine.

72 bytes

Saved other 2 bytes using setdiff :)

Python 2, 123 bytes
def f(z):[s.extend([s[-1]+n]+[x for x in range(s[-1]+1,s[-1]+n)if not x in s]) for n in range(1,z)if len(s)<z];return s

Try it online!
Given input x, output the first x terms of the sequence,
I'm learning Python and this challenges make things more interesting.
Edit: shave some whitespace

Welcome to PPCG! You can get rid of some more spaces in for n in range(1,z) if len(s) < z]; return s: for n in range(1,z)if len(s)<z];return s.

Jelly, 16 bytes
RÄṬŻk²Ḋ$ṙ€-Ø.;Fḣ

Try it online!
One byte longer than the existing Jelly answer but this could possibly be golfed a little. RÄṬŻk²Ḋ$ could maybe be shorter.
18 bytes
RÄṬŻk²Ḋ$‘ṙ€1FŻŻỤ’ḣ

Longer but different.

Ruby, 63 bytes
->x,n=0{n+=1while 0>d=n*n+n<=>2*x-6;[0,1,3,2][x]||[x+n,x-1][d]}

Try it online!
0-indexed. Can probably be golfed down.

Perl 6, 52 bytes
(0,{((^max @_)∖@_).min.?key//(1+@_[*-1]+$++)}...*)

Try it online!
This is a generator expression using the ... operator. It looks for gaps in the prior sequence @_ via ((^max @_)∖@_).min.?key:
      @_  # prior sequence values         [0,1,3]
  max @_  # largest prior sequence value       3
 ^        # the Range 0..max @_            0,1,2
(       )∖@_  # set subtract prior seq     -0,1  -> (2=>True)
            .min  # smallest unseen value  2=>True
                .?key  # set yields pairs  2

The ? is necessary for the initial value which doesn't have a .key. If no gaps are found, then it adds n (here in the $ variable) to the last value in the list, plus one for off by 0 errors.

Python 3, 104 bytes
def f(x):
 n=a=0
 l=list(range(x*x))
 while n<x:print(l[a+n],*l[a+2-(n<3):a+n],end=' ');a=a+n-(a>0);n+=1

Try it online!
Given input x, output the first x "sequences"

source: Stack Exchange

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

sort: votes


text:
Let's design a digit mosaic
Challenge
Given a positive integer \$N\$, repeat each of its digits \$d_1, d_2, d_3, \cdots, d_n\$ a number of times corresponding to its position in \$N\$. In other words, each digit \$d_k\$ should be repeated \$k\$ times (for each \$1\le k\le n\$, 1-indexed), thus creating the new number:
$$\overline{d_1d_2d_2d_3d_3d_3\cdots\underbrace{d_nd_nd_n\cdots d_n}_{n\text { times}}}$$
Then, write it down both horizontally and vertically and fill in the blanks with copies of the digit that corresponds to the greater index between the column index and the row index of the blank space. The final output should look like this:
$$\begin{bmatrix}
 \color{red}{d_1}  \color{green}{d_2  d_2}  \color{blue}{d_3  d_3  d_3} \cdots \\
 \color{green}{d_2  d_2  d_2}  \color{blue}{d_3  d_3  d_3} \cdots \\
 \color{green}{d_2  d_2  d_2}  \color{blue}{d_3  d_3  d_3} \cdots \\
 \color{blue}{d_3  d_3  d_3  d_3  d_3  d_3} \cdots \\
 \color{blue}{d_3  d_3  d_3  d_3  d_3  d_3} \cdots \\
 \color{blue}{d_3  d_3  d_3  d_3  d_3  d_3} \cdots \\
 \vdots
\end{bmatrix}$$

Specs
You may take  \$N\$ as an integer, a string, a list of digits or a list of characters representing the digits. The output can be a newline-separated string, a list of strings / integers or a list of lists of characters / digits, but please include a pretty-print version too, if possible. If the output is a newline-separated string, it is also acceptable to:

have leading / trailing whitespace, as long as the visual appearance of the output doesn't change
separate the columns using a consistent amount spaces or the rows with a consistent (non-zero) amount of newlines

You can take input and provide output through any standard method, while taking note that these loopholes are forbidden by default. This is code-golf, so try  to complete the task in the least bytes you can manage in your language of choice.
Test cases
65:

655
555
555

---------------

203:

200333
000333
000333
333333
333333
333333

--------------

233:

233333
333333
333333
333333
333333
333333

---------------

5202:

5220002222
2220002222
2220002222
0000002222
0000002222
0000002222
2222222222
2222222222
2222222222
2222222222

---------------

12345:

122333444455555
222333444455555
222333444455555
333333444455555
333333444455555
333333444455555
444444444455555
444444444455555
444444444455555
444444444455555
555555555555555
555555555555555
555555555555555
555555555555555
555555555555555

Do we have the handle two of the same digit next to one another?

@DomHastings Yes, you have to handle them. Added a test case illustrating this.

Related

JavaScript (ES7), 70 bytes
Takes input as a string. Returns a string with a trailing linefeed.
s=>(g=x=>(c=s[(x>y?x:y)**.5-1>>1])?c+g(x+8):x>y?`
`+g(1,y+=8):'')(y=1)

Try it online!
How?
Method
We build the output character by character by walking through a square matrix and converting each cell into an index \$i_{x,y}\$ into the input string.
Coordinates to string index
The upper bound \$u_{n}\$ of the \$n^{th}\$ digit area (0-indexed) along each axis is given by A000096:
$$u_{n} = \frac{n(n+3)}{2}$$
$$u_{0}=0,u_{1}=2,u_{2}=5,u_{3}=9,u_{4}=14,u_{5}=20,\dots$$
Given an integer \$k\$, we can find out in which area \$n=\lfloor{x}\rfloor+1\$ it is located by solving:
$$x²+3x-2k=0$$
Leading to:
$$x = \frac{\sqrt{1+8k}-3}{2}$$
$$n = \left\lfloor\frac{\sqrt{1+8k}-3}{2}\right\rfloor+1=\left\lfloor\frac{\sqrt{1+8k}-1}{2}\right\rfloor$$
For each cell \$(x, y)\$, we define:
$$v_{x,y} = \max(1+8x,1+8y)$$
These values \$v_{x,y}\$ are converted into indices \$i_{x,y}\$ into the input string by doing:
$$i_{x,y} = \left\lfloor\frac{\sqrt{v_{x,y}}-1}{2}\right\rfloor$$
 v(x,y) |  0  1  2  3  4  5  6  7  8  9        i(x,y) |  0  1  2  3  4  5  6  7  8  9
--------+-------------------------------      --------+-------------------------------
    0   |  1  9 17 25 33 41 49 57 65 73           0   |  0  1  1  2  2  2  3  3  3  3
    1   |  9  9 17 25 33 41 49 57 65 73           1   |  1  1  1  2  2  2  3  3  3  3
    2   | 17 17 17 25 33 41 49 57 65 73           2   |  1  1  1  2  2  2  3  3  3  3
    3   | 25 25 25 25 33 41 49 57 65 73           3   |  2  2  2  2  2  2  3  3  3  3
    4   | 33 33 33 33 33 41 49 57 65 73   -->     4   |  2  2  2  2  2  2  3  3  3  3
    5   | 41 41 41 41 41 41 49 57 65 73           5   |  2  2  2  2  2  2  3  3  3  3
    6   | 49 49 49 49 49 49 49 57 65 73           6   |  3  3  3  3  3  3  3  3  3  3
    7   | 57 57 57 57 57 57 57 57 65 73           7   |  3  3  3  3  3  3  3  3  3  3
    8   | 65 65 65 65 65 65 65 65 65 73           8   |  3  3  3  3  3  3  3  3  3  3
    9   | 73 73 73 73 73 73 73 73 73 73           9   |  3  3  3  3  3  3  3  3  3  3

Halting conditions
We know that we've reached:

the right boundary of the matrix when the character at \$i_{x,y}\$ does not exist and we have \$x > y\$
the bottom boundary of the matrix when the character does not exist and we have \$x \le y\$

J, 16 15 bytes
-1 byte thanks to FrownyFrog!
{~#\<:@>./~@##\

Try it online!
Takes N as a string.
Explanation of th initial solution:
              #\   finds the length of the successive prefixes of the input (1 2 3...)
            #~     copies each digit as many times (1 2 2 3 3 3...)
       >./~@       and creates a table of the max of the row/col numbers
  [:<:@            then subtract 1 from each element (for indexing)
{~                 select the corresponding digit from the input

Test session with input 203:
   #\ '203'
1 2 3

   #~#\ '203'
1 2 2 3 3 3

   >./~@#~#\ '203'
1 2 2 3 3 3
2 2 2 3 3 3
2 2 2 3 3 3
3 3 3 3 3 3
3 3 3 3 3 3
3 3 3 3 3 3

   <:@>./~@#~#\ '203'
0 1 1 2 2 2
1 1 1 2 2 2
1 1 1 2 2 2
2 2 2 2 2 2
2 2 2 2 2 2
2 2 2 2 2 2

   ({~[:<:@>./~@#~#\) '203'
200333
000333
000333
333333
333333
333333

Hah, apart from the placement of the ), your APL answer is the same as the would-have-been mine.

I really don't know J at all, but [:<:@ seems quite costly. Could you instead prepend something to the list you are indexing into to account for the 1-indexing (e.g. prepend a 0 in order to move each necessary element 1 position to the right)?

@Mr.Xcoder I was thinking about that. I'll try it to see if it would save some bytes.

@EriktheOutgolfer {⍵[∘.⌈⍨(/⍨)⍳⍴⍵]}  ?

@GalenIvanov Yes, that.

Save 1 byte: {~#\<:@>./~@##\

@Mr.Xcoder the [: is not really part of it, it’s just <:@. Can’t think of anything shorter.

Jelly, 7 bytes
Jx`»þ`ị

Try it online!
Clarified output.

Haskell, 60 59 58 bytes
f x|s<-do(n,_)<-zip[0..]x;n<$[0..n]=[(x!!).max a<$>s|a<-s]

Try it online!

Point-free version (68 bytes)
(map=<<(.((snd.).max)).flip map).((\t@(n,c)->t<$[1..n])=<<).zip[1..]

Try it online!

R, 59 bytes
function(a){m=outer(x<-rep(g<-seq(a),g),x,pmax);m[]=a[m];m}

Try it online!

I noticed that taking a vector of digits is acceptable, and this allowed me to save 21 bytes :)
-2 bytes thanks to @Giuseppe suggestion to accept only character vector
-2 bytes assigning in arguments definition

You could take a as a vector of characters, allowing you to set g=seq(a) directly.

@Giuseppe: that's right!

Python 2, 71 bytes
i=j=0;r=''
for x in input():i+=1;r+=x*i
for c in r:print j*c+r[j:];j+=1

Try it online!
First generates the first row r, then iterates over r to print each line.

APL (Dyalog Classic), 16 bytes
{⍵[∘.⌈⍨(/⍨⍳⍴⍵)]}

I'm separating this solution from the post with my J answer, as suggested by Jo King
Try it online!

05AB1E, 14 11 10 bytes
Saved 1 byte thanks to Magic Octopus Urn / Adnan
ƶJDv¬N×?=¦

Try it online!
Explanation
ƶ            # repeat each element its index (1-based) times
 J           # join to string
  Dv         # for N in [0 ... len(string)-1] do
    ¬N×      # push the head repeated N times
       ?     # print without newline
        =    # print the rest of the string without popping
         ¦   # remove the head

Try it online! = 10

No credit to me though, credit is Adnans: https://codegolf.stackexchange.com/a/87074/59376

@MagicOctopusUrn: Ah, that's brilliant! Thanks to both of you ;)

Python 2, 74 bytes
i=1;a=[]
for c in input():exec"a=zip(*a+[c*-~len(a)]);"*i;i+=2+i%2
print a

Try it online!

Excel VBA, 95 bytes
An anonymous VBE immediate window funtion that takes input from [A1] and outputs to the console
n=[len(A1)]:For y=1To n:For l=1To y:?:For x=1To n:?String(x,Mid([A1],IIf(x>y,x,y)));:Next x,l,y

Ungolfed and commented
n=[len(A1)]                         ''  Get Length
For y=1To n                         ''  Iterate down input
For l=1To y                         ''  Iterate down repeat lines
?                                   ''  Print Newline
For x=1To n                         ''  Iterate accross input
?String(x,Mid([A1],IIf(x>y,x,y)));  ''  Print x of the `max(x,y)`th digit in input
Next x,r,y                          ''  Loop, Loop, Loop

MATL, 15 12 bytes
tftY"t!2$X>)

Try it online!
I suspect this can be shortened, but it's not so bad...
          % implicit input, '230'
t         % duplicate input. Stack: ['230','230']
f         % indices of nonzero values. Stack: ['230',[1,2,3]]
t         % duplicate. Stack: ['230',[1,2,3],[1,2,3]]
Y"        % run-length decoding. Stack: ['230',[1,2,2,3,3,3]]
t         % duplicate. Stack: ['230',[1,2,2,3,3,3],[1,2,2,3,3,3]]
!         % transpose. Stack: ['230',[1,2,2,3,3,3],[1;2;2;3;3;3]]
2$X>      % elementwise maximum of 2 inputs, with broadcast.
          % Stack:
          % ['230',
          % [1, 2, 2, 3, 3, 3;
          %  2, 2, 2, 3, 3, 3;
          %  2, 2, 2, 3, 3, 3;
          %  3, 3, 3, 3, 3, 3;
          %  3, 3, 3, 3, 3, 3;
          %  3, 3, 3, 3, 3, 3]]
 )        % index into G
          % implicit end, display stack contents

Add++, 35 bytes
L,bLRdBcB]£X¦Ω+d‽b>1€Ω_A€Ω:AbLR¦+$T

Try it online!
How it works
We take input as a list of digits, while prevents us from a) having to cast to digits with BD, and also from having to save the digits, which would take two bytes.
First, we generate a range from [1 ... len(input)] with bLR, then we repeat each element \$n\$ in the range \$n\$ times. As automatic vectorisation doesn't exist in Add++, we zip it with itself, dBcB], to create a list of pairs \$[[1, 1], [2, 2] ... [n, n]]\$. We then apply starmap, coupled with repetition over the pairs: £X before concatenating them into one flat array (¦Ω+).
Next, we duplicate this array and table it by maximum, d‽b>. I.e. each element in the array is paired with each other element from the second array and the dyadic maximum command is run over the pair. For an example input of [6 5], this creates the array [1 2 2 2 2 2 2 2 2], which is a flattened version of the mosaic, as the indexes for the array. Unfortunately, Add++ uses 0-indexed arrays, so we need to decrement each element: 1€Ω_.
Then, we index into the input list, by pushing the input again (A), which again saves bytes by taking input as a list. Index into the list with €Ω: before chopping the array into the appropriately lengthed pieces. If the number of digits in the input is denoted by \$x\$, then the piece size is
$$\frac{x(x - 1)}{2}$$
or the \$x^{th}\$ triangular number. We generate that by pushing the input's length, calculating the range from 1 to that value, then taking the sum with AbLR¦+. Now, the stack, for an input of [6 5], looks like [[6 5 5 5 5 5 5 5 5] 3]. T chops the array into pieces of size \$n\$, but the arguments are currently in the wrong order, so we swap them with $ before chopping and returning with T.

Python 2, 76 73 bytes
-3 bytes thanks to Lynn.
l=0;m=[]
for k in input():l+=1;m=[r+l*k for r in m]+l*[l*-~l/2*k]
print m

Try it online!

Charcoal, 17 bytes
Ｆ⮌…ＬθＵＯ⊕⊘×ι⁺³ι§θι

Try it online! Explanation:
Ｆ⮌…Ｌθ

Loop over the indices of the characters in reverse order.
⊕⊘×ι⁺³ι

Calculate the size of the square.
ＵＯ...§θι

Draw the square using the current character.

Canvas, 12 bytes
ø╶｛；ｌ└²＋：＊；ｎ

Try it here!

Charcoal, 14 bytes
Ｅ⭆θ×⊕κι×⊕κι‖Ｏ↗

Try it online!
How?
Ｅ⭆θ×⊕κι×⊕κι‖Ｏ↗ - implicitly print the result of...
Ｅ                - map:
  ⭆              -   over: string map:
    θ             -     over: first input
     ×            -     using: repeat
        ι         -       what: ι (loop value)
      ⊕κ          -       by: incremented κ (loop counter)
         ×        -   using: repeat
            ι     -     what: ι (loop value)
          ⊕κ      -     by: incremented κ (loop counter)
             ‖Ｏ  - Reflect with overlap:
                ↗ -   direction: up-right

...can this method be golfed?

"...can this method be golfed?" Even Neil's solution is longer, so I don't see any hope here. :P

×⊕κι twice though.

The thing is, it's not easy to assign that to a variable, since the values of ι and κ change at every iteration of the Ｅach loop.

It needs to be a function but I don't know if it's even possible.

The question to ask is if it's possible in 3 (or 5, depending on how the function is defined) bytes or less. ;) (The obvious answer is, of course, not.)

QBasic 1.1, 127 bytes
INPUT S$
FOR X=1TO LEN(S$)
K=K+X
R$=R$+STRING$(X,MID$(S$,X,1))
NEXT
FOR C=1TO K
?STRING$(C-1,MID$(R$,C,1))RIGHT$(R$,K-C+1)
NEXT

-4 thanks to DLosc.
Uses a modified version of xnor's Python 2 algorithm.
Input is an unquoted string. Output is \n-separated without extra spaces or \ns.

Stax, 12 bytes
ü°√¿«│⌠º₧@\τ

Run and debug it
Using this algorithm.
Explanation:
c%R:BXm]i*xit+ Full program, implicit input
c%             Length of input
  R            1-based range
   :B          Repeat each element according to the range ("123" -> "122333")
     X         Save to X register
      m        Map:
       ]         Character -> string
        i*       Repeat by iteration index
          xit    Trim first <iteration index> elements from X
             +   Concatenate
                 Implicit output with newline

Stax, 20 19 18 16 bytes
ù↔‼i,ÑΓæ☺=╘‼æ↕4╝

Run and debug it
Explanation:
c%R:BX%mYx%{y|Mvx@m Full program, implicit input
c%                  Length of input
  R                 1-based range
   :B               Repeat each element according to the range ("123" -> "122333")
     X              Save to X register
      %             Length
       m            Map over 1-based range:
        Y             Save index to Y register
         x%           Push length of X register
           {      m   Map over 1-based range:
            y|M         Maximum of both indices
               v        1-based -> 0-based (decrement)
                x@      Index into X register
                      Implicit output with newline

Attache, 34 bytes
{_[Table[Max,Flat!{_&_}=>1:#_]-1]}

Try it online!
Explanation
Works similarly to Galen Ivanov's J answer.
{_[Table[Max,Flat!{_&_}=>1:#_]-1]}
{                                }   anonymous function: _ is input, array of digits
                                     example: _ := [2, 0, 3]
                         1:#_        the range 1 to Size[_]
                                     > e.g.: [1, 2, 3]
                  {   }=>            over each number N:
                   _&_                   map to N repeated N times
                                     > e.g.: [[1], [2, 2], [3, 3, 3]]
             Flat!                   flatten it
                                     > e.g.: [1, 2, 2, 3, 3, 3]
   Table[Max,                ]       create a "max" table with it
                                     > e.g.:
                                       1 2 2 3 3 3
                                       2 2 2 3 3 3
                                       2 2 2 3 3 3
                                       3 3 3 3 3 3
                                       3 3 3 3 3 3
                                       3 3 3 3 3 3
                              -1     subtract 1 from each
                                     > e.g.:
                                       0 1 1 2 2 2
                                       1 1 1 2 2 2
                                       1 1 1 2 2 2
                                       2 2 2 2 2 2
                                       2 2 2 2 2 2
                                       2 2 2 2 2 2
 _[                             ]    index the original array with this matrix
                                     > e.g.:
                                       2 0 0 3 3 3
                                       0 0 0 3 3 3
                                       0 0 0 3 3 3
                                       3 3 3 3 3 3
                                       3 3 3 3 3 3
                                       3 3 3 3 3 3

K (ngn/k), 16 bytes
{x@i|\:i:&1+!#x}

Try it online!

C (gcc), 130 126 bytes
-4 bytes thanks to ceilingcat
Who needs fancy maths when you can bruteforce?
n,l;R(n,c){for(;n--;)putchar(c);}f(s){for(char*p=s,*q;*p++;)for(n=l=p-s;l--;R(1,10))for(R(n*-~n/2,p[-1]),q=p;*q;)R(++q-s,*q);}

Try it online!

QBasic, 111 bytes
An anonymous function that prompts for input and outputs to the console.
INPUT s$
n=LEN(s$)
FOR y=1TO n
FOR l=1TO y
?
FOR x=1TO n
z=x
IF y>x THEN z=y
?STRING$(x,MID$(s$,z));
NEXT x,l,y

Looks good--but don't you mean "full program"? I don't think QBasic has "anonymous functions."

Vyxal, 13 bytes
Þżṅ:ẏ(:hnẋ₴…Ḣ

Try it Online!
How?
Þżṅ:ẏ(:hnẋ₴…Ḣ
Þż            # Repeat each character in the (implicit) input its 1-based index amount of times
  ṅ           # Join by nothing
   :          # Duplicate
    ẏ(        # Loop over [0...length), where the current iteration = n
      :h      # Duplicate and get the first character
        nẋ    # Repeat it n amount of times
          ₴   # Print without a trailing newline
           …  # Print without popping with a trailing newline
            Ḣ # Remove the first item

Php 7.1, 163 bytes
Via CLI providing the number as an argument:
<?foreach(str_split($argv[1])as$k=>$d)$a[]=array_fill(0,$s+=$k+1,array_fill(0,$s,$d));foreach(array_replace_recursive(...array_reverse($a))as$v)echo join($v)."\n";

Not so golfed:
$n = 123;

foreach(str_split($n) as $k => $d) {
    $s += $k + 1;
    $a[] = array_fill(0, $s, array_fill(0, $s, $d));
}

foreach(array_replace_recursive(...array_reverse($a)) as $v)
    echo implode('', $v) . "\n";

Output:
122333
222333
222333
333333
333333
333333

Method:
Basically build multi-dimensional array squares consisting of the digit, and then superimpose all of them (array_replace_recursive).
(Yes, I know this is embarrassingly long.)

If the input is a pre-defined array of digits, and the echo implode/join is removed/replaced with an assignment to a list of list of digits, this can be reduced to about  119 bytes, yep still long.

Ruby, 80 bytes
->n{s=(1..n.size).map{|i|n[i-1]*i}*"";(0...s.size).map{|i|s[i]*i+s[i..-1]}*"\n"}

Try it online!
Similar to ovs answer

Japt, 12 bytes
Takes input as a string, outputs an array of strings.
Ë+pE
¬£h°YçX

Try it

Explanation
            :Implicit input of string U
Ë           :Map each character D at 0-based index E
  pE        :  Repeat D E times
 +          :  Append to D
\n          :Reassign to U
¬           :Split to character array
 £          :Map each element X at 0-based index Y
   °Y       :  Increment Y
     çX     :  Repeat X Y times
  h         :  Replace the first Y characters in U with that

Yabasic, 108 bytes

An anonymous function that takes input from STDIN and outputs to STDOUT
Input""s$
n=len(s$)
For y=1To n
For r=1To y
For x=1To n
For c=1To x?Mid$(s$,max(x,y),1);Next
Next
?Next
Next

Try it online!

uBASIC, 120 bytes
An anonymous function that takes input foprm STDIN and outputs to STDOUT
0Input"",S$:N=Len(S$):ForY=1ToN:ForL=1ToY:ForX=1ToN:ForC=1ToX:Z=X:IfY>XThenZ=Y
1?Mid$(s$,z,1);:NextC:NextX:?:NextL:NextY

Try it online!

Visual Basic .NET (VBC), 198 bytes
A Subroutine that takes input from STDIN and outputs to STDOUT.
Couldn't seem to get StrDup to work :/
Module M
Sub Main
Dim c,s,n,l,x,y
s=Console.readLine()
n=Len(s)
For y=1To n
For l=1To y
For x=1To n
For c=1To x
Console.Write(Mid(s,IIf(x>y,x,y),1)&IIf(c=n,vbLf,""))
Next c,x,l,y
End Sub
End Module

Try it online!

Lua, 149 140 bytes
Function which accepts a list of digit strings and prints the result to stdout. This is my first attempt at code golf (and the language choice isn't helping either) so bear with me :)
Try it online!
function(a)F,s=0,""for b=1,#a do s=s..a[b]:rep(b)end;for b=1,#a do io.write((s.."\n"):rep(b))F,z=F+b,a[b+1]or""s=z:rep(F)..s:sub(F+1)end end

Ungolfed:
G = function(p)
    F,s = 0,""
    for i=1,#p do
        s=s..p[i]:rep(i)
    end
    for i=1, #p do
        io.write((s.."\n"):rep(i))
        F,z = F+i, p[i+1]or""
        s = z:rep(F)..s:sub(F+1)
    end
end
-- allows to pass the argument list from stdin
-- example: {"1", "2", "3", "4", "5"}
G(load("return " .. io.read())())

Perl 5 + -nalF -M5.010, 67 bytes
s/./$&x++$-/ge;eval'eval"say;"x++$i;$x+=$i;s/.{$x}/$F[$i]x$x/e;'x@F

Try it online!

Uiua SBCS, 11 bytes
⊏⊞↥.▽+1.⇡⧻.

Try it!

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


text:
FIFO cache anomalies
This is the followup challenge from this one, if you're confused please check that one out first.

First, let \$m(s, k)\$ be the number of cache misses a sequence \$s\$ of resource accesses would have assuming our cache has capacity \$k\$ and uses a first-in-first-out (FIFO) ejection scheme when it is full.
Then given a ratio \$r > 1\$, return a non-empty sequence of resources accesses \$s\$ such that there exists \$k > j\$ with \$m(s, k) \geq r \cdot m(s, j)\$.
In plain English, construct a sequence \$s\$ of resource accesses so that there's two cache sizes where the bigger cache has (at least) \$r\$ times more cache misses when used to resolve \$s\$.
An example for \$r = 1.1\$, a valid output is the sequence \$(3, 2, 1, 0, 3, 2, 4, 3, 2, 1, 0, 4)\$, as it causes \$9\$ cache misses for a cache size of \$3\$, but \$10\$ misses for a cache size of \$4\$.
It doesn't matter what sequence you return, as long as it meets the requirements.

Shortest code in bytes wins.

Background reading: Bélády's anomaly

Might just be the exhaustion, but this challenge isn't entirely clear to me; could you provide a worked example and a couple more test cases?

@Shaggy Go check out the other challenge, and the background reading from the other comment. The crux is that a FIFO cache can get worse as it becomes bigger for some series of requests.

Wolfram Language (Mathematica), 124 113 101 bytes
Flatten@{s=⌈2#⌉;q=Range[r=2s+1];g=Mod[q s-s,r];{Sort@g[[#+1;;]],g[[;;#]]}&~Array~r,Table[q,s^3]}&

Try it online!
NOTE: The TIO output is not the actual list because it would be very long. The wrapper function on TIO tells you the number of page faults for two cache capacities.
For the actual list: Try it online!
Related: arXiv:1003.1336
How?
Let's assume a situation where we have two cache capacities, 3 and 4.
Also, let's say the 3-cache has {4, 2, 5} paged, and 4-cache has {5, 4, 3, 2} paged. Then, let's try paging {1, 2, 3, 4, 5, 1, 2, 3, 4, 5}:
page  3-cache   4-cache
      {4,2,5}  {5,4,3,2}
  1   {1,4,2}  {1,5,4,3}
  2   {1,4,2}  {2,1,5,4}
  3   {3,1,4}  {3,2,1,5}
  4   {3,1,4}  {4,3,2,1}
  5   {5,3,1}  {5,4,3,2}
  1   {5,3,1}  {1,5,4,3}
  2   {2,5,3}  {2,1,5,4}
  3   {2,5,3}  {3,2,1,5}
  4   {4,2,5}  {4,3,2,1}
  5   {4,2,5}  {5,4,3,2}

The 3-cache had 5 page faults, while the 4-cache had 10. We also returned to our original state.
Here, if we repeat paging {1, 2, 3, 4, 5}, we would asymptotically reach the ratio of 2.
We can extend this phenomenon to higher cache capacities so that we can page {1, 2, 3, ... , 2n + 1} and end up with any ratio.


text:
Alpha-Numerical Bowtie
Output this exact text:
1                i
12              hi
123            ghi
1234          fghi
12345        efghi
123456      defghi
1234567    cdefghi
12345678  bcdefghi
123456789abcdefghi
12345678  bcdefghi
1234567    cdefghi
123456      defghi
12345        efghi
1234          fghi
123            ghi
12              hi
1                i

A single trailing newline is acceptable, but no other formatting changes are allowed.
Rules and I/O

No input
Output can be given by any convenient method.
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Can we use the uppercase alphabet instead?

@Cowsquack That would be a rule change. It says Output this exact text.

@Cowsquack Nope - lowercase is required.

C, 87 85 81 80 bytes
j;main(i){for(;++i<19;)for(j=19;j--;)putchar(j?j<i^j<20-i?32:106-j-j/10*39:10);}

Try it online!
Explanation
j; // same as int j;
main(i){ // same as int main(int i){, where i = argc (1 with no arguments)
  for(;++i<19;) // loop over rows, i = 2..18
    for(j=19;j--;) // loop over chars, j = 19..0
      putchar(j?j<i^j<20-i?32:106-j-j/10*39:10); // output characters:
      //      j?                           :10 // on last char (j=0), output \n
      //        j<i                            // check for top/left half
      //            j<20-i                     // check for bottom/left half
      //           ^                           // 1 if only one half matched
      //                  ?32:                 // if so, output space
      //                      106              // char code for j
      //                         -j            // get desired letter
      //                           -j/10*39    // subtract 39 for j>9 (numbers)
}

I'm amazed ^ has lower precedence than <… what a pretty answer!

@Lynn The bitwise operators in C (and even Java/JS and such) all have a lower precedence than comparisons. This is both nice for code golf and a really nice source of errors (think if (x & 2 == 0), which always evaluates to 0)

Python 2, 73 bytes
i=9
exec"i-=1;a=abs(i);print'123456789'[:9-a]+'  '*a+'abcdefghi'[a:];"*17

Try it online!

05AB1E (legacy), 15 bytes
A9£Sāì9LÂì×ζRû»

Try it online!
-2 thanks to Kevin Cruijssen.

16 bytes by changing žh¦A9£«S9L to 9L©A9£S«® (or 9LA9£S«9L or 9LDA9£S«s).

15 bytes by changing it to A9£Sāì9L instead.

R, 64 bytes
for(i in abs(8:-8))cat(intToUtf8(c(57-8:i,32*!!-i:i,97+i:8,13)))

Try it online!

-3 bytes thanks to @Giuseppe
-5 bytes thanks to @J.Doe

67 bytes with intToUtf8

cat for one byte?

64 bytes building on your solution, using @Giuseppe's shortcut to rep plus the feature of intToUtf8 that a 0 turns into a "".

@J.Doe great trick!

@J.Doe : Awesome, thanks !

Python 2, 80 bytes
j=i=1
exec"print'123456789'[:i]+'  '*(9-i)+'abcdefghi'[-i:];i+=j;j-=2*(i>8);"*17

Try it online!

77 bytes

@ovs it would converge into Lynn's answer, so I'll leave this one as is

QBasic, 72 bytes
Based on Taylor Scott's submission.
FOR y=-8TO 8
z=ABS(y)
?"123456789abcdefghi";
LOCATE,10-z
?SPC(2*z)"
NEXT

Basic explanation
On each line, we print the full string 123456789abcdefghi. Then we go back and overwrite part of it with spaces.
Full explanation
With code slightly ungolfed:
FOR y = -8 TO 8           ' Loop for 17 rows
 z = ABS(y)               ' z runs from 8 to 0 and back to 8
 ? "123456789abcdefghi";  ' Print the full string and stay on the same line (important!)
 LOCATE , 10-z            ' Go back to column 10-z on that line
 ? SPC(2*z); ""           ' Print 2*z spaces
                          ' (SPC keeps the cursor on the same line unlesss you print
                          ' something after it, so we'll use the empty string)
NEXT                      ' Go to the next y value

That's a really clever use of  the Locate command

Japt, 24 19 bytes
Returns an array of lines
9õ Ôê1 Ëç°TsH)êÃû y

Test it
9õ Ôê1 Ëç°TsH)êÃû y
9õ                      :Range [1,9]
   Ô                    :Reverse
    ê1                  :Mirror
       Ë                :Map
        ç               :  Repeat
         °T             :    Prefix increment T (initially 0)
           s            :    Convert to base
            H           :    32
             )          :  End repeat
              ê         :  Palindromise
               Ã        :End map
                û       :Centre pad each with spaces to the length of the longest
                  y     :Transpose

(It did indeed, 4 year ago Shaggy, it did indeed!)

I'm wondering now if building this horizontally might not have led to a shorter solution! :\

T-SQL, 108 bytes
DECLARE @ INT=8a:
PRINT STUFF('123456789abcdefghi',10-abs(@),2*abs(@),SPACE(2*abs(@)))
SET @-=1IF @>-9GOTO a

Returns are for readability only.
Tried lots of other variations, including number tables, this was the shortest.

05AB1E, 20 bytes
9LJη.BA9£.sí.Bí)øJû»

Try it online!

Canvas, 13 bytes
９Ｒ［］ｚ９ｍ±［］±＋─

Try it here!

Japt, 20 bytes
9Æ9Ç>YÃê1 Ë?S:°EsH
ê

Japt Interpreter
Output as an array of arrays of characters. The -R flag isn't necessary to work, it just makes the output look nicer.
Explanation:
9Æ9Ç                    create a 9x9 2D array
    >YÃ                 fill bottom left triangle with "false", upper right with "true"
       ê1               mirror horizontally
          Ë?S           replaces "true" with a space
             :°EsH      replaces "false" with the horizontal index + 1 converted to base 32
                  \n    Store the result in U (saves bytes by not closing braces)
                    ê   palindromize vertically

PowerShell 5.1, 70 69 64 57 Bytes
Thanks Mazzy for -7 bytes
1..9+8..1|%{-join(1..$_+'  '*(9-$_)+' ihgfedcba'[$_..1])}

Turns out gluing it together manually saves a byte. Making it all one mega-join also saves 5 more. Also works by turning a range of ints into a char[] to get the a-i. Using a range over the actual letters is 5 bytes better.

try this: 1..9+8..1|%{-join(1..$_+'  '*(9-$_)+' ihgfedcba'[$_..1])}. Note '  '*(9-$_) contains 2 space symbols

@mazzy ooof, missing that double space trick. I was thinking of a variety of math statements but the obvious solution never occurred to me.

Vyxal, 14 bytes
9ʀṘǔmkrf*ꜝøṗ↵§

Try it online!
Explanation
A transposition approach.
9ʀ             # range from 0 to 9 inclusive
  Ṙ            #  reversed
   ǔ           #  rotated right (last item goes to first)
    m          #  and concatenated with its reverse
     kr        # string of digits, lowercase alphabet, and uppercase alphabet
       f       #  into a list of characters
        *      # repeat (vectorises)
         ꜝ     # remove empty strings in the list
          øṗ   # palindromise each item, center, and join by newlines
            ↵  # split on newlines
             § # vertically join

wow, that's much better than what I had (17-18 bytes)! Very cool answer!

Julia 1.0, 73 bytes
[1:9;8:-1:1].|>i->println(join(1:9)[1:i]*" "^(18-2i)*"abcdefghi"[10-i:9])

Try it online!

MATL, 47 bytes
9l$lRtH2$PhO18Y"yPvv1=49:57 97:105h19T3$X"32b(c

Try it online!

Stax, 18 bytes
â4+╤jo♂▐▀3bkWíæß╝╖

Run and debug it
Explanation:
9R$|[|<Va17T|]r|>\|pm Full program
9R$                   Produce "123456789"
   |[|<               Left-aligned prefixes (["1        ", "12       ", ...])
       Va17T          Produce "abcdefghi"
            |]        Suffixes (["abcdefghi", "bcdefghi", ...])
              r|>     Reverse and left-align (["        i", "       hi", ...])
                 \    Zip both arrays (["1                i", "12              hi", ...])
                  |p  Palindromize array
                    m Map over array, printing each with a newline

Charcoal, 22 17 bytes
Ｇ↗↓←⁹β←Ｇ↖↓⁹⭆χι‖Ｏ↓

Try it online! Link is to verbose version of code. Explanation:
Ｇ↗↓←⁹β

Draw a lower right triangle and fill it using the lowercase alphabet. (The fill is based on tiling the plane with the alphabet and then copying the drawn area.)
←

Move left to draw the numeric triangle.
Ｇ↖↓⁹⭆χι

Draw a lower left triangle and fill it using the digits. (Since the triangle is drawn to the left of the origin, the digits are taken right-justified, so only the digits 1 to 9 get used.)
‖Ｏ↓

Reflect to complete the bottom half.

JavaScript (ES6), 76 bytes
f=(x=y=0)=>y<17?(x>y^x++<17-y?x.toString(36)+[`
`[x%=18]]:' ')+f(x||!++y):''

Try it online!

APL (Dyalog Unicode), 30 bytes
(⊢⍪1↓⊖)(↑,\1↓⎕d),⌽↑,\⌽819⌶9↑⎕a

Try it online!
↑ convert to a matrix (auto pads with spaces)

,\ the prefixes of

1↓ the first element dropped from

⎕d this string '0123456789'

This gives the character matrix

1
12
123
1234
12345
123456
1234567
12345678
123456789

, concatenated with

⌽ the reversed

↑ matrixified

,\ prefixes of

⌽ the reversed

819⌶ and lowercased

9↑ first 9 elements of

⎕a this string 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

This gives the character matrix

        i
       hi
      ghi
     fghi
    efghi
   defghi
  cdefghi
 bcdefghi
abcdefghi

and on this result

1                i
12              hi
123            ghi
1234          fghi
12345        efghi
123456      defghi
1234567    cdefghi
12345678  bcdefghi
123456789abcdefghi

perform the following train (⊢⍪1↓⊖)
⊢ the right argument
⍪ concatenated vertically with
1↓ the first row dropped from (this avoids the repeating of the middle row)
⊖ the right argument reversed vertically

Other solutions
33 bytes
(⊢⍪1↓⊖)(↑,\⍕¨q),⌽↑,\⎕ucs 106-q←⍳9

Try it online!
33 bytes
(⊢⍪1↓⊖)(↑,\⍕¨q),⌽↑,\⌽⎕ucs 96+q←⍳9

Try it online!

V, 25, 21 bytes
¬19¬ai8ñHÄ/á
r ge.YGp

Try it online!
2-4 bytes saved thanks to nmjcman101!
Hexdump:
00000000: ac31 39ac 6169 38f1 48c4 2fe1 0a72 2067  .19.ai8.H./..r g
00000010: 652e 5947 70                             e.YGp

I know all I'm doing is stalking your answers today but I think this works for 23: Try it online!

@nmjcman101 For whatever reason, I can't comprehend how that version works. But I figured out an even shorter one, so thanks!

It went to the end of a /\d* search

J, 44 bytes
(m]\u:49+i.9),.(m=.,}.@|.)]\&.(|."1)u:97+i.9

Try it online!
I tried to generate numerically a mask of 1 and zero to use for indexing, but the cost of getting rid of the extra row was high and I gave up:
   (9-.~i.18){0<:-/~(,|.)i.9
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1
1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1
1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1
1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1
1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1
1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1
1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1
1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1
1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1

Perl 5 + -M5.010, 49 bytes
say 1..9-abs,"  "x abs,(a..i)[-9+abs..-1]for-8..8

Try it online!

QBasic, 87 bytes
An anonymous function that takes no input and outputs to the console.
For y=-8To 8:z=Abs(y):a$="123456789abcdefghi":?Mid$(a$,1,9-z)Spc(2*z)Mid$(a$,10+z):Next

This answer is technically a polyglot, and will function in VBA

Befunge-93, 314 308 bytes
<p0+3*67p0+4*77p0+3*77p0-7*88p0-6*88"#v#v>"
"i        "11g1-21p56+1g1+56+1p28*1g1+28*1p  ^       >25*
"        1"92g1+82p56+2g1-56+2p28*2g1-28*2p91g00g`#v_^   >
"ihgfedcba "93p26*3g1-26*3p">^"88*7-0p88*7-4pv     >25*
"987654321 "14p26*4g1+26*4p26*4g12g`#v_            ^
                             >:#,_@#:<

Try it online!
Golfed 6 bytes by placing a > with the p instruction

Matlab, 122 bytes
function[r]=f,s=[49:57,'a':'i'];r=[];for i=1:9,r=[r;s(1:i),repmat(' ',[1,18-2*i]),s(19-i:18)];end,r=[r;flip(r(1:8,:))];end

Try it Online!

Deadfish~, 956 bytes
{iiiii}dc{dd}iii{c}cccccc{{i}ddd}iiic{{d}i}dddddc{iiii}dcic{dd}ii{c}cccc{{i}ddd}iicic{{d}i}dddddc{iiii}dcicic{dd}i{c}cc{{i}ddd}icicic{{d}i}dddddc{iiii}dcicicic{dd}{c}{{i}ddd}cicicic{{d}i}dddddc{iiii}dcicicicic{dd}dcccccccc{{i}ddd}dcicicicic{{d}i}dddddc{iiii}dcicicicicic{dd}ddcccccc{{i}ddd}ddcicicicicic{{d}i}dddddc{iiii}dcicicicicicic{dd}dddcccc{{i}ddd}dddcicicicicicic{{d}i}dddddc{iiii}dcicicicicicicic{dd}ddddcc{iiiiii}iiiiiicicicicicicicic{{d}i}dddddc{iiii}dcicicicicicicicic{iiii}cicicicicicicicic{{d}i}dddddc{iiii}dcicicicicicicic{dd}ddddcc{iiiiii}iiiiiicicicicicicicic{{d}i}dddddc{iiii}dcicicicicicic{dd}dddcccc{{i}ddd}dddcicicicicicic{{d}i}dddddc{iiii}dcicicicicic{dd}ddcccccc{{i}ddd}ddcicicicicic{{d}i}dddddc{iiii}dcicicicic{dd}dcccccccc{{i}ddd}dcicicicic{{d}i}dddddc{iiii}dcicicic{dd}{c}{{i}ddd}cicicic{{d}i}dddddc{iiii}dcicic{dd}i{c}cc{{i}ddd}icicic{{d}i}dddddc{iiii}dcic{dd}ii{c}cccc{{i}ddd}iicic{{d}i}dddddc{iiii}dc{dd}iii{c}cccccc{{i}ddd}iiic

Try it online!

Julia 1.0, 54 bytes
[8:-1:1;0:8].|>i->print.([1:9-i;" "^2i;'a'+i:'i';"
"])

Try it online!

Haskell, 119 bytes
import Data.Char
main=putStr$do i<-[-8..8];[chr$if abs j>abs i then j+96-fromEnum(j<0)*38else 32|j<-[-9..9],j/=0]++"\n"

Try it online!

Wolfram Language (Mathematica), 81 79 bytes
a=Table[" ",17,18];Do[a[[i;;-i,i]]=a[[1-i;;i-1,i]]=i~IntegerString~35,{i,18}];a

Try it online!
Throws a lot of ignorable errors.

VBA, 75 bytes
An anonymous VBE immediate window function that takes no input and outputs to the console.
For y=-8To 8:z=Abs(y):a="123456789abcdefghi":Mid(a,10-z)=Space(2*z):?a:Next

Jelly, 22 21 bytes
9R€z⁶Zµạ106Ọ$Ṡ¡€Uṭ)ŒḄ

Try it online!
Relies on the (likely) unintended behavior that when Ṡ (sign) acts on a character it yields Python's None. Because of this, Ṡ is a one byte check for whether it's argument is a nonzero integer since None is falsey in Python. If this behavior is changed then OƑ works as well for one more byte.
Function that returns a list of lines.

Java 8, 107 102 bytes
v->{for(int i=1,j;++i<19;)for(j=19;j-->0;)System.out.printf("%c",j>0?j<i^j<20-i?32:106-j-j/10*39:10);}

Port of @Pietu1998's C answer, so make sure to upvote him!
-5 bytes thanks to @ceilingcat.
Try it online.

Python 2, 97 94 bytes
i=o="123456789abcdefghi";c=8
while c:i=i[:c]+' '*(9-c)*2+i[-c:];o=i+'\n'+o+'\n'+i;c-=1
print o

Try it online!
Only posted as an alternative to using eval() and because I finally got it under 100. Basically starts with the middle row then works both up and down at the same time.

Yabasic, 103 bytes
a$="123456789abcdefghi"
For y=-8To 8
z=Abs(y)
?Mid$(a$,1,9-z);
For i=1To z?"  ";Next
?Mid$(a$,10+z)Next

Try it online!

C (gcc), 143 142 127+10=137 136+10=146 113+10=123 (compiler flags) bytes
-1 byte by replacing logical OR with bitwise operator.
-5 bytes thanks to Logern.
+9 bytes to fix the median line, that was output twice.
-23 bytes thanks to ceilingcat
char*s="123456789abcdefghi";G{for(;j<18;++j)putchar(i>j|j>17-i?s[j]:32);puts("");}f(){int i=0,j=0;for(;i++<8;)G;g(i+1,j);for(;i-->1;)G;}

Compiler flag:
-DG=g(i,j)

This macro factorizes the occurences of g(i,j): function declaration and calls.
Try it online!
Different approach than Pietu1998's great answer, more straightforward (and readable), but higher score.
Entry point is function f(); function g() handles the printing of each consecutive line.
Could be made a full program by renaming f to main, but it would yet increase the score.
Pretty version, macro G expanded:
g(i, j) {
    for(; j < 18;++j)
        putchar(i > j | j > 17 - i ? "123456789abcdefghi"[j] : 32);
    puts(""); // Break the line; shorter than putchar(10) or printf("\n")
}
f(i, j) {
    for (i = j = 0; i++ < 8;) // Upper half of the tie
        g(i, j);
    for(; i; --i) // Median line and lower half
        g(i, j);
}

137 bytes - Try it online!

137 but +10 for the compiler flags though

137 is the total, 127 bytes of code and 10 bytes of compiler flags.

Oops sorry, my bad. Updating now!

@Logern I took the liberty to rename the macro to G, to match the function name.

Thanks, really interesting improvement! It's nice to see that old stuff is still active. Included with an extra couple bytes shaved off.

Pascal (FPC), 110 105 bytes
var i:int32;begin for i:=-8to 8do writeln('123456789'[1..9-abs(i)],'abcdefghi'[abs(i)+1..9]:abs(i)+9)end.

Try it online!

PHP, 116 bytes
for(;++$i<18;)echo substr($s='123456789abcdefghi',0,$j=~-10-($k=abs(9-$i))).str_repeat(' ',$k*2).substr($s,-$j)."
";

Output
1                i
12              hi
123            ghi
1234          fghi
12345        efghi
123456      defghi
1234567    cdefghi
12345678  bcdefghi
123456789abcdefghi
12345678  bcdefghi
1234567    cdefghi
123456      defghi
12345        efghi
1234          fghi
123            ghi
12              hi
1                i

Sanbox
Cheers

Lua, 103 bytes
for i=-8,8 do m=math.abs(i)print(("123456789"):sub(1,9-m)..(" "):rep(2*m)..("abcdefghi"):sub(m+1,9))end

Try it online!

///, 163 148 bytes
/w/lm//q/  //j/qqq//k/fghi
1234//l/qqq//m/q//n/dek567//o/i
12/1lwmolwho3llgho34wmk5wek56lnmmcn8mbcn89abcn8mbcnmmcdek56ldek5wekwmfgho3llgholwhi
1lwmi

Try it online!

Raku, 81 bytes
for -8..8 {my \a=(.abs-9).abs;say (1..a).join~' 'x.abs*2~'abcdefghi'.substr(*-a)}

Try it online!


text:
Detect Perfect Pairings
Let's have a function \$f\$ that takes a string and removes all pairs of adjacent identical characters.  For example
\$f(a\color{red}{bb}ba\color{red}{cc}) = aba\$
Note that when two pairs overlap we only remove one of them.
We will call a string perfectly paired if repeated application eventually yields the empty string.  For example the string above \$abbbacc\$ is not perfectly paired because if we apply \$f\$ again we still get \$aba\$.  However a string like \$eabbccadde\$ is perfectly paired because if we apply \$f\$ three times we get the empty string
\$f(ea\color{red}{bbcc}a\color{red}{dd}e) = eaae\$
\$f(e\color{red}{aa}e) = ee\$
\$f(\color{red}{ee}) =\$

Your task is to write perfectly paired computer code that takes a string (of printable ASCII) and decides if it is perfectly paired. The bytestring of your source must be itself a perfectly paired string, although your code doesn't necessarily have to be restricted to printable ASCII.
You may output two distinct values: one for the case where the input is perfectly paired, and another one for cases where it isn't.
This is a code-golf question so answers will be scored by the size in bytes of their source with fewer bytes being better.

Test Cases
\$abbbacc \rightarrow \mathrm{False}\\
abcba \rightarrow \mathrm{False}\\
abab \rightarrow \mathrm{False}\\
abbbaabacc \rightarrow \mathrm{True}\\
eabbccadde \rightarrow \mathrm{True}\\
bbbb \rightarrow \mathrm{True}\$

Is throwing an error valid?

While it may be too late to change it now, I feel like the "twist" part of the challenge is rendered almost pointless if you allow comments or similar "dead" code.

@Geobits I disagree.  For one I think that disallowing dead code is just a mire of vague definitions and never turns out fun anyway.  For two I think allowing comments lowers the bar of entry. For three I believe that the comment-less code will inevitably be better scoring than the comment-full code.  Maybe the twist isn't fun but it would definitely be less fun if I added unenfoceable restrictions to make answers do it in a particular way.

Unary doesn't give a damn about your source restriction rule, mwahahahaha (that is ... as long as the answer has an even number of bytes).

@Shaggy I think the default allows it.  I can't find the post though.  I'll defer to that so if you can find the proper consensus go ahead.

@Geobits One thing that might have encouraged more creative answers is to factor the number of steps to get to the empty string into the scoring.  Using comments tends to cause this number to be quite high because the comments naturally nest where as a lower score requires you to interlace the pairs quite a bit.  Obviously it is too late to make that change though.

Can <empty-string> and <loop-forever> be the two consistent "values"?

@dylnan The empty string can be, looping forever however is not valid output.

@Shaggy I think throwing an error is valid output and you wouldn't even care about the output/return value in the other case, since programs can by default output via exit code. In Javascript's particular case, the output values would be exit code 0 for perfectly paired strings and exit code 1 for non-perfectly paired strings, which are two distinct values therefore fulfilling the criteria.

Can the input be empty? If so, what does it output?

@cairdcoinheringaahing The empty input is true.

Haskell, 146 124 bytes
((""##))
a===bb=bb==a
((aa:bb))##((cc:dd))|aa===cc=bb##dd|1==1=((cc:aa:bb))##dd
a##""=""===a
""##cc=((cc!!00:cc!!00:""))##cc

No comments. Returns either True or False.
Try it online!
Edit: -22 bytes thanks to @Cat Wizard

This is the least haskell like haskell I've ever seen

Python 2, 94 bytes
ss=''

for cc in input():ss=[cc+ss,ss[1:]][cc==ss[:1]]

print''==ss##tnirp[,+[=:)(tupni nirof=

Try it online!
The whole update step ss=[cc+ss,ss[1:]][cc==ss[:1]] cancels to just =[+,[.

05AB1E, 26 24 22 20 18 bytes
-2 bytes thanks to ovs. Outputs 0 if the string is perfectly paired, 1 otherwise.
ΔγʒgÉ}JJ}ĀqqĀÉgʒγΔ

Try it online!

ΔγʒgÉ}JJ}ĀqqĀÉgʒγΔ – Full program.
Δ       }          – Until the result no longer changes:
 γʒ  }               – Split the string into chunks of equal characters and filter by:
   gÉ                – Is the length odd?
      JJ           – And after filtering, join the parts back together, but do this
                     twice to save 2 bytes, as in the previous versions.
         Ā         – Check whether the result is empty
          q        – Terminate (quit) execution. The rest of the code is ignored.
           qĀÉgʒγΔ – Mirror the non-matched part to help with the source layout.

Previous versions
This one purely relies on undefined behaviour (so there's no "dead code"), and outputs [['0']] for perfectly paired strings and [['1']] for non-perfectly matched strings:
ΔγεDgÉ£}JJ}ĀĀ£ÉgDεγΔ

And the 22-byte version, explained, which is just the above but not abusing UB, and yielding sane values.
ΔγεDgÉ£}JJ}ĀqqĀ£ÉgDεγΔ – Full program.
Δ         }            – Until fixed point is reached (starting from the input value):
 γε    }                 – Group equal adjacent values, and for each chunk,
   DgÉ                     – Duplicate, get its length mod by 2.
      £                    – And get the first ^ characters of it. This yields the
                             first char of the chunk or "" respectively for odd-length
                             and even-length chunks respectively.
         JJ                – Join the result to a string, but do this twice to help
                             us with the source layout, saving 2 bytes.
            Ā           – Check if the result is an empty string.
             q          – Terminate the execution. Any other commands are ignored.
              qĀ£ÉgDεγΔ – Mirror the part of the program that isn't otherwise removed
                          anyways. This part forgoes }JJ} because that substring will
                          always be trimmed by the algorithm anyway.

Cubix, 54 bytes
U#;!u1@.Oi>??>i..??O.@1^^...u--u.u!ww;..#..U..;..;!^^!

Outputs nothing if the string is perfectly paired and 1 otherwise.
Try it here
Cubified
      U # ;
      ! u 1
      @ . O
i > ? ? > i . . ? ? O .
@ 1 ^ ^ . . . u - - u .
u ! w w ; . . # . . U .
      . ; .
      . ; !
      ^ ^ !

Explanation
Most of the characters are filler needed to perfectly pair the code. Replacing those with . (no-op), we get
      U # ;
      ! u 1
      @ . O
i . ? . > i . . ? . . .
. . ^ . . . . u - . . .
. . . w ; . . . . . . .
      . ; .
      . ; !
      ^ ^ !

This can be broken into three steps:

Check against the empty string (the left i and the ?).
Loop, throwing characters onto the stack and popping duplicates (everything on the bottom and right).
Check if the stack is empty (the stuff at the top).

V, 20, 18 bytes
òóˆ±òø‚

::‚øò±ˆóò

Try it online!
Hexdump:
00000000: f2f3 88b1 f2f8 820a 0a3a 3a82 f8f2 b188  .........::.....
00000010: f3f2                                     ..                   ....

Outputs 0 for truthy, 1 for falsy. Thanks to nmjcman101 for indirectly saving 2 bytes.
ò        ò        " Recursively...
 ó                "   Remove...
  <0x88>          "     Any printable ASCII character
        ±         "     Followed by itself
          ø       " Count...
           <0x82> "   The number of non-empty strings

::<0x82>øò±<0x88>óò      " NOP to ensure that the code is paired

You could replace ^$ with . and return 0 for truthy, anything else for falsy?  I'm a bit foggy on the rules after not doing this for a while.

I think that would work except that the rules said You may output two distinct values one for the case where the input is perfectly paired and one for otherwise.. That does give me an idea though...

R, 142 126 bytes
Tighter logic and some comment bytes golfed by @Giuseppe
f=function(x,p="(.)\\1")"if"(grepl(p,x),f(sub(p,"",x)),!nchar(x))##x(rahcn!,x,,p(bus(f,)x,p(lperg("fi")"1\\).("=p,x(noitcnuf=f

Try it online!
f=function(x,p="(.)\\1")"if"(nchar(x),"if"(grepl(p,x),f(sub(p,"",x)),0),1)##)1,)0,xp(bus(f,)x,p(lperg("fi",)x(rahcn("fi")"1).("=p,x(noitcnuf=f

Original:
Try it online!
Recursive detector function followed by comment with all the characters in the function in reverse order.

Your code currently throws an error. Here is a working version at 142 bytes.

Thank you. Must have been a cut-and-paste mishap.

126 bytes -- you might be able to compress the comment some more as well...

I am wondering if `\ˋ will simplify or needs to be duplicated in the comments.

@JayCe you'd think it wouldn't need to be in the comments, but try this and it doesn't seem to work. I don't know why.

Yeah of course ˋ\’ is just ˋ\ˋ when inside a string... my bad.

ˋpryr::f’ i think could save you a few bytes here if it accepts recursive functions... the ˋ:ˋ need not be in the comments.

sed 4.2.2, 34 bytes
:;:t;ss((..??\??))\1ss1;t;/..??/cc

Try it online!
Paired strings give empty output, unpaired ones give ct:
The trivial palindromic version is at 32 :;ss(.)\1ss;t;/./cc/./;t;1\).(;:. Old solution was :;ss((..??\??))\1ss1;t;;/./cc/./t: (changed because current one abused c less, edit: yay now there's only 1 character after c :D)
(note that ; is the statement separator)
: declares an empty label
:t declares the label t
ss((..??\??))\1ss1 is a substitution, in sed you can change the delimiter to a substitution, and this is what I did by changing it to s, so what this does is substitute the first (as is denoted by the 1 at the end)

match of ((..??\??))\1

. any character
.?? followed by an optional optional character
\?? and an optional ?
followed by the same thing right beside it

with nothing

Now this substitution is paired with itself, so the ;s before and after it get cancelled out too
t and loop back to the label until there are no more successful substitutions
/..?/ if . (wildcard) followed by .? an optional character is matched

cc change the buffer to c

Add++, 146 bytes
D,g,@~~,L2_|*;;*|_2L,@,g,D
D,ff,@^^,BG€gBF;;FBg€GB,@D1:?:

xx:?

aa:1
`bb
Bxx;;B
Waa*bb,`yy,$ff>xx,`aa,xx|yy,`bb,Byy,xx:yy

O;;O:,B,`,|,`,>$,`,*W`

Try it online!
Fun fact: This was 272 bytes long before the explanation was started, now it beats Java.
Outputs True for perfectly balanced strings, and False otherwise
To my great satisfaction, this beats the boring palindromize version by 2 bytes, to prevent the result being printed twice. I have also aimed to have as little dead code as possible, nevertheless there are still some commented-out sections, and the code exits with an error code of 1, after printing the correct value.
NB : A bug with the BF commands was fixed while this answer was in development.
How it works
The code starts by defining the two key functions, \$\mathit{ff}\$ and \$g\$. These two functions are used to calculate the next step in the process of removing pairs, and work entirely from \$\mathit{ff}\$ i.e. only \$\mathit{ff}\$ is called from the main program, never \$g\$. If we define the input string as \$S\$, \$\mathit{ff}(S)\$ modifies \$S\$ in the following way:
First, identical adjacent characters in \$S\$ are grouped together. For an example of \$abbbaabacc\$, this yields the array \$[[a], [bbb], [aa], [b], [a], [cc]]\$. Over each of the sublists (i.e. the identical groups), we run the function \$g\$, and replace the sublists with the result of the function.
\$g\$ starts by unpacking the group, splatting the characters onto the stack. It then pushes the number of characters on the stack and takes the absolute difference with \$2\$ and that number. We'll call this difference \$x\$. Lets see how this transforms the respective inputs of \$[a]\$, \$[bb]\$ and \$[ccc]\$:
$$[a] \Rightarrow [a, 1]$$
$$[bb] \Rightarrow [b, b, 0]$$
$$[ccc] \Rightarrow [c, c, c, 1]$$
As you can see \$x\$ indicates how many of the next character we wish to keep. For simple pairs, we remove them entirely (yielding 0 of the next character), for lone characters we leave them untouched, or yield 1 of them, and for groups where \$x > 2\$, we want \$x - 2\$ of the character. In order to generate \$x\$ of the character, we repeat the character with *, and the function naturally returns the top element of the stack: the repeated string.
After \$g(s)\$ has been mapped over each group \$s\$, we splat the array to the stack to get each individual result with BF. Finally, the ^ flag at the function definition (D,ff,@^^,) tells the return function to concatenate the strings in the stack and return them as a single string. For pairs, which yielded the empty string from \$g\$, this essentially removes them, as the empty string concatenated with any string \$r\$ results in \$r\$. Anything after the two ;; is a comment, and is thus ignored.
The first two lines define the two functions, \$\mathit{ff}\$ and \$g\$, but don't execute \$\mathit{ff}\$ just yet. We then take input and store it in the first of our 4 variables. Those variables are:

\$\mathit{xx}\$ : The initial input and previous result of applying \$\mathit{ff}\$
\$\mathit{yy}\$ : The current result of applying \$\mathit{ff}\$
\$\mathit{aa}\$ : The loop condition
\$\mathit{bb}\$ : Whether \$\mathit{yy}\$ is truthy

As you can see, all variables and functions (aside from \$g\$) have two letter names, which allows them to be removed from the source code fairly quickly, rather than having a comment with a significant amount of \$\mathit{xyab}\$. \$g\$ doesn't do this for one main reason:
If an operator, such as €, is run over a user defined function \$\mathit{abc}\$, the function name needs to be enclosed in {...}, so that the entire name is taken by the operator. If however, the name is a single character, such as \$g\$, the {...} can be omitted. In this case, if the function name was \$\mathit{gg}\$, the code for \$\mathit{ff}\$ and \$g\$ would have to change to
D,gg,@~~,L2_|*;;*|_2L,@D             (NB: -2 bytes)
D,ff,@^^,BG€{gg}BF;;FB}gg{€GB,@D?:   (NB: +6 bytes)

which is 4 bytes longer.
An important term to introduce now is the active variable. All commands except assignment assign their new value to the active variable and if the active variable is being operated on, it can be omitted from function arguments. For example, if the active variable is \$x = 5\$, then we can set \$x = 15\$ by
x+10 ; Explicit argument
+10  ; Implicit argument, as x is active

The active variable is \$x\$ by default, but that can be changed with the ` command. When changing the active variable, it is important to note that the new active variable doesn't have to exist beforehand, and is automatically assigned as 0.
So, after defining \$\mathit{ff}\$ and \$g\$, we assign the input to \$\mathit{xx}\$ with xx:?. We then need to manipulate our loop conditions ever so slightly. First, we want to make sure that we enter the while loop, unless \$\mathit{xx}\$ is empty. Therefore, we assign a truthy value to \$\mathit{aa}\$ with aa:1, the shortest such value being \$1\$. We then assign the truthiness of \$\mathit{xx}\$ to \$\mathit{bb}\$ with the two lines
`bb
Bxx

Which first makes \$\mathit{bb}\$ the active variable, then runs the boolean command on \$\mathit{xx}\$. The respective choices of \$\mathit{aa} := 1\$ and \$\mathit{bb} := \neg \neg \mathit{xx}\$ matter, as will be shown later on.
Then we enter our while loop:
Waa*bb,`yy,$ff>xx,`aa,xx|yy,`bb,Byy,xx:yy

A while loop is a construct in Add++: it operates directly on code, rather than variables. Constructs take a series of code statements, separated with , which they operate on. While and if statements also take a condition directly before the first , which consist of a single valid statement, such as an infix command with variables. One thing to note: the active variable cannot be omitted from the condition.
The while loop here consists of the condition aa*bb. This means to loop while both \$\mathit{aa}\$ and \$\mathit{bb}\$ are truthy. The body of the code first makes \$\mathit{yy}\$ the active variable, in order to store the result of \$\mathit{ff}(x)\$. This is done with
`yy,$ff>xx

We then activate our loop condition \$\mathit{aa}\$. We have two conditions for continued looping:

1) The new value doesn't equal the old value (loop while unique)
2) The new value isn't the empty string

One of Add++'s biggest drawbacks is the lack of compound statements, which necessitates having a second loop variable. We assign our two variables:
$$\mathit{aa} := \mathit{xx} \neq \mathit{yy}$$
$$\mathit{bb} := \neg \neg (\mathit{yy})$$
With the code
`aa,xx|yy,`bb,Byy

Where | is the inequality operator, and B converts to boolean. We then update the \$\mathit{xx}\$ variable to be the \$\mathit{yy}\$ variable with xx:yy, in preperation for the next loop.
This while loop eventually reduces the input into one of two states: the empty string or a constant string, even when applied to \$\mathit{ff}\$. When this happens, either \$\mathit{aa}\$ or \$\mathit{bb}\$ result in False, breaking out of the loop.
After the loop is broken, it can break for one of two reasons, as stated above. We then output the value of \$\mathit{aa}\$. If the loop was broken due to \$\mathit{x} = \mathit{y}\$, then both the output and \$\mathit{aa}\$ are False. If the loop was broken because \$\mathit{yy}\$ was equal to the empty string, then \$\mathit{bb}\$ is falsy and \$\mathit{aa}\$ and the output are truthy.
We then reach our final statement:
O

The program can now be in one of three states, in all of which the active variable is \$\mathit{bb}\$:

1) The input was empty. In this case, the loop didn't run, \$\mathit{aa} = 1\$ and \$\mathit{bb} = \mathrm{False}\$. The correct output is \$\mathrm{False}\$.
2) The input was perfectly balanced. If so, the loop ran, \$\mathit{aa} = \mathrm{True}\$ and \$\mathit{bb} = \mathrm{False}\$. The correct output is \$\mathrm{False}\$
3) The input was not perfectly balanced. If so, the loop ran, \$\mathit{aa} = \mathrm{False}\$ and \$\mathit{bb} = \mathrm{True}\$. The correct output is \$\mathrm{True}\$

As you can see, \$\mathit{bb}\$ is equal to the expected output (albeit reversed from the logical answer), so we simply output it. The final bytes that help us beat Java come from the fact that \$\mathit{bb}\$ is the active variable, so can be omitted from the argument, leaving us to output either \$\mathrm{True}\$ or \$\mathrm{False}\$, depending on whether the input is perfectly balanced or not.

Japt, 24 22 bytes
Outputs false for truthy and true for falsey.
&&!!e"(.)%1"PP"1%).("e

Try it

Would «e"(.)%1 work?

@Oliver, that's what I originally had before the source restrictions were brought to my attention. Still trying to figure out a way to get it working with «, though.

@Oliver, it doesn't work, sadly.

I suspect you may have missed the [tag:restricted-source]/[tag:source-layout] part of the challenge, @Oliver.

I did...my bad.

A lot of us did, @Oliver!

Retina, 28 26 bytes
+`(.)\1

C`^$

$^`C1\).(`+

Try it online!
Outputs `C1\).(`+0`C1\).(`+ for falsy and `C1\).(`+1`C1\).(`+ for truthy cases.

APL (Dyalog), 38 bytes
''≡{'(.)\1'⎕R''⊢⍵}⍣≡⍝⍝≡⍣}⍵⊢R⎕'1\).('{≡

Try it online!

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

Try it online!
This is a bit of a proof of concept.  It could probably be shorter.  It doesn't use any comments however.
Outputs 0,0 if the input is perfectly paired and 0,1 if the input is not.

Haskell, 66 bytes
null.foldr((%))"";;cc%((r:t))|cc==r=t;;t%s=t:s--s:t=s%=r|t:dlof.un

Try it online!
Cat Wizard saved 6 bytes.

66 bytes

@CatWizard That's some impressive long-distance collapsing.

62 bytes

Brain-Flak, 112 110 108 bytes
(()){{}({<<(({}<<>>)<<>>[({})]){{((<<>>)<<>>)}}{}{##{

}<<>>>>{}<<>>}<<>>)}{}((){{<<>>[[]]}})##}{}])}{([)}(}

Try it online!
This is based on my answer from Are the brackets matched?.
Tried not to use comments, but got stuck trying to make the pop nilads ({}) pair up. The problem lies in the easiest way to pair up a pair of brackets is to surround it in another pair of the same kind. While this is easy for other nilads, the {...} monad creates loops. In order to exit the loop you have to push a 0, but once you've exited the loop, you then have to pop the 0, which compounds the problem.
The 66 byte pre-paired solution is:
(()){{}({<(({}<>)<>[({})]){((<>)<>)}{}{}<>>{}<>}<>)}{}((){<>[[]]})

Try it online!
Outputs 1 or 1,0 if the input is a perfect pairing, 0,0 if not.
No comment version, 156 bytes
(()){{{}({<<(({}<<>>)<<>>[({{}((<<[[]]>>)){}}{}(<<[]>>){{}{}}{})]){{((<<>>)<<>>)}}{{}{}{}}{}{}<<>>>>{}<<>>}<<>>)}}{{}{}}{}((){<<>>[[]]})(<<()()>>){{}{}{}}{}

Try it online!
As Cat Wizard pointed out, the first answer does not work for all interpreters, as not all handle # comments. This version contains no comments.

Note that this only works in the ruby brainflak interpreter and thus is not a pure brainflak answer

@CatWizard Is there a canon Brain-Flak interpreter? As far as I know, Rain-Flak (Ruby) is the original interpreter. (Also, I'm working on a solution without comments)

Not really. Rain-Flak is the original interpreter but it's comments syntax is unique to it.  We wrote a Brain-Flak standard a while back, I don't remember where it ended up though.

@CatWizard Finished the no comment version

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

Try it online!
Outputs nothing if the input is perfectly paired, and 0 otherwise.
Non-perfectly paired (original) version:
{<>(({})<>[({}<>)]){((<()>))}{}{}{}<>}<>{((<>))}{}

Try it online!

JavaScript (ES6), 76 bytes
Returns a boolean.
ff=ss=>ss==(ss=ss.replace(/(.)\1/,''))?!ss:ff(ss)//)(:!?,/1\).(/(ecalper.=(>

Try it online!
Suggested by @Shaggy: 58 bytes by returning an empty string for perfectly paired or throwing an error otherwise.

If one of the "return values" can be an error (waiting for confirmation on that) then this could be 66 bytes.

Programs can by default output via exit code. In this answer's particular case, the possible outputs would be exit code 0 for perfectly paired strings and exit code 1 for non-perfectly paired strings, which are two distinct values therefore fulfilling the criteria; so the 58 byter must be perfectly valid.

Wolfram Language (Mathematica), 70 64 bytes
{#//.{aa___,bb__,bb_,cc___}:>{aa,cc}}=={{}}(**(,{>:}_,{.#{&)**)&

Try it online!
Without comments, 92 bytes
((#//.bb_:>StringReplace[00[ecalpeRgnirtS>aa__:_.#&];bb,{{,}};00>00;00;aa:_~~aa_:>""]))==""&

Try it online!

Haskell, 92 bytes
gg""

gg((aa:cc:bb))dd|aa==cc=gg bb dd

gg  aa""=""==aa

gg  aa((bb:c))=gg((bb:aa))c--c:=c:|

Try it online!
@nimi's answer is pretty cool, it doesn't use any comments. This one is shorter but does use a comment.
@xnor's answer is also pretty cool, it does use comments and is shorter than this one.

Lua, 178 bytes
p=...S={}for a in p:gmatch"."do E=S[#S]~=a;S[E and#S+1 or#S]=E and a or X end;print(#S==0)--)0S#(tnirp;dne X ro a dna E=]S#ro 1+S#dna E[S;a=~]S#[S=E od"."hctamg:p ni a rof}{=S.=p

Try it online!
While it is a terribly long solution, this does make quite a bit of use of Lua-specific quirks. This is actually a minified brute force stack algorithm. The program is made complicated by the fact that Lua's patterns don't allow replacing pairs and regex is not built in.
Explanation:
p=... -- command-line argument
S={} -- the stack
for c in p:gmatch"." do -- shorter than "for i=1,#p do ..."
    E=S[#S]~=c -- check whether we have the right letter on top of stack
    -- could've saved some bytes by doing == instead of ~=
    -- but the double negation is necessary for ternary operator
    -- to work with nil values
    S[E and #S+1 or #S]=E and c or X -- Lua's awesome "ternary operator"
end
-- i'm sure there is a better way to output this (table indexing?)
print(#S==0)

Gol><>, 30 bytes
1ll1**F:}}:{=Q{~~||lzBBzl{Q={F

Try it online!
Everything after the first B is excess code and is not executed. A function that returns the top of stack as 1 if the input is a perfect pairing, 0 otherwise.
Explanation:
1       Push 1 as the end string marker
 ll1**  Push n, where n (len+1)*(len+2),
        This is larger than the amount of steps needed to determine pairing
      F           |  Repeat that many times
       :}}:{=        Compare the first two characters of the string
             Q   |   If they are equal
              {~~    Pop both of them
        String is also rotated by 1
        If the string becomes empty, the 1 is compared to itself and removed.
                   lzB   Return whether the length of the stack is 0
                      Bzl{Q={F  Excess code to match unpaired symbols

Cubix, 30 bytes
1O@;??;@ii??O;>>;;;..1Wcc1??1W

Try it online!
Outputs 1 if the string is perfectly paired and nothing otherwise.
Cubified
      1 O @
      ; ? ?
      ; @ i
i ? ? O ; > > ; ; ; . .
1 W c c 1 ? ? 1 W . . .
. . . . . . . . . . . .
      . . .
      . . .
      . . .

Simplified
      1 O @
      ; ? .
      . @ .
i ? . . . . > ; ; ; . .
. W c . . . ? 1 W . . .
. . . . . . . . . . . .
      . . .
      . . .
      . . .

The logic and general structure are the same as in Mnemonic's answer, but without an explicit check for the empty string.

Jelly, 26 24 22 bytes
ẠƬµF€ḂLḣgŒŒgḣLḂ$$€FµƬẠ

Try it online!
Weirdly seems to work without moving the backwards code to an unused link.
Returns 0 if the input is perfectly paired, 1 otherwise.
Active code:
ŒgḣLḂ$$€FµƬẠ
Œg            Group runs 'abbbcc'->['a','bbb','cc']
       €      For each of these strings:
      $       Monad{
     $            Monad{
   L                  Find the length...
    Ḃ                 ...mod 2.
                      } -> [1, 1, 0] in this example.
  ḣ               Take this many characters from the string.
                  } -> [['a'], ['b'], []]
        F     Flatten -> ['a', 'b']
          Ƭ   Repeat...
         µ    The last monadic chain until a fixed point is reached.
           Ạ  All. If it is not a perfectly paired string, all elements in the
              result of Ƭ will be nonempty and 1 is returned.
              If it is perfectly paired, the last element is [] which is falsy
              and 0 is returned.

Python 2, 114 bytes
import re

e=lambda i,nn=1:e(*re.subn('(.)\\1','',i))if nn else''==i##ieslef'1).('(nbus.er*(e:1=,i adbmal=r tropmi

Try it online!
Returns True for perfectly-paired strings, False otherwise.
(Actually fails to verify itself, because (.) won't match the newlines in the code! But @Cat Wizard said this is okay, because newlines aren't printable ASCII characters, so my program needn't handle them.)

This is a perfectly-paired version of:
import re;p=lambda s,n=1:p(*re.subn('(.)\\1','',s))if n else''==i

for which a “lazier” perfectization of code + '##' + f(code[::-1]) would give 120 bytes. (That is, renaming the variables etc. to introduce more collapsed pairs inside the comment half of the code saved 6 bytes.)

re.subn is a little-known variant of re.sub that returns a tuple (new_string, number_of_substitutions_made). It's pretty good for finding regex substitution fixpoints!

Attache, 82 bytes
{0=#Fixpoint[{Replace[_,/"(.)\\1",""]},_]}??}]_,}],"1).("/,_[ecalpeR{[tniopxiF#=0{

Try it online!
Nothing incredible here. Fixpoints a function which removes consecutive pairs.

Java 8, 158 156 154 bytes
n->{for(;n.matches(".*(.)\\1.*");n=n.replaceAll("(.)\\1",""));return  n.isEmpty();}//};)(ytpmEsi.ruter;,"1).("(Aecalper.n=n;)"*.1).(*."(sehctam.n;(rof{>-n

Returns a boolean (true/false).
-2 bytes thanks to @raznagul.
Try it online.
Explanation:
n->{                              // Method with String parameter and boolean return-type
  for(;n.matches(".*(.)\\1.*");   //  Loop as long as the String still contains pairs
    n=n.replaceAll("(.)\\1","")); //   Remove all pairs
  return  n.isEmpty();}           //  Return whether the String is empty now
//};)(ytpmEsi.ruter;,"1).("(Aecalper.n=n;)"*.1).(*."(sehctam.n;(rof{>-n
                                  // Comment reversed of the source code,
                                  // minus the pairs: '\\';'ll';'\\';'""))';'n  n';'//'

By renaming s to n and adding a second space to return s.isEmpty you can remove s n from the comment, saving 2 bytes in total.