Mad Libs number sequences My robot for generating Mad Libs-style sequence challenges has gone rogue! To defeat it, I need you to write code that can solve all the challenges it can crank out.

Your input is three selections for the blanks A, B, C, each from (1,2,3), specifying the sequence challenge to solve, and the number \$n\$ that's the input to the challenge.

Challenges

Given a positive integer \$n\$, output (A) ________


  A:
    (1) the \$n\$'th
    (2) whether \$n\$ is a
    (3) the smallest number above \$n\$ that's a


positive (B) _______


  B:
  (1) Fibonacci number
  (2) triangular number
  (3) multiple of 3


whose base-10 representation (C) _______


  C:
  (1) starts and ends with the same digit.
  (2) is in sorted order.
  (3) doesn't have any 1's.


Example

Given selections (A, B, C) = (3, 1, 1) and n=13, the challenge is "Given a positive integer \$n\$, output (A3) the smallest number above \$n\$ that's a positive (B1) Fibonacci number whose base-10 representation (C1) starts and ends with the same digit." With input n=13, the Fibonacci numbers bigger than \$13\$ start out as \$21, 34, 55, 89, ...\$, and the first one starting and ending with the same digit is is 55. So you should output 55.

Details


You may take the fill-in-the-blank selections one-indexed (1, 2, 3) or zero-indexed (0, 1, 2).
Note that we're restricting the sequences to positive values, so none of them contain zero. They start as  


Fibonacci: \$1, 1, 2, 3, ...\$  
Triangular: \$1, 3, 6, 10, ...\$  
Multiple of 3: \$3, 6, 9, 12, ...\$  

For choice A1, outputting the \$n\$'th element, \$n\$ is one-indexed. So, the n=1 Fibonacci number is 1, the n=2 Fibonacci number is also 1, n=3 gives 2, and so on.
For deciding whether n is in the sequence (A2), you may use any two consistent outputs decision-problem-style.
You may assume that each sequence has an infinite number of terms meeting each condition C, and not worry about what happens with machine overflows and the like.
For C2, digits in sorted order can have "ties", such as 377.


Test cases



Here are all outputs for every combination with n=10, as (A,B,C), n: result. For these, we use one-indexed selections, and for A2 we use 1/0 for True/False 

(1, 1, 1), 10: 165580141
(1, 1, 2), 10: 89
(1, 1, 3), 10: 987
(1, 2, 1), 10: 1431
(1, 2, 2), 10: 78
(1, 2, 3), 10: 276
(1, 3, 1), 10: 222
(1, 3, 2), 10: 36
(1, 3, 3), 10: 42
(2, 1, 1), 10: 0
(2, 1, 2), 10: 0
(2, 1, 3), 10: 0
(2, 2, 1), 10: 0
(2, 2, 2), 10: 0
(2, 2, 3), 10: 0
(2, 3, 1), 10: 0
(2, 3, 2), 10: 0
(2, 3, 3), 10: 0
(3, 1, 1), 10: 55
(3, 1, 2), 10: 13
(3, 1, 3), 10: 34
(3, 2, 1), 10: 55
(3, 2, 2), 10: 15
(3, 2, 3), 10: 28
(3, 3, 1), 10: 33
(3, 3, 2), 10: 12
(3, 3, 3), 10: 24


The first 10 outputs, n=1 to n=10, for each challenge combination are:

