[Question]
  [
# Input
no input for this challenge
# The Challenge
Write a code that outputs:  
**The first 10 prime numbers whose sum of their digits equal the number of bytes of your code**  
  
# Examples
Let's say your code is `Co&%423@k"oo"` which is `13 bytes`  
your code must output `[67, 139, 157, 193, 229, 283, 337, 373, 409, 463]`  
If your code is `8 bytes`, you must output `[17, 53, 71, 107, 233, 251, 431, 503, 521, 701]`
# Rules
You must **only use the first 10^8 prime numbers**  
***which means all your numbers must be <2038074743=10^8th prime***
If you **can't find 10 prime numbers in this range** that fit your bytes, then you will have to adjust your code (you may even have to add some bytes!) in order to find a "***working number of bytes***"
Just **output the 10 primes** in any way you like
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code in bytes win!
  
[Answer]
# [Neim](https://github.com/okx-code/Neim), ~~10~~ ~~8~~ 7 [bytes](https://github.com/okx-code/Neim/wiki/Code-Page)
*-1 byte thanks to ASCII-only.*
```
œÄ·õ¶ùêãŒõùê¨7ùîº
```
[Try it online!](https://tio.run/##y0vNzP3//3zDw9nLPsyd0H1uNpBcY/5h7pQ9//8DAA "Neim ‚Äì Try It Online")
Outputs:
```
[7 43 61 151 223 241 313 331 421 601]
```
This (well, at least the approach) is ungolfable.
## Explanation
```
œÄ·õ¶ùêãŒõùê¨7ùîº
œÄ        push 13 (yes, very unintuitive :P)
 ·õ¶       square (13¬≤ = 169)
  ùêã      push the first 169 primes
   Œõ     filter those that when the following are executed, evaluate to 1
    ùê¨    sum its digits and...
     7ùîº  check for equality against 7
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 14 bytes
```
‚Äò√ÜNDS=14√∏‚Åµ#‚Äò√ÜN
```
[Try it online!](https://tio.run/##y0rNyan8//9Rw4zDbX4uwbaGJod3PGrcqgwR@P8fAA "Jelly ‚Äì Try It Online")
This prints:
```
[59, 149, 167, 239, 257, 293, 347, 383, 419, 491]
```
**How it works**
```
‚Äò√ÜNDS=14√∏‚Åµ#‚Äò√ÜN
          #     Count the first 
         ‚Åµ        10
                Non-negative integers which meet:
‚Äò√ÜN               the (z+1)-th prime  (1-indexed :*()
   D              digits
    S             sum
     =            equals
      14          14
           ‚Äò√ÜN  Get those primes
```
[Answer]
# [Pyth](https://pyth.readthedocs.io), 14 bytes
```
.f&qsjZT14P_ZT
```
**[Try it here.](https://pyth.herokuapp.com/?code=.f%26qsjZT14P_ZT&debug=0)**
This is 14 bytes and prints:
```
[59, 149, 167, 239, 257, 293, 347, 383, 419, 491]
```
# [Pyth](https://pyth.readthedocs.io), 16 bytes
```
.f&qssM`Z16P_ZTZ
```
**[Try it here!](https://pyth.herokuapp.com/?code=.f%26qssM%60Z16P_ZTZ&debug=0)**
Note that this could be 15 bytes: `.f&qssM`Z16P_ZTZ`, but there are no primes that have 15 as the sum of their digits, since `15` is divisible by `3`, which would imply the number would also be divisible by `3`, hence not being prime.
This is 16 bytes long and prints:
```
[79, 97, 277, 349, 367, 439, 457, 547, 619, 673]
```
---
# How?
### Explanation 1
```
.f&qsjZT16P_ZT - Full program.
.f&           T  - First 10 numbers that satisfy the following:
           P_Z     - Are prime and
    sjZT           - And their sum of digits
   q     14        - Equals 14.
```
### Explanation 2
```
.f&qssM`Z16P_ZTZ - Full program.
.f&           T  - First 10 numbers that satisfy the following:
           P_Z     - Are prime and
    ssM`Z          - And their sum of digits
   q     16        - Equals 16.
```
[Answer]
## [Husk](https://github.com/barbuz/Husk), 13 bytes
```
‚Üë10f»Ø=13Œ£df·πóN
```
[Try it online!](https://tio.run/##yygtzv7//1HbREODtBPrbQ2Nzy1OSXu4c7rf//8A "Husk ‚Äì Try It Online")
### Explanation
```
            N    Take the (infinite) list of all natural numbers.
          f·πó     Select only the primes.
   f»Ø            Filter again by the result of composing the following three functions:
         d         Get the decimal digits.
        Œ£          Sum them.
     =13           Check whether the sum equals 13.
‚Üë10              Take the first 10 primes in the result.
```
[Answer]
# [Haskell](https://www.haskell.org/), ~~77~~ 71 bytes
```
x=take 10[i|i<-[1..],sum(read.pure<$>show i)==71,all((>0).rem i)[2..i-1]]
```
[Try it online!](https://tio.run/##DcixCoAgEADQX7mhwcCObGnJfkQcDjroUCu0qKF/t974ViqBY6z1sScFBtM7eWXqnEH0ulxJZaYFjyvz1Mxl3W@Q1trRaIpRqblvMXP6zw2I0hnvayLZwMKRZTvhqR8 "Haskell ‚Äì Try It Online")
*Saved 6 bytes thanks to Laikoni*
*For 71 bytes:*
```
[89999999,99899999,99998999,99999989,189989999,189998999,189999989,197999999,199898999,199979999]
```
> 
> all your numbers must be <2038074743
> 
> 
> 
1999999999 is the number with the maximum sum of digits in the allowed range, and that sum is 82. Any program that is beyond 82 bytes will not satisfy the condition. I hope that 77 bytes is ok, but I don't know (it's still running on my computer).
**EDIT:** a slightly optimized version gave for 77 bytes:
```
[699899999,779999999,788999999,789999989,797999999,798899999,799898999,799899899,799999799,879999899]
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~¬†14¬†~~ 13 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
DS‚Åº13
.»∑√ÜR√á√êf
```
**[Try it online!](https://tio.run/##y0rNyan8/98l@FHjHkNjLr0T2w@3BR1uPzwh7f9/AA "Jelly ‚Äì Try It Online")**
### How?
```
DS‚Åº13 - Link 1, test digit sum equals thirteen: number, n
D     - get a list of the decimal digits of n
 S    - sum them
  ‚Åº13 - equals thirteen?
.»∑√ÜR√á√êf - Main link: no arguments
.»∑      - literal 500
  √ÜR    - prime range (all primes less than or equal to 500)
     √êf - filter keep if:
    √á   -   call last link (1) as a monad
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 13 bytes
```
{.‚âú·πó·∫π+13‚àß}·∂†¬π‚Å∞
```
[Try it online!](https://tio.run/##ASoA1f9icmFjaHlsb2cy//97LuKJnOG5l@G6uSsxM@KIp33htqDCueKBsP///1o "Brachylog ‚Äì Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 10 bytes
```
83L√ò íSOTQ}
```
[Try it online!](https://tio.run/##MzBNTDJM/f/fwtjn8IxTk4L9QwJr//8HAA)
The `}` is used as a filler, since 9 is an invalid byte count.
Output: `[19, 37, 73, 109, 127, 163, 181, 271, 307, 433]`
## Explanation
```
83L        Push array [1, ..., 83], since 433 is the 83rd prime
   √ò       Map each to the nth prime
     í      Get elements that return 1
     SO     When the sum of the digits
        Q   Equals
       T    10
```
---
# Almost 8 bytes
This would be valid if one more byte could be golfed off.
```
≈æyL√ò íSO8Q
```
[Try it online!](https://tio.run/##MzBNTDJM/f//6L5Kn8MzTk0K9rcI/P8fAA)
Output: `[17, 53, 71, 107, 233, 251, 431, 503, 521, 701]`
## Explanation
```
≈æy          Push number 128, since 701 is the 125th prime
  L         Push array [1, ..., 128]
   √ò íSO8Q   Map to nth primes and filter to those with a digit sum of 8 (see above)
```
[Answer]
# Mathematica, 52 bytes
```
Select[Prime@Range[10^6],Tr@IntegerDigits@#==52&,10]
```
> 
> {799999,998989,999979,1789999,1798999,1979899,1989979,1997899,1999969,2599999}
> 
> 
> 
thanx to @Not a tree for -6 bytes
[Answer]
# J, 29 bytes
```
(#~(29=[:+/"."0@":)"0)p:i.872
```
[Try it online!](https://tio.run/##y/r/PzU5I19BQ7lOw8jSNtpKW19JT8nAQclKU8lAs8AqU8/C3Oj/fwA)
Definitely works on the REPL, probably works a regular program too (not sure how J does output for programs to be honest).
First pass, not particularly ideal but I can't think of any more clever approaches. Going to investigate hardcoding a smaller sequence.
# Explanation
```
(#~(29=[:+/"."0@":)"0)p:i.872
                      p:i.872  First 872 primes
 #~                            Filter by
   (29=[:+/"."0@":)"0            Digital sum = 29
                   "0              For each
                ":                 Convert to string
           "."0                    Convert each character to a number
         +/                        Sum results
    29=                            Equate to 29
```
872 guarantees that only the first 10 primes whose digital sum is 29 will be used.
[Answer]
# [V](https://github.com/DJMcMayhem/V), 73 71 bytes
```
i8aa9
998a99
a98a
aa89
18998a9
18a8a
18a9989
197aa
199898a
1a7a9√ça/999
```
[Try it online!](https://tio.run/##HckxFYBADATRPhYQwbvqMnKmxAAuUIWwkFDt7t@76kolIIWwIzSJlT912rTmHWXba/qoW4738QSqPg "V ‚Äì Try It Online")
Simple substring replacement compression - I checked all the possible answer outputs, and then did some "which one has a simple string replacement that saves most characters" testing. e.g. [generating this table](https://gist.github.com/anonymous/08cd1a2d18e636af29d3c7682ede480b). [edit: I looked again at the table and saw I could do the 71 byte version instead].
The higher primes have more long runs of 9 in them, and the best I found was where the digits add up to 73, the pattern 89999 -> 1 char brings the text down from 99 bytes to 63 bytes. Finding a way to undo 'a' -> '89999' in the remaining 10 bytes led me to V.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 19 bytes
```
A√Ü_j ¬©19¬•Z√¨ x ¬´X¬¥}a
```
[Try it online!](https://ethproductions.github.io/japt/?v=1.4.5&code=QcZfaiCpMTmlWuwgeCCrWLR9YQ==&input=LVE=) with the `-Q` flag to format the array.
Outputs the first 10 primes whose digits add to `19`:
```
[199, 379, 397, 487, 577, 739, 757, 829, 883, 919]
```
Note that this could be golfed to 18 bytes (`√¨ x` → `√¨x`), but no primes with a digit sum of 18 exist.
## Explanation
```
A√Ü
```
Map the array `[0, ..., 9]` by the following function, where `X` is the current value.
```
  _              }a
```
Return the first integer that returns true from the following function, where `Z` is the current value
```
   j ¬©
```
Check if this number is prime, and...
```
      19¬•Z√¨ x
```
The sum (`x`) of the digits (`√¨`) in `Z` equals (`¬•`) 19,
```
              ¬´X¬¥
```
And `X` is falsy (`¬´` is "and not", or `&&!`). This also decrements `X` (`¬¥`).
Resulting array is implicitly outputted.
[Answer]
# PARI/GP, 40 bytes
```
select(x->sumdigits(x)==40,primes(8600))
```
Not much golf about it (select those `x` with sum of digits 40 among first 8600 primes). Output is:
```
[49999, 68899, 69997, 77899, 78889, 78979, 79699, 79987, 85999, 88789]
```
[Answer]
# [Pyke](https://github.com/muddyfish/PYKE), 10 bytes
```
~p#.cTq)T>
```
[Try it here!](http://pyke.catbus.co.uk/?code=%7Ep%23.cTq%29T%3E&input=&warnings=1&hex=0)
```
~p         -   primes
  #.cTq)   -  filter(^)
   .c      -    digit_sum
     Tq    -   ^ == 10
        T> - [:10]
```
[Answer]
# Ruby 2.4.1, 74 Bytes
I was never going to beat one of the Codegolf optimised languages, but it was still fun to do it in Ruby. Frustrating that Prime is not in Core but in instead in the standard library. I am also frustrated that I can't beat Haskell.
```
2.4.1 :014 > require'prime';2.step.lazy.select{|n|n.digits.sum==74&&n.prime?}.first(10)
=> [389999999, 398999999, 498989999, 498998999, 499898999, 499899989, 499979999, 499989989, 579989999, 588999899]
```
[Answer]
# [Ruby](https://www.ruby-lang.org/) `-rprime`, 49 bytes
```
p  *Prime.lazy.select{_1.digits.sum==49}.take(10)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72kqDSpcnW0km5RQVFmbqpS7IKlpSVpuhY3DQsUFLQCQGJ6OYlVlXrFqTmpySXV8YZ6KZnpmSXFesWluba2Jpa1eiWJ2akahgaaEI1Q_QugNAA)
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 8 bytes
```
√¶*‚àë8=)‚ÇÄ»Ø
```
[Try it online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLDpiriiJE4PSnigoDIryIsIiIsIiJd)
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~19~~ 11 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Would be 12 if not for a bug in Japt's `j` function method, which would have necessitated padding it out to 13 as there are no primes with a digit sum of 12.
```
√àj ¬´BaX√¨x}j
```
[Test it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=yGogq0JhWOx4fWo)
```
√àj ¬´BaX√¨x}j
√à               :Function taking an integer X as argument
 j              :  Is prime?
   ¬´            :  Logical AND with logical NOT of
    B           :    11
     a          :    Absolute difference with
      X√¨        :      Digit array of X
        x       :      Reduced by addition
         }      :End function
          j     :Get the first 10 integers >=0 that return true
```
[Answer]
# [Paradoc](https://github.com/betaveros/paradoc) (v0.2.7+), 10 bytes (CP-1252)
```
5h¬∂fœÜTB≈†T=
```
[Try it online!](https://tio.run/##K0gsSkzJT/7/3zTj0La0820hTkcXhNj@/w8A "Paradoc ‚Äì Try It Online")
```
5h         .. 5 hundred
  ¬∂        .. Check if a number is prime...
   f       .. ...filter by the preceding block; converts 500
           .. to the range [0, 1, ..., 499]
    œÜ      .. Filter by the following block:
     T     .. Ten
      B    .. Base; convert to base-10 digits
       ≈†   .. Sum, resulting in the digit sum
        T  .. Ten
         = .. Check if (the digit sum and ten are) equal
```
Somewhat questionable since it prints all the numbers with no separator between them. An 11-byte program that prints each number on a separate line:
```
nI√®¬∂fœÜTB≈†E=
```
The only thing worth mentioning about it is the upper bound that's slightly more difficult to construct: `I√®` is 18¬≤ = 324.
[Answer]
# [Bubblegum](https://esolangs.org/wiki/Bubblegum), 37 bytes
```
00000000: 0dc6 3901 4031 0c80 5043 9dfe 9180 7f63  [[email protected]](/cdn-cgi/l/email-protection)
00000010: 6579 f028 9ed7 352d e7a3 4f48 37ff 9164  ey.(..5-..OH7..d
00000020: 4c96 04f7 02                             L....
```
[Try it online!](https://tio.run/##fc2hDgIxEIRhz1OMxLDZdtvuFUWCQZDAK3BtFwPyBE9feuE0vxvzzbzM86s9l3fvvHUE15IgmR0CiwOXiRE5CHK1huzGVEsCEGU6OaL7mdbK7ie4YaSoGcZ@Qm5VIdFXNH0IgoUJomYDSgFoH9oTxQPR7aJEdTP8MELJCRxMwR7/uq7vvX8B "Bubblegum ‚Äì Try It Online")
Output is `29989,39799,39979,48799,48889,49789,56989,58699,58789,58897`
]