[Question]
  [
# Context
Consider the following sequence of integers:
$$2, 10, 12, 16, 17, 18, 19, ...$$
Can you guess the next term? Well, it is \$200\$. What about the next? It is \$201\$... In case it hasn't become obvious to you, this is the sequence of positive integers whose name starts with a letter `D` in Portuguese.
# Task
Given a positive integer \$n\$, decide if it belongs in the sequence or not. An algorithm to do so is given next to the Output section.
# Input
A positive integer \$n\$, no greater than \$999999999\$.
# Output
A truthy/falsey value, representing whether or not the input belongs in the sequence. Truthy if it does, falsey if it doesn't. Truthy/falsey can't be switched for this challenge.
For \$0 < n < 10^9\$, here's how to determine if \$n\$ is part of the sequence. If \$9 < n\$, say \$ab\$ are its two leading digits, so that if \$n = 583\$, \$a = 5\$ and \$b = 8\$. If \$n < 10\$ then \$a = n\$. Let \$k\$ be the number of digits of \$n\$, so that if \$n = 583\$, \$k = 3\$. \$n\$ is in the sequence if any of these hold:
* \$a = 2\$ and \$k = 1, 3, 4, 6, 7, 9\$;
* \$ab = 10, 12, 16, 17, 18, 19\$ and \$k = 2, 5, 8\$
Please notice that standard loopholes are forbidden by default, in particular trivialising the challenge by using a language with a trivial numeric type.
(The rules above generalise trivially for \$n\$ arbitrarily big but I capped the input for simplicity)
# Test cases
## Truthy
```
2
10
12
16
17
18
19
200
201
223
256
10000
10100
10456
10999
12000
12180
12220
16550
17990
18760
19000
200000
212231
256909
299999
10000000
10999999
12000000
12999999
16000000
16562345
16999999
17000000
17999999
18000000
18999999
19000000
19999999
200000000
200145235
200999999
201000000
245345153
299999999
```
## Falsy
```
1
3
4
5
6
7
8
9
11
13
14
15
20
100
1000
1200
1600
1738
1854
1953
20000
21352
120000
160000
170000
180000
190000
20000000
100000000
120000000
160000000
170000000
180000000
190000000
999999999
```
---
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so shortest submission in bytes, wins! If you liked this challenge, consider upvoting it! If you dislike this challenge, please give me your feedback. Happy golfing!
  
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 42 bytes
Of course there is a built-in for this...  
And as @Charlie mentioned we can golf `"Portuguese"` to `"Spanish"` and save 3 bytes
```
#~IntegerName~"Spanish"~StringTake~1=="d"&
```
[Try all test cases](https://tio.run/##dVGxasMwEN3zFcWFTheikyxZNxgyFbqUlmQLGURrbNM6lEQZSql/3T3LkjJV4MfxTnp373lwvmsG5/s3N7X1dD8@nXzTNudnNzRjsftyp/7SFePOn/tTu3cfzYh1XbwXD9MLM/5QrNfr/fnqu28uiuPq9do3/hB6d5ttu9n@SEAByGgAK0ALSCCF4A9BSgVSc0PwYcSAZWCIiJ8FXqKdUUpGozVjRcRoK8NIIqgFCcm3FM6aJHgMUVARy1lEs@4inRiTGKONVKXmIrWq1KoSYxNjE0OJocjECctqWGqp9FzlLqZuqXkaagWruAvR73F1S/fRfV7@DRdBQQkaDFRggfdAQAVYAs7TYMkz@AzWggnFv8BqvkI8VMbYlJYxlRhFtB29RoPZVc5U5CxFzlDkyESOSuSIBNDN5zT9AQ "Wolfram Language (Mathematica) – Try It Online")
-13 bytes from @att
[Answer]
# perl -plF, 55 41 bytes
Using ideas from @Dom Hastings, and eliminating common expressions:
```
$x=@F=~/[258]/;$_=/^2/&!$x|/^1[026-9]/&$x
```
[Try it online!](https://tio.run/##PVBBagMxDLzrF4Ult2BJtmyLstBTPhGSnnoohGZpe9hDydOzlb22DR7skT0azfLxfZNtm9b57TQ/3JklX9zr9D67K7vDy7T@uSudkeNRL@4wrdvGQAhkGIESUAZSYETbBMweWKyAtgypYqiMqtq3yjPlgsyGUcQwqRrmFA0Vq1qVYHvlqWgqWhvVqoL72kWH7i7dmdiZKJF9EDv0Uuql1JncmdwZ7Yw2pnXYrVEQ9lJOo0q9GsS6kfjmtqqBhwACERJksDsBeaAAVDRgT6m6r4arNW/BZrEnWqRaGF64zdoGbMO0CZrt4XUkhSMhHMngCAJHADgGR@ju9Xlffj/vXz/bcbmd/gE "Perl 5 – Try It Online")
## How does it work?
Due to the `-F` option, the input is split on characters which are put in the array `@F`. So, if we use `@F` in scalar context, we have the length of the number.
First, we set `$x` to true if the number contains 2, 5, or 8 digits (it's given the number is at most 9 digits).
The rest is straightforward. We check whether the number starts with `2`, and does not contain 2, 5, or 8 digits, or whether it starts with `10`, `12`, `16`, `17`, `18`, or `19`, and contains 2, 5 or 8 digits.
[Answer]
# [Python 2](https://docs.python.org/2/), 48 bytes
```
lambda n:988164-2**200>>n/1000**(len(`n/3`)/3)&1
```
[Try it online!](https://tio.run/##PVBda8MwDHzXr@jTSAIjkvypwvpL9tCWtbSQOmV0jP36THFsG3w4J@V0uuff6zYnXq4fn8t0epy/Tru0lxjJ23ceBkY8HNJIiDgM3XRJ3TGN5tiPpn@j5fd2ny472j@/7@m1O8/z1F27e3r@vLq@7xcGQiBFDxSAIpCACuolYDbATguqrE1IGW1mRER/yzxTXJFZ0TunGEQUY/CKglktS7B2GVo1BXWMSFbB7WyiTXeTroyvjHeejXX6qKVQS6EysTKxMlIZKUyZsFkj69i49dWqVKvW6TRyprjNamDAggMPASLoNwEZIAu0asCWUnafDWdrRoONTltklSphGMdl17JgWaZsUGw3ry0pbAlhSwZbENgCwLY4gjT7/w "Python 2 – Try It Online")
**[Python 2](https://docs.python.org/2/), 50 bytes**
```
f=lambda n:f(n/1000)if n>299else 988164>>n&1|n/200
```
[Try it online!](https://tio.run/##PVDLboQwDLz7KzhVcFrbeRCvVP5lVwUtEg2rLVVVqf9OTUiCxCgZO@PxPH@3xxp536f35fZ5/7g18Tq18UKI2M1TEwcWGZevsZEQyNthiG/0Fy@MuP885mVs6Pp8zXFr7uu6tFM7x@f31nZdtzMQAil6oB4oAAnoM/0JmA2w04KO0SakhDYxIqLPEs8UDmRW9M4p9iKKofeKgkktSbB2GTo0BXWMSFLB8ztFq@4pXRhfGO88G@v0UEp9KfWFCYUJhZHCSGbyhNMaWcfGHadapVK1TqeRM9ltUgMDFhx46CGA3gnIAFmgQwPOlJL7ZDhZMxpscNoih1QOwzjOu@YF8zJ5g2y7eq1JYU0IazJYg8AaANbFEaTa/wc "Python 2 – Try It Online")
An arithmetic solution. Chomps down `n` to a three-digit number by repeatedly removing the last 3 digits. Then, checks that the remaining three-digit number is one of `[2,10,12,16,17,18,19]`, or is between 200 and 299.
The `[2,10,12,16,17,18,19]` is checked against the set bits of a binary number, `988164`.
The `200≤n<300` check is simplified by making the `≥300` case never happen. We keep chomping groups of 3 digits if the number is at least 300 (rather than at least 1000), making the 300-999 case go to 0. This leaves us with a `200≤n` check that we do simply as `n/200`.
You might wonder why the `if/else` isn't shortened to `and/or` as usual, but the output potentially being truthy or falsey doesn't play nicely here.
**53 bytes**
```
import re
re.compile("(2|1[026-9]|2..)(...)*$").match
```
[Try it online!](https://tio.run/##PVDLasQwDLzrK8LSg1NokOTYsQr9ktJDu@yygc2DNKUU9t9TxbFtyOCM5NFo5r/1No28bf0wT8taLRe4vi2X5jwNc3@/mJPhB70j@xf5eHDT1KZReH461c3wuZ5v2@9N2yp6nZd@XKuvabqbq/leF9OP889qaj0bAyGQogfqgAKQACPqR8BsgZ0WUI8iRWwjIyL6LPJMYUdmRe@cYieiGDqvKBjVogRrl6VdU1DHiEQVPM4hWnQP6cz4zHjn2bZOL7nU5VKXmZCZkBnJjCQmTTisUevYuv1WqpSrrdNp5GxyG9XAQgsOPHQQQP8JyAK1QLsGHClF99FwtGY12OC0RXapFIZ1nHZNC6Zl0gbJdvFaksKSEJZksASBJQAsiyNIsf8P "Python 2 – Try It Online")
Porting [Neil's Retina solution](https://codegolf.stackexchange.com/a/213695/20260). Takes input as a string. Thanks to n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ for saving a byte and Sisyphus for saving two.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~25~~ ~~21~~ ~~20~~ ~~19~~ 18 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
2Ž Ć.¥T+ªƵžIgåèÅ?à
```
-1 byte thanks to *@ovs* and -1 byte after being inspired by *@ovs* in the comments
[Try it online](https://tio.run/##yy9OTMpM/f/f6OhehSNteoeWhmgfWnVs69F9numHlx5ecbjV/vCC//8NLS0NgcAIAA) or [verify all test cases](https://tio.run/##PVA7TkQxDLzK07ZYyHbiJK7eJegQBUgIUVEgIb0DsAfgBNushOgpodjHchAu8nC@kTJKxsl4PE/Pt3eP99vLMu@mv/3btJuXjc9f08/@8nS8ujh9/H6ev5eH9bi@r6/zethgu2YgBDIMQBEoASkwom0CZgcsVkBbhlTQF0ZV7VvhmVJGZsMgYhhVDVMMhopFrUiwvXKUNRWtjWpRwbqq6NCt0p0JnQkS2HmxQy/FXoqdSZ1JndHOaGNah2qNvLCTfBpV6lUv1o3ENbdFDRx4EAgQIYHdCcgBeaCsATWl4r4YLtacBZvEnmiWamE44TZrG7AN0yZotofXkRSOhHAkgyMIHAHgGByhu9ebfw).
**Explanation:**
```
2                   # Push a 2
 Ž Ć                # Push compressed integer 24111
    .¥              # Push the cumulative sum of its digits with 0 prepended:
                    #  [0,2,6,7,8,9]
      T+            # Add 10 to each: [10,12,16,17,18,19]
        ª           # Append it to the 2: [2,[10,12,16,17,18,19]]
         Ƶž         # Push compressed integer 258
           Ig       # Push the input, and pop and push its length
             å      # Check that this length is in 258 (1 if truthy; 0 if falsey)
              è     # Use that to 0-based index into the list [2,[10,12,16,17,18,19]]
                    # ([10,12,16,17,18,19] if truthy; 2 if falsey)
               Å?   # Check whether the (implicit) input starts with any of these
                    # values (or the 2)
                 à  # And pop and push the maximum of the top item,
                    # which is either already 1 or 0 if it was 2,
                    # or the maximum of the list of truthy/falsey values if not
                    # (after which the result is output implicitly)
```
[See this 05AB1E tip of mine (sections *How to compress large integers?*)](https://codegolf.stackexchange.com/a/166851/52210) to understand why `Ž Ć` is `24111` and `Ƶž` is `258`.
[Answer]
# [R](https://www.r-project.org/), ~~57~~ 56 bytes
```
substr(n<-scan(),1,2^!nchar(n)%%3<2)%in%c(2,10,12,16:19)
```
[Try it online!](https://tio.run/##K/r/v7g0qbikSCPPRrc4OTFPQ1PHUMcoTjEvOSMRKKipqmpsY6SpmpmnmqxhpGNooGMIJM2sDC01/xsaGRib/P8PAA "R – Try It Online")
Note that `2^!nchar(n)%%3<2` is equal to `2` when `nchar(n)%%3==2`, and equal to `1` otherwise.
Extract either the first, or the first 2, digits of `n` (depending on the value of `nchar(n)%%3`), and check whether the result is in `c(2,10,12,16,17,18,19)`.
Works for arbitrarily large input.
[Answer]
# JavaScript (ES6), ~~51 47~~ 46 bytes
```
n=>(730>>n.length^n[0])&/^2|^1[^1345]/.test(n)
```
[Try it online!](https://tio.run/##fVJNa4NAEL3nV2wvVenU7Oy66ga0p@bSQyHkFhIIqUlaREu0gUD/ezquu9uPQwd8Lm/WN/Mevm3P2253en3v75v2pbrui2tTlGEmeVk2cV01h/64aVZ8Hd1ON@Jzg6sNykStp3FfdX3YRNclK9hKAHJAwhQwA8wBNQjO6UEQQoJQ1OBUhGgwMYzWmj4zvMB8QCEIU6UIM60J8ywl1NyoGQlBtyQOmprTGK2NCh9rFPW6o7RjUsekKhVkgw6ulblW5pjcMbljtGO0ZeyEcTVMlJBqOPkuum6iaBoqabelWk/mQ3AIEhJQkEIGOdAMBJSACeCgBGNWxoNZ2ywoKd5c0RU9CNpIpBLWsbVpLVkfdnm/sc@L@5y4z4f7OLiPgXv7HPS3icmubbq2ruK6PYTB8vTRHy9s@DXYbttV3SwAtoyrc3W6hA0rSran1x0LgihiDyx4fgrYjAWPi8XzIoh@a823dfdXav5T6uY/resX "JavaScript (Node.js) – Try It Online")
### How?
\$730\$ is the bit-mask of valid lengths when the first digit of \$n\$ is \$2\$:
```
730 = 1011011010
      ^ ^^ ^^ ^
      9876543210
```
Once it's been right-shifted by the number of digits, we XOR it with the first digit of \$n\$. Therefore, the least significant bit is left unchanged if the first digit is \$2\$ and inverted if the first digit is \$1\$. For other leading digits, we don't care about the result because the regex will not match anything anyway.
We either keep the least significant bit or discard it according to the result of the following regex:
```
/^2|^1[^1345]/
 ^2             // either a leading "2"
   |            // or
    ^1          // a leading "1" followed by ...
      [^1345]   // ... anything but 1, 3, 4 or 5
```
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 24 bytes
```
^(2|1[026-9]|2..)(...)*$
```
[Try it online!](https://tio.run/##PVBNTkYhDNzPOTR5mvjSFgr0BB7CaHThwo0L4/K7@/vKTyFhAlOYTufv@//n9@t6PF4/r49DbvxGUl7s/Sbn@XScDs8P1yVgAjsWcAU3sEGIfDNEEkS9QL4ceWAejJn5t8ELt44ijkXVsZo5tlocjYbakBB/lbhrGnkbs6FCc03RrTulgynBFC2SsvohSjVKNZgWTAvGgrHFrA7TGmeVpP20qxzVrN6NNS23Qw0JGYqCiga/MziBM7hrYKY03A/Dw1ryYJv6E@tSK4yksmZdA65h1gTL9va6k6KdEO1kaAdBOwDagxPCvd0B "Retina 0.8.2 – Try It Online") Link includes test cases. Explanation: The rules simplify to: Take the first base 1000 digit, which should be either 2, 10, 12, 16-9, or 200-299.
[Answer]
# [Haskell](https://www.haskell.org/), 52 bytes
```
(%)=div
f n|n>299=f$n%1000|r<-2^n=odd$n%200+988164%r
```
[Try it online!](https://tio.run/##PVDtasMwDPyvp/CPBVq2giR/xIJmT7BnGATSsrDOHdnYr757pji2DT6ck3I63cf483m53db10B2Haf6Dq0mP9Moiw/UpdYSIj@V84vc03KdJGUZ8lhgpuG5Zv8Y5mcFMdzDJnE9muYzTWwLzvczp1xzSi1G5I5itb2UgBFIMQD1QBBJQNb0EzBbYa0HnaRNSRpcZEdHfMs8UN2RWDN4r9iKKsQ@KglktS7B2Wdo0BXWMSFbB/eyiTXeXrkyoTPCBrfP6qKW@lvrKxMrEykhlpDBlwm6NnGfrt1erUq06r9PI2@I2q4EFBx4C9BBBvwnIAjmgTQP2lLL7bDhbsxps9Noim1QJw3ouu5YFyzJlg2K7eW1JYUsIWzLYgsAWALbFEap7@Qc "Haskell – Try It Online")
This is a translation of xnor's Python solution. They contributed a byte-save with `r<-2^n`, too!
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 22 bytes
```
¬⎇﹪⊕Ｌθ³⌕θ2⬤026789⌕θ⁺1ι
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMMvv0QjJLUoL7GoUsM3P6U0J1/DMy@5KDU3Na8kNUXDJzUvvSRDo1BTU0fBGIjdMvNSNAp1FJSMlIA8x5wcDSUDIzNzC0slhFxATmmxhpIhUCRTEwys//83NDI2Mf2vW5YDAA "Charcoal – Try It Online") Link is to verbose version of code. Explanation: Works by testing whether the string begins with either 2 or one of 10, 12, 16, 17, 18, or 19, depending on the number of digits in the string; Find() will return 0 if it does, which we then invert to provide the desired truthy answer. (And because we're working in negative logic, we actually use All() to see if any of the strings is found at position 0.)
```
     θ                  Input as a string
    Ｌ                   Length
   ⊕                    Incremented
  ﹪   ³                 Modulo literal `3`
 ⎇                      If nonzero then
       ⌕                Index of
         2              Literal string `2`
        θ               In input
          ⬤             Else map over characters
           026789       Literal string
                 ⌕      Index of
                    1   Literal string `1`
                   ⁺    Concatenated with
                     ι  Current character
                  θ     In input
¬                       (Any) zero
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~18~~ 16 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-2 thanks to [Sisyphus](https://codegolf.stackexchange.com/users/48931)!
```
bȷḢbȷ2Ḣe“,-n’DÄ¤
```
**[Try it online!](https://tio.run/##y0rNyan8/z/pxPaHOxYBSSMglfqoYY6Obt6jhpkuh1sOLfn//7@RsYmpmbkFAA "Jelly – Try It Online")** Or see the [test-suite](https://tio.run/##PVAxTgQxDPzQINlOnMQ9v1hdg3QNOl1Pd0JIvAGJClHSQ801fIP9SM6bTWLtzkbj7Hg8j8fT6anWh7/v/58PR/HPcb284@68Xt7ury@/n/X6uj5/@VPrsgiYwI4JnMEFbBAifxkiAaLeIC9HbhgbY2b@W@OFy4YijknVMZs5lpwcjZpakxC/FXjTNPIxZk2F9tpFp@4uPZg0mKRJQlQ/jFYerTyYMpgyGBuMdaZP2K1xVAm6nWaXRzeqT2MN3a3XAQsjIEKRkFHg@gwO4AjeVLDn1Pw3y81c8GiL@hXbxHocQaVv21fs6/QduvHpdmZFMyOa2dCMgmYENFcn2FzgcAM "Jelly – Try It Online").
### How?
```
bȷḢbȷ2Ḣe“,-n’DÄ¤ - Link: n
 ȷ               - 1000
b                - (n) base (1000)
  Ḣ              - head -> x
    ȷ2           - 100
   b             - (x) base (100)
      Ḣ          - head
               ¤ - nilad followed by link(s) as a nilad:
        “,-n’    -   2824111
             D   -   digits
              Ä  -   cumulative sums -> [2,10,12,16,17,18,19]
       e         - exists in?
```
[Answer]
# [Zsh](https://www.zsh.org/), 37 bytes
```
>$#1$1
: (12|[34679]2|[258]1[^1345])*
```
[Try it online!](https://tio.run/##PVExbsMwDNz9igPqwc5EUqIkFkH7kDQdg2YoCiRb0b@7tCxJgA/0UT4ez7/Pr@22rMuyvc0vPPP0ioXl7xJiynb1QrRc@fLJIep1PW3rdD6fZ/7A/D49vnGa1un288Adi4AJ7JjAGVzABiHyhyESIOoN8uPIFWNlzMw/q7xw2VHEMak6ZjPHkpOjUVWrEuK3Au@aRj7GrKrQcQ7RoXtIdyZ1JmkSX8qL3sq9lTtTOlM6Y52xxrQJhzWOKkH3anS5d6P6NNbQ3FY1BEQoEjIK/J3BARzBuwaOlKr7arhaCx5sUb9iu1QLI6i0XduCbZm2QbM9vI6kaCREIxkaQdAIgMbihO7e/M9jvm// "Zsh – Try It Online")
Outputs via status code (`0` = is in sequence, `1` = is not in sequence).
Explanation:
* `>` - create the file
	+ `$#1` - the length of the input
	+ `$1` - followed by the input itself
* `(12|[34679]2|[258]1[^1345])*` - try to find a file matching this pattern:
	+ `(||)` - one of:
		- `12` (the literal input `2` which is of length `1`)
		- `[34679]2` - any character from the set `34679`, then a `2`
		- `[258]1[^1345]` - any character from the set `258`, then a `1`, then any character except one from `1345` (shorter than `026789`)
	+ `*` - followed by any string
	+ this will produce an error if there is no file
* `:` - and then do nothing with that file (this is required because otherwise `()` would be treated as a sub-shell)
[Answer]
# [Ruby](https://www.ruby-lang.org/) + `i18n` + `numbers_and_words`, ~~96 93~~ 91 bytes
```
require'i18n'
require'numbers_and_words'
I18n.with_locale(:pt){p gets.to_i.to_words[0]==?d}
```
[Try it on repl.it!](https://repl.it/join/wdtvwtgv-razetime)
It's probably longer than a simple pattern matching solution, but I wanted to try it anyway.
-3 bytes from ovs.
-2 bytes from Dingus.
[Answer]
# [Scala](http://www.scala-lang.org/), ~~98~~ 79 bytes
```
n=>{val m=n+"";if(m.size%3>1)Set(0,2,6,7,8,9)(m.take(2).toInt-10)else m(0)==50}
```
[Try it online!](https://tio.run/##dVTBbtswDL3nK4RgBSzUDSjZsq0VDtDddtipX@CmCurNsdNYHdYW/fbMTUhLLFpd@IhHihQf7XHTdM1xuPvtNl78atpeuH/e9fejuNnvXxdiOn@bTmy/i5@9F/Va/BiGzjW9qI99vX5953Z1f7lcXrfbZLca2xd3ka2VvHU@gVSnRVqmVWrlxPnmj0u0XPlhuupKgXTd6MQuAVnXBt6OVMsfnvzDs6jFrXtMdHrqQQFa8gu0JdoKrT1bDUBAIdAZAkO5ABSlQAWYhwBrLdUNsVpVM9SaYGEMwdJaglVZELQQegqV9XRHpubOLNADrA3FASDu1cacZpxmXMG4whQ6yw15LLJkkSXjKsZVjLOMszGHjUWPVrnRmZldHqxYcG6mTpXJ4mFM5@TJRVjLphtpU3CImJKfDVZDQXFZcFfoDZioMFNhqpo7nVUIcoThh1HT8DLaxcrQVXZ@Sax8ZnQsYixaLEssQzx2Pma@KsC3A/hCAFcduNDAtUXXfqbB@VNdbYeDazYPSfv@g9gf2t53fTIu8UP@1oorsRSXYpu0UspT4km4r/LOqn5MW7wd/wM "Scala – Try It Online")
* Thanks to [user](https://codegolf.stackexchange.com/users/95792/user) for -19!!!!
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~41 33~~ 42 bytes
```
§|§&ȯ€B19 26441084r↑2o₁L§&o='2←ȯ¬₁Ls
€d258
```
[Try it online!](https://tio.run/##yygtzv7//9DymkPL1U6sf9S0xsnQUsHIzMTE0MDCpOhR20Sj/EdNjT5A2XxbdaNHbRNOrD@0BiRSzAVUnGJkavH//39DIwA "Husk – Try It Online")
-8 bytes from Dominic Van Essen.
+9 bytes after corrections.
[Answer]
# [R](https://www.r-project.org/), ~~87~~ ~~82~~ 79 bytes
(or [82 bytes](https://tio.run/##Tc1BCoMwEEDR0wzMYEpnlAoVsvMcrRK0CSljiErp6aObQnd/8eDnkpa87a9pnZ69LfOubguLoppo1fkxo9JFaAjzgE0LgLG6kVG4gvAjWlv/GuPJICg4FDZSG2k7uROVjw/O4zqm9P6idA0zm7/nKcoB) as a function)
```
`if`(36%%((k=nchar(n<-scan())-1)+5),n%/%10^k==2,n%/%10^(k-1)%in%c(10,12,16:19))
```
[Try it online!](https://tio.run/##NcnBCoAgDADQrxlspLQZCUX@SihCJMIO9v@sLt0evGGW25VxiQCIPWm9y0A9/FOLIpEXmlZyCjMInz2l8Bv7d9AUKgo7CU7iLhuRBWazFw "R – Try It Online")
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~28~~ ~~26~~ ~~25~~ ~~23~~ ~~21~~ 20 bytes
or **[19 bytes](https://tio.run/##ASkA1v9odXNr///igqziiKtkMjgyNDExMWnihpHCueKGkj0yJTNM////IjE5Ig)** by accepting input as a string
*Edit: -2 bytes thanks to LegionMammal978, then -1 more byte thanks to Zgarb*
```
€∫d2824111d↑d¹→=2%3L
```
[Try it online!](https://tio.run/##AS8A0P9odXNr/1figoHhuKM1MDD/4oKs4oirZDI4MjQxMTFk4oaRZMK54oaSPTIlM0z//w "Husk – Try It Online") (header in TIO link loops over integers from 1 to 500, and outputs those beginning with 'D' in Portugese)
Port of [Robin Ryder's R answer](https://codegolf.stackexchange.com/a/213684/95126). Outputs zero (falsy) for numbers not beginning with 'D' in Portugese, or a positive integer (truthy) for numbers beginning with 'D'.
**How?**
```
€∫d2824111d`↑d¹→=2%3Ld
€                               # does the argument belong to this list:
 ∫                              # cumulative sum of
  d2824111                      # base-10 digits of 2824111
                                # (2,10,12,16,17,18 and 19)
          d                 # argument is the base-10 number formed from
           `↑d¹             # the first x digits of the input
                                # where x is calculated as:
               →=2%3Ld
               →                # 1 plus
                    Ld          # the number of input digits
                  %3            # mod 3
                =2              # equals 2?
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~48~~ ~~47~~ 34 bytes
```
->s{s=~/^(2|1[026-9]|2..)(...)*$/}
```
[Try it online!](https://tio.run/##dVJda4MwFH2/vyK4PWyD2tzEqHnoYP9g790H7WpXwekwyiht99e7a0xCLSzgQc6J59x7sO3X@/N28XKePZqDWfzO3@7EEZdcpDP9ehRxfH8XEzzczk/nru273f697r/WRWvYgkUCkAMSpoAZYA6oQXBOD4IQEoQigdMhRIuJZbTW9JnlBeYDCkGYKkWYaU2YZymh5tbNWgi6JXHw1JxitLYufDyjafAdrT2TeiZVqZCJohcvZV7KPJN7JveM9ox2jEsYR8NECamGt6CiVxNFaaikm5ZOBLBdVSa0uIgQJCSgIIUMcqA4BJSACeBgCmNtdh27gZ1VUtO5oit68HbtSCXc8m5jt51bye0Rhg/V8VAZD1Xx0AwPjfDQBAd9sc/0t4iL1cfuvSrrgm0adpyIR2CsXZWmYNFz26yr4ov9lN2ObdjNYXLxFLG@rgpj2HY5EWLTteX3KxT15qrIq9xL7b/YuqlnQ/TlXUout5R6yU1Cv/vOsOipqthn02wiOP8B "Ruby – Try It Online")
Takes input is a string.
Based on ~~[Abigail's Perl solution](https://codegolf.stackexchange.com/a/213667/65905)~~.
Based on [Neil's impressive regex.](https://codegolf.stackexchange.com/a/213695/65905)
]