(1, 1, 1): 1, 1, 2, 3, 5, 8, 55, 17711, 63245986, 165580141,
(1, 1, 2): 1, 1, 2, 3, 5, 8, 13, 34, 55, 89,
(1, 1, 3): 2, 3, 5, 8, 34, 55, 89, 233, 377, 987,
(1, 2, 1): 1, 3, 6, 55, 66, 171, 595, 666, 1081, 1431,
(1, 2, 2): 1, 3, 6, 15, 28, 36, 45, 55, 66, 78,
(1, 2, 3): 3, 6, 28, 36, 45, 55, 66, 78, 253, 276,
(1, 3, 1): 3, 6, 9, 33, 66, 99, 111, 141, 171, 222,
(1, 3, 2): 3, 6, 9, 12, 15, 18, 24, 27, 33, 36,
(1, 3, 3): 3, 6, 9, 24, 27, 30, 33, 36, 39, 42,
(2, 1, 1): 1, 1, 1, 0, 1, 0, 0, 1, 0, 0,
(2, 1, 2): 1, 1, 1, 0, 1, 0, 0, 1, 0, 0,
(2, 1, 3): 0, 1, 1, 0, 1, 0, 0, 1, 0, 0,
(2, 2, 1): 1, 0, 1, 0, 0, 1, 0, 0, 0, 0,
(2, 2, 2): 1, 0, 1, 0, 0, 1, 0, 0, 0, 0,
(2, 2, 3): 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
(2, 3, 1): 0, 0, 1, 0, 0, 1, 0, 0, 1, 0,
(2, 3, 2): 0, 0, 1, 0, 0, 1, 0, 0, 1, 0,
(2, 3, 3): 0, 0, 1, 0, 0, 1, 0, 0, 1, 0,
(3, 1, 1): 2, 3, 5, 5, 8, 8, 8, 55, 55, 55,
(3, 1, 2): 2, 3, 5, 5, 8, 8, 8, 13, 13, 13,
(3, 1, 3): 2, 3, 5, 5, 8, 8, 8, 34, 34, 34,
(3, 2, 1): 3, 3, 6, 6, 6, 55, 55, 55, 55, 55,
(3, 2, 2): 3, 3, 6, 6, 6, 15, 15, 15, 15, 15,
(3, 2, 3): 3, 3, 6, 6, 6, 28, 28, 28, 28, 28,
(3, 3, 1): 3, 3, 6, 6, 6, 9, 9, 9, 33, 33,
(3, 3, 2): 3, 3, 6, 6, 6, 9, 9, 9, 12, 12,
(3, 3, 3): 3, 3, 6, 6, 6, 9, 9, 9, 24, 24,
JavaScript (ES6),  158 ... 145  144 bytes
Takes input as (a,b,c,n), with \$a\$, \$b\$ and \$c\$ 0-indexed.

(a,b,c,n)=&gt;(g=x=&gt;[(d=[...x+''],i+=C=![d[0]-x%10,d+''&gt;d.sort(),/1/.test(x)][c])&gt;n,x&gt;=n,x&gt;n&amp;C][a]?a-1?x:C&amp;x==n:g([y,x+y,x+3][b],y+=b||x))(i=0,y=1)

Try it online!
Commented
(a, b, c, n) =&gt; (              // given the challenge parameters ...
  g = x =&gt;                     // g is a recursive function taking the current value x
    [                          // this is the array for A
      (                        //   a = 0:
        d = [...x + ''],       //     d[] = array of digits in x
        i += C =               //     increment i if C is true
          ![                   //     set C if the condition is false:
            d[0] - x % 10,     //       c = 0: the 1st and the last digits are not equal
            d + '' &gt; d.sort(), //       c = 1: the digits are not in sorted order
            /1/.test(x)        //       c = 2: there's a '1' in x
          ][c]                 //     pick the relevant condition for C
      ) &gt; n,                   //     exit if i is greater than n
      x &gt;= n,                  //   a = 1: exit if x is greater than or equal to n
      x &gt; n &amp; C                //   a = 2: exit if x is greater than n and C is true
    ][a]                       // pick the relevant condition for A
    ?                          // if we're done:
      a - 1 ? x                //   if a is not equal to 1, return x
            : C &amp; x == n       //   otherwise, test whether C is true and x is equal to n
    :                          // else:
      g(                       //   do a recursive call:
        [                      //     update x:
          y,                   //       b = 0: x = y (Fibonacci)
          x + y,               //       b = 1: x += y (triangular numbers)
          x + 3                //       b = 2: x += 3 (multiples of 3)
        ][b],                  //     pick the relevant update for B
        y += b || x            //     if b = 0, add x to y (for Fibonacci)
                               //     otherwise, add b to y (we actually just need to
                               //     add 1 for triangular numbers; for multiples of 3,
                               //     y is ignored anyway)
      )                        //   end of recursive call
)(i = 0, y = 1)                // initial call to g with x = i = 0 and y = 1