[Question]
  [
# Introduction
Everyone knows the FizzBuzz sequence. It goes something like this:
```
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
.
.
.
```
In case you don't know, if the number is divisible by 3, it's `Fizz`. If it is divisible by 5, it's `Buzz`. If it is divisible by both, it's `FizzBuzz`. If it is not divisible by both, it's just the original number.
# Task
Take two inputs, for example (space separated here)
```
Fizz 3
```
For this specific example input, you should output `9`, the third `Fizz`. To be more general, take a `word` and a `number`, output the `number`th `word`.
The `word` input may be `Number`, and in this case, you should output the `number`th number in the FizzBuzz sequence that is not `Fizz`, `Buzz`, or `FizzBuzz`.
You may choose any 4 distinct, consistent inputs representing `Fizz`, `Buzz`, `FizzBuzz` and `Number`.
# Test Cases
```
Fizz 3 => 9
Buzz 4 => 25
FizzBuzz 2 => 30
Number 312 => 584
```
# Scoring
Shortest code wins!
# Rules
* No standard loopholes.
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 10 bytes
```
³3,5ḍḄ⁼ʋ#Ṫ
```
[Try it online!](https://tio.run/##y0rNyan8///QZmMd04c7eh/uaHnUuOdUt/LDnav@/zdQ0LVT8CvNTUot4jIEsZ1Kq6q4jEAst0wgyxjGAon/N/hvCgA "Jelly – Try It Online")
This uses `0 = Number`, `1 = Buzz`, `2 = Fizz` and `3 = FizzBuzz`
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
1g15=ɗ#Ṫ
```
[Try it online!](https://tio.run/##y0rNyan8/98w3dDU9uR05Yc7V/0H8v6bAgA "Jelly – Try It Online")
Thanks to [Lynn](https://codegolf.stackexchange.com/users/3852/lynn). This uses `1 = Number`, `3 = Fizz`, `5 = Buzz`, `15 = FizzBuzz`. Included separately as the numbers could encode extra data
## How they work
```
³3,5ḍḄ⁼ʋ#Ṫ - Main link. Takes W=0,1,2,3 on the left, n on the right
       ʋ   - Last 4 links as a dyad f(k, W):
 3,5ḍ      -   Divisible by 3 or 5? Yields [0,0], [0,1], [1,0], [1,1]
     Ḅ     -   From binary; Yields 0, 1, 2, 3
      ⁼    -   Equals W?
³       #Ṫ - Starting from W, count up k = W, W+1, ..., returning the nth integer such that f(k, W) is true
```
```
1g15=ɗ#Ṫ - Main link. Takes W=1,3,5,15 on the left, n on the right
     ɗ   - Last 3 links as a dyad f(k, W):
 g15     -   GCD(k, 15)
    =    -   Does that equal W?
1     #Ṫ - Count up k = 1, 2, ..., returning the nth integer such that f(k, W) is true
```
[Answer]
# JavaScript (ES6), 44 bytes
Expects `(s)(n)` with s=0 for *Number*, s=1 for *Fizz*, s=2 for *Buzz* and s=3 for *FizzBuzz*.
```
(s,k=0)=>g=n=>n?g(n-=s==!(++k%3)+2*!(k%5)):k
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@1@jWCfb1kDT1i7dNs/WLs8@XSNP17bY1lZRQ1s7W9VYU9tIS1EjW9VUU9Mq@39yfl5xiYJfqK@Ta5CCrYKBNRdExM0zKgrIN4TxnULBfCNkeaiYsTUXWDA/J1UvJz9dI00DJKmpYaypqQAC@voKlmgKQDo1NUwQCoxMsRgBUWUEVAVUYWyApgLiZqA1hlAVphYm/wE "JavaScript (Node.js) – Try It Online")
---
### Cheaty version, 35 bytes
Expects 4680 for *Fizz*, 1056 for *Buzz*, 1 for *FizzBuzz* and 27030 for *Number*.
```
(s,k=0)=>g=n=>n?g(n-=s>>++k%15&1):k
```
[Try it online!](https://tio.run/##bc5dC4IwFAbge3/FbooNM8/86JMtCAq6qIvAG@/KVMrYIqO/b3MzDekwdvWc97y30/tUJs/r4@UIeUmrjFW4HBUMCOM5E4yLVY6Fw0rObbsY0HBIyaKoEinKF9ru4hjVw1AwmcESIddFcAagPw8sg9dRiymEkw4bZb4vrpP1gsJLvdXibmiDD9F@vTnqZG8KvuqhMaW6gW6hfktreU/Hd5njDNcnCPYJ@cbPe6C@T3DQAS/8E2GUp5QSPvSEqabO0EaEs6D6AA "JavaScript (Node.js) – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 47 bytes
```
f=lambda n,c,k=1:n and-~f(n-(k**4%15==c),c,k+1)
```
[Try it online!](https://tio.run/##TY3BCoMwEETvfsVeColdIZtYD0K@RDyksWnFukrw0kt/PTUttL0MPOYNsz6228I6pWDvbj4PDhg9TpZaBsdD9QyCKzGVZX2gk7Ve5vZIMoUlgoeRoSNskBSqvi1gjSNv3b5BLyErnJXo@HoRhGBI9kXxlj4JQRiERn6pRiD1Q43wR4Y07tcv "Python 2 – Try It Online")
Take in the category label `c` as:
```
Number -> 1
Fizz -> 6
Buzz -> 10
FizzBuzz -> 0
```
We fingerprint the category for `k` using `k**4%15`, which produces the corresponding value as listed above. This is wrapped in a [recursive function for the n'th number meeting a condition](https://codegolf.stackexchange.com/a/91128/20260).
---
**[Python 2](https://docs.python.org/2/), 54 bytes**
```
lambda n,c:([n*7/8-3*~n/4%2,~-n/4,~-n/2,0][c/2%4]+n)*c
```
[Try it online!](https://tio.run/##TYzBDoIwEETvfMVeSFpcUreFaEj8ktoDVqskuBDCxQu/Xgsm6mUmb/Iy42t@DKxjOJ1j3z4v1xYYfSMsFwd1LE2xsKpyjUuZekuNe2e90nnldiwLH8MwgYeOwRIarJFq12QwTh3PNoj0JmFVeFWmlu83QQiGpMuyTfokBGHSLL9UIdQ/0gj0h4Y0koxv "Python 2 – Try It Online")
A short at writing direct formulas for each case, with input `c` as one of `1,3,5,15`.
[Answer]
# [Perl 5](https://www.perl.org/) -p, ~~52~~ 47 bytes
Saved 5 bytes thanks to @Dom Hastings.
```
/ /;$_=332312332132330x$';/(.*?$`){$'}/g;$_=pos
```
[Try it online!](https://tio.run/##K0gtyjH9/19fQd9aJd7W2NjI2NAISBoCGcYGFSrq1voaelr2Kgma1SrqtfrpIEUF@cX//xspGHMZKphwGSgYcRkrADX9yy8oyczPK/6vm1iQAwA "Perl 5 – Try It Online")
Where 0=FizzBuzz, 1=Buzz, 2=Fizz, 3=Number in the first of the two inputs. Finds the position of the n'th occurrence of what's wanted with a regexp search in a repeated 15 char string encoding number, fizz, buzz and fizzbuzz in their right places.
[Answer]
# [Python 2](https://docs.python.org/2/), 51 bytes
```
lambda d,n,k=0:n and-~f(d,n-(k%3/2*2+k%5/4==d),k+1)
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSFFJ08n29bAKk8hMS9Fty5NAyigq5GtaqxvpGWkna1qqm9ia5uiqZOtbaj5v6AoM69EI03DWEfBSFNTQVnBLbOqyqm0qooLJmOko2AMl4GLGuoomIBFUdQaANUaQszxK81NSi36DwA "Python 2 – Try It Online")
-2 bytes thanks to AnttiP; becomes -4 using Python 2  
-3 bytes thanks to ovs
0 for Number, 1 for Buzz, 2 for Fizz, 3 for FizzBuzz.
[Answer]
# [R](https://www.r-project.org/), ~~56~~ ~~54~~ 52 bytes
*Edit: -4 bytes thanks to pajonk*
```
function(n,i){while(n<-n-!(!T%%3)-i+2*!T%%5)T=T+1;T}
```
[Try it online!](https://tio.run/##K/qfV5IRn5ZZVZVUWlVl@z@tNC@5JDM/TyNPJ1OzujwjMydVI89GN09XUUMxRFXVWFM3U9tIC8Q01QyxDdE2tA6pRTFCw1jHUFNBWcENyFcwVrC1U7DkQpE30TECyTsB2QomIHkjU1QFRjrGMAPAioxAiowNUBUZGxrpGICU@ZXmJqUWKQD5IGWmFib/AQ "R – Try It Online")
~~This really seems to have too many parentheses...~~  
*Edit: This is really pajonk's answer, now, after removing all the useless parentheses that I left in the original...*
[Answer]
# [Python 2](https://docs.python.org/2/), 77 bytes
0 for *Number*, 1 for *Buzz*, 2 for *Fizz*, 3 for *FizzBuzz*. The formula for *Number* is taken from [A229829](http://oeis.org/A229829).
```
t,n=input()
g=n-1
print[g/8*15+g%8*12/5+1+g%8/-3,(n+g/4)*3,(n+g/2)*5,n*15][t]
```
[Try it online!](https://tio.run/##LYxBCsMgEEX3nmI2xagTrGOEUsgtugtZFTFCmUowpD19aqCr9x58fvnW5c107Et@RXisW7xD/MQnSCmPijxmLlvtlEgj906UNXOdkr1pF0y6NJANxp1qe48dm2QHpf9GSgfkNp2nOh/no0PwghAG4RFIXFs6@gE "Python 2 – Try It Online")
[Answer]
# [05AB1E (legacy)](https://github.com/Adriandmen/05AB1E/tree/fb4a2ce2bce6660e1a680a74dd61b72c945e6c3b), 9 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
µN53SÖ2βQ
```
First input is the \$number\$; second is a digit \$0\$ for `Number`, \$1\$ for `Fizz`, \$2\$ for `Buzz`, and \$3\$ for `FizzBuzz`.
Uses the legacy version of 05AB1E, because it'll implicitly output the index `N` after a while-loop `µ`. In the new 05AB1E version, an explicit trailing `}N` should be added to accomplish that.
[Try it online](https://tio.run/##MzBNTDJM/f//0FY/U@Pgw9OMzm0K/P/fmMsQAA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9W6WJ/bqtfppJfaW5SapGCW2ZVlYJTKZAAsUAMJeXKwytqaw9vOLxXSUHj8H5NhUdtkxSU7CsTQv8f2upnahx8eJrRuU0Rgf9r/XT0Dm39Hx1trGMYq6MQbaJjBKKMdIxBlLGhkY5BbCwA).
**Explanation:**
```
µ          # Loop until the counter_variable is equal to the first (implicit) input
 N         #  Push the loop-index
  53S      #  Push [5,3]
     Ö     #  Check if the loop-index is divisible by either 5 or 3
           #  (resulting in [0,0], [1,0], [0,1], or [1,1])
      2β   #  Convert it from a base-2 list to an integer
           #  ([0,0],[1,0],[0,1],[1,1] will become 0,1,2,3 respectively)
        Q  #  And check if it's equal to the second (implicit) input
           #  (if this is truthy: implicitly increase the counter_variable by 1)
           # (after the loop, the loop-index `N` is output implicitly)
```
---
# [05AB1E (legacy)](https://github.com/Adriandmen/05AB1E/tree/fb4a2ce2bce6660e1a680a74dd61b72c945e6c3b), 6 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
µN15¿Q
```
First input is the \$number\$; second is an integer \$1\$ for `Number`, \$3\$ for `Fizz`, \$5\$ for `Buzz`, and \$15\$ for `FizzBuzz`.
Port of [*@Lynn*'s Jelly comment](https://codegolf.stackexchange.com/questions/239702/nth-fizzbuzz-number#comment541531_239706) (I now also notice my original program above uses a similar approach as [*@cairdCoinheringaahing*'s 10-bytes Jelly program](https://codegolf.stackexchange.com/a/239706/52210), even though we came up with it independently. Not too surprising, since it's a pretty straight-forward approach.)
[Try it online](https://tio.run/##MzBNTDJM/f//0FY/Q9ND@wP//zfmMgYA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9W6WJ/bqtfppJbZlWVglMpkACxwAy/0tyk1CIl5Uprm8MramsPbzi8V0lB4/B@TYVHbZMUlOwrE0L/H9rqZ2h6aH9E4P9aPx29Q1v/R0cb6xjH6ihEm@iYgigjHUMwbWwIZMXGAgA).
**Explanation:**
```
µ       # Loop until the counter_variable is equal to the first (implicit) input
 N      #  Push the loop-index
  15¿   #  Get the GCD (Greatest Common Divisor) of this index and 15
     Q  #  And check if it's equal to the second (implicit) input
        #  (if this is truthy: implicitly increase the counter_variable by 1)
        # (after the loop, the loop-index `N` is output implicitly)
```
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), 60 bytes
```
L$`^.
$'*$&¶$'*$(NNFNBFNNFBNFNNZ
L$`(.)+¶(?<-1>.*?\1)+
$.>%`
```
[Try it online!](https://tio.run/##K0otycxLNPyvquGe8N9HJSFOj0tFXUtF7dA2EKXh5@fm5@QGJJ2ADL8oLqAKDT1N7UPbNOxtdA3t9LTsYww1tblU9OxUE/7/dzPmcjLhijLi8jM2NAIA "Retina – Try It Online") Link includes test cases. Takes input as the letter `F`, `B`, `Z` or `N` followed by the number `n`. Explanation:
```
L$`^.
```
Match the letter. At this point, `$'` refers to the number `n` following it.
```
$'*$&¶$'*$(NNFNBFNNFBNFNNZ
```
Repeat the letter `n` times, then on the next line repeat the Fizz Buzz sequence `15n` times.
```
L$`(.)+¶(?<-1>.*?\1)+
```
Match `n` copies of the letter on the first line, and use those to find the `n`th match of the letter on the second line.
```
$.>%`
```
Output the offset (`.``) of the end (`>`) of the match relative to the start of the second line (`%`).
[Answer]
# [Desmos](https://desmos.com/calculator), ~~112~~ 99 bytes
Input into the function \$f(n,k)\$, where \$n\$ is the number, and \$k\$ is the word.
Number = 0, Fizz = 3, Buzz = 5, FizzBuzz = 15
```
h(n)=floor(n)
a=mod(n-1,8)
f(n,k)=\{k=0:15h(n/8-1/8)+2a+h(2a/5+1)-h(a/3+2/3),k=15:kn,kn+kh(kn/15)\}
```
[Try It On Desmos!](https://www.desmos.com/calculator/nibnotpzok)
[Try It On Desmos! - Prettified](https://www.desmos.com/calculator/tajkd7nadz)
Uses formula in [OEIS A229829](http://oeis.org/A229829):
`a(n) = 15*floor((n-1)/8) +2*f(n) +floor((2*f(n)+5)/5) -floor((f(n)+2)/3), where f(n) = (n-1) mod 8.`
99.99% sure this could be golfed. Maybe I could shorten the OEIS formula somehow.
[Answer]
# [Husk](https://github.com/barbuz/Husk), 8 bytes
```
!¥⁰m⌋15N
```
[Try it online!](https://tio.run/##yygtzv7/X/HQ0keNG3If9XQbmvr9///f@L8pAA "Husk – Try It Online")
Input as `1`=number, `3`=Fizz, `5`=Buzz, `15`=FizzBuzz. Same approach as [Lynn's comment to caird coinheringaahing's answer](https://codegolf.stackexchange.com/a/239706/95126).
---
Alternative versions with successively less pre-processing squeezed into the values chosen as input:
**12 bytes**, with input as `[0,0]`=number, `[1,0]`=Fizz, `[0,1]`=Buzz & `[1,1]`=FizzBuzz.
```
!fo≡⁰§e¦3¦5N
```
[Try it online!](https://tio.run/##ASMA3P9odXNr//8hZm/iiaHigbDCp2XCpjPCpjVO////WzEsMF3/NQ)
The [Husk](https://github.com/barbuz/Husk) `congr` command - `≡` - checks whether two lists have the same distribution of truthy/falsy elements: in this case, divisibility (`¦`) by `3` and `5`.
or **14 bytes**, finally with input just as `0`=number, `1`=Fizz, `2`=Buzz & `3`=FizzBuzz.
```
!¥mȯḋm¬§e%5%3N
```
[Try it online!](https://tio.run/##ASMA3P9odXNr//8hZm/iiaHigbDCp2XCpjPCpjVO////WzEsMF3/NQ)
Treats list of not-modulo (`¬` & `%`) 3 or 5 as binary digits (`ḋ`).
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 8 bytes
```
15ġ⁰=)ȯt
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJBIiwiIiwiMTXEoeKBsD0pyK90IiwiIiwiMywgM1xuNCwgNVxuMiwgMTVcbjMxMiwgMSJd)
Port of the other answers.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 22 bytes
```
Ｉ⊕§⌕Ａ×”{⊞‴¡*ＲX⭆eＲ”ＮＳ⊖θ
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMM5sbhEwzMvuSg1NzWvJDVFw7HEMy8ltULDLTMvxTEnRyMkMze1WEPJz8/Nz8kNSDoBGX5RSjoKnnkFpSV@pblJqUUamppQfnAJ0NR0MN8lFWFooSYIWP//b2xopOD3X7csBwA "Charcoal – Try It Online") Link is to verbose version of code. Takes the number as the first input and one of the letters `F`, `B`, `Z` or `N` as the second input. Explanation:
```
      ...       Compressed string `NNFNBFNNFBNFNNZ`
     ×          Repeated by
         Ｎ      First input as a number
   ⌕Ａ           Find all indices of
          Ｓ     Second input
  §             Indexed by
            θ   First input
           ⊖    Decremented
 ⊕              Incremented
Ｉ               Cast to string
                Implicitly print
```
]