[Question]
  [
On the Mathematica Stack Exchange, [100xln2 asks](https://mathematica.stackexchange.com/questions/288024/how-can-i-define-a-sequence-of-integers-which-only-contains-the-first-k-integers):
> 
> I need a list of integers [‚Ä¶] The list contains integers and is characterized by [three] parameters, lets call them k and j [and listmax], which should be variable.
> 
> 
> If `k=1` and `j=1` then the list would look like this: {1,3,5,7,9,11,....until listmax}
> 
> 
> If `k=2` and `j=3` then the list would look like this: {1,2,6,7,11,12,16,17,.....until listmax}
> 
> 
> Generally speaking, the List contains the first k integers, then doesn't contain the next j integers, then contains the next k integers, then doesn't contain the next j integers and so on and so on.
> 
> 
> 
Let's help them out! (I hope they're okay with Jelly, Vyxal, or Befunge code instead of Mathematica‚Ä¶)
Given three positive integers \$(k, j, \text{listmax})\$, make a list of integers as described above, sorted in increasing order.
For \$(3,2,6)\$ you should return `[1,2,3,6]` rather than `[1,2,3]` or `[1,2,3,6,7,8]`. You can imagine you're generating an infinite ‚Äúinclude 3, skip 2‚Äù list, and taking elements from it as long as they're ‚â§ 6.
# Rules
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"). Write the shortest possible answer, measured in bytes.
Standard I/O methods apply, which means valid submissions include:
* a three-parameter function that returns a list of numbers,
* a three-parameter function that prints each number in the list,
* a full program that reads inputs and prints each number in the list,
* [and so on](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods).
# Tests
In the format `k j listmax --> output`:
```
1 1 11 --> [1, 3, 5, 7, 9, 11]
2 13 19 --> [1, 2, 16, 17]
2 13 16 --> [1, 2, 16]
1 4 49 --> [1, 6, 11, 16, 21, 26, 31, 36, 41, 46]
2 4 22 --> [1, 2, 7, 8, 13, 14, 19, 20]
2 10 13 --> [1, 2, 13]
5 15 10 --> [1, 2, 3, 4, 5]
1 13 27 --> [1, 15]
7 4 31 --> [1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, 23, 24, 25, 26, 27, 28, 29]
99 99 1 --> [1]
```
  
[Answer]
# [Python](https://www.python.org), ~~53~~ ~~48~~ 47 bytes
```
lambda k,j,l:[x+1for x in range(l)if x%(k+j)<k]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72soLIkIz9vweI025ilpSVpuhY39XMSc5NSEhWydbJ0cqyiK7QN0_KLFCoUMvMUihLz0lM1cjQz0xQqVDWytbM0bbJjodpcCooy80o00jQMdYDQUFOTCyZgpGOsY2iJJGCuY6JjjKzC0lIHiIAiELMWLIDQAA)
-5 by Lynn
-1 by Ethan C
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~6~~ 5 bytes
```
√ò+x·πÅM
```
[Try it online!](https://tio.run/##y0rNyan8///wDO2Khzsbff8fXq50dNLDnTMeNa2J/P8/2lBHwTBWRyHaCEgbozCAMiZQARhtaABimAIZplAVhmApc6gSS0sdBUvL2P@GIBkg29AMKAGkjcCGgvQD2UDFxiB5AA "Jelly ‚Äì Try It Online")
Takes input as `[k, j]` on the left, and `listmax` on the right.
-1 byte thanks to Lynn pushing me to save a byte!
## How it works
```
√ò+x·πÅM - Main link. Takes [k, j] on the left, listmax on the right
√ò+    - [1, -1]
  x   - Repeat 1 k times and -1 j times
   ·πÅ  - Mold this list of length k+j to length listmax
    M - Maximal indices, i.e. indices of the 1s
```
[Answer]
# [J](https://www.jsoftware.com), ~~12~~ 11 bytes
```
>:@I.@$1-I.
```
[Attempt This Online!](https://ato.pxeger.com/run?1=ZVHLSsRAEMTrfEUjwrIwCememWQn4LIgCAuevEpOYhAvXvRrvMSDJ7_AX_FHvFo9D8kipBmq-lHVnbf3p-XrvKXNTJcjbSx1NCKalq5ub64_Xl_mZve5Hw_H9nDBzbHNzPfZz9Y83D8-EzPNxMQFRSAhdgX2J9DHVOszEknJgtjl0q7ADjAQh1I7ZJUyyKno8NcKECM-Y5J5w1rK1DR7umNLzlKwNFiKFvRk1JA6rXkB3SOGmupPUxMGejVfWS3m3CRahNepDl6P1_c6yOuCqznQ36EHZtgj4EW6JNip5lrQTUY318yKRiP6gppBPQ5ScwwOt9Cj_C9PZiHNstIOdWEEPAl4AS8h7yLgRfk4mXRXqpMns83_f1ny-ws)
Takes input as `listmax f (k, j)`.
-1 byte thanks to ngn by taking `k,j` instead of `j,k`.
```
>:@I.@$1-I.
         I.  k copies of 0 and j copies of 1
       1-    change 0 to 1 and 1 to 0
      $      take listmax cyclically
   I.@       convert each occurrence of 1 to its index (0-based)
>:@          add 1
```
# [K (ngn/k)](https://codeberg.org/ngn/k), 10 bytes
```
{1+&x#~&y}
```
[Try it online!](https://ngn.codeberg.page/k#eJxtUEEKAjEMvPcVAWEvdrFJ26214EeWXvcNiujbnXTdtYKHkGEmySRZLg8+DrfDa7g/jVlm5sLEVVEuQuwbnHYYMvSgSARkQ+xVdg26Eolj05NOak2eS/qUlpwp52rMyUAlZhrHK81syVuKlpKlbEFXo47EedcF9IRImzT9ShUDA4Vvgxbz2iRahOzVBzkgh0kHBRLp58D/jB4swwGBXcQ1Q6eevSEu01NV6Wg0oi/qMqiXtGv6FDwBK/wpb8vCmqXzjtvBCOwk4AW8xPUWAS/K45vtqbRNrm/gGVrj)
Takes input as `f[listmax;k,j]`. Pretty much a built-in-to-built-in translation of the J solution above.
[Answer]
# [R](https://www.r-project.org), ~~32~~ 31 bytes
```
\(k,j,m)which((1:m-1)%%(k+j)<k)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=ZZFfSgMxEMbx1VMslEKC38LO5N-mWC-ifRKk3VAotqVn6Bn6sj6Ix-g9PI1To2u2koHAfL_5ZiY5vb32H2mbVptu_r7fvdTt-UkldFjrw3L1vFSKZuua9HSq0l2n75PO1OfNMVcpghzS1aSq64fqkWDgEBAlubj9YRhkQLGAJONB4YrwV8QgEyxsWS_FdLFgAT2MdPWwQvnC0YJ5ZBjQfrexMgu4KZs3Ioybm0F2IIlmJBtxd8V4YsuhIOhPDIIa-l8tOwQQ_07k8ouAWrCYyfDushoHsGTiYBcjJAq_Rf6Rvs_3Fw)
Indexes of elements of `0..(listmax-1)` that are less than `k` after modulo-`(k+j)`.
[Answer]
# Dyalog APL, 6 bytes
Thanks [@Lynn](https://chat.stackexchange.com/users/136994) for -6
```
‚ç∏1=‚ç¥‚àò‚ç∏¬≠‚Å°‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å°‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å¢‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å¢‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å£‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å§‚Å™‚Äè‚Å†‚Å™‚Å™‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å§‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å™‚Äè‚Å†‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å£‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå¬≠
‚ç∏       # ‚Äé‚Å°At what indices
     ‚ç∏  # ‚Äé‚Å¢is the list of k 1's and j 2's
   ‚ç¥    # ‚Äé‚Å£cycled to length listmax
 1=     # ‚Äé‚Å§equal to 1?
üíé
```
Created with the help of [Luminespire](https://vyxal.github.io/Luminespire).
left argument listmax, right argument pair of k and j
[Answer]
# [Octave](https://www.gnu.org/software/octave/) / MATLAB, 30 bytes
```
@(k,j,m)find(mod(0:m-1,k+j)<k)
```
[Try it online!](https://tio.run/##TY3RCoJAEEXf/Yr7Eu7SJs5qiW5C/1E9RLqg4hoqgf28jYbQzDxczhxmuuf4eJezzYMgmC@iUbVqpa1cIdquEGHWHkg1@1qeGzmP5TAOyHElcJOBBkWgdAsnwzxGvIIYWq@LkHcGRxBPuBis6sQgYSXiI2m6DN2NZ7seju9TNlSfUqzvFEkPXBNz@0PCMVTYsv7LkZRm1e2rr9xoBSn4uwq@wsTaRv2b86VXumL@Ag "Octave ‚Äì Try It Online")
### Explanation
```
@(k,j,m)find(mod(0:m-1,k+j)<k)
@(k,j,m)                         % Define anonymous function of k, j, m
                 0:m-1           % Range [0 1 2 ... m-1]
             mod(     ,k+j)      % Modulo k+j (element-wise)
                           <k    % Less than k? (element-wise)
        find(                )   % (1-based) Indices of true entries
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 54 bytes
```
i;f(a,b,m){for(i=0;i<m;i++%(a+b)<a&&printf("%d ",i));}
```
[Try it online!](https://tio.run/##DchBCoAgEADAc75CgmQXNygKOmw9xgxjD1pEdJHebs1xfLt7X4pwAEcrRczhuECWjmWOLNY24OyKszPmvCTdAepm0zUJIr/lDx2dJHgO2VBlVQWYSI@khx5ZveUD "C (gcc) ‚Äì Try It Online")
[Answer]
# C (gcc), 62 bytes
```
i,j;f(a,b,m){for(i=j=0;m/++i;j-->b&&printf("%d ",i))j=j?:a+b;}
```
[Try It Online!](https://tio.run/##DclRCsIwDADQb3uKMnAkNEXFgWConqXtqCTQTcbYz9jZq@/3Zf/JuTUh5QKRElXcy7yABA1XrhfnhNX7V@r77yLTWqA7j7YjQdSg72d0iY/2D1ujTLDNMqLZzanAg@xA9n5DNkf7AQ)
Ungolfed:
```
i,j;
f(a,b,m)
{
    for(i=j=0;m/++i;j-->b&&printf("%d ",i))
        j=j?:a+b;
}
```
`i` is the counter, and the loop ends when it's greater than `m`, which is the maximum value. `j` is initialized to `0`, but is reinitialized to `a+b` before it is read from. It's decremented once for each iteration of the loop, and `i` is only printed when `j` is greater than `b`, so only the first `a+b` - `b` = `a` values are printed. When `j` reaches 0 after `b` more iterations, it's set to `a+b` again.
[Answer]
# [Zsh](https://www.zsh.org/), 59 bytes
```
for ((;i<$1&&i++<$3;))l+=({$i..$3..$[$1+$2]})
echo ${(on)l}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m724qjhjwao0DU2N4tQSBd2KpaUlaboWN63T8osUNDSsM21UDNXUMrW1bVSMrTU1c7RtNapVMvX0VIyBOFrFUFvFKLZWkys1OSNfQaVaIz9PM6cWakSSJleagiEIGgIZRgqGxgqGlnCWGVjSRMEEImSiYGQEkTMASgNZpgqGQGQAMcJYwcgcyDIHKjMGGWZpCUKGXBCbFiyA0AA)
I really think there's some gains to be had from another method, but that method eludes me.
This loops, iterating the starting point of a brace expansion `{$start..$end..$skip}` until it reaches the first or third argument (j or listmax). Each brace expansion is appended to the list `l`. Finally, the `(on)` flag sorts the list numerically.
**-8 bytes** if the output does not need to be sorted. (`<<<$l`)
[Answer]
# [Husk](https://github.com/barbuz/Husk), 7 bytes
```
·πÅ‚Üë¬≥C·∏£‚Å∞+
```
[Try it online!](https://tio.run/##AR8A4P9odXNr///huYHihpHCs0PhuKPigbAr////N/8zMf80 "Husk ‚Äì Try It Online")
Same approach as [my Nibbles answer](https://codegolf.stackexchange.com/a/263319/95126). Takes arguments in order `k`,`listmax`,`j`.
```
·πÅ‚Üë¬≥C·∏£‚Å∞+
   C     # cut
    ·∏£‚Å∞   #  the range from 1..middle argument
         # into sublists of length
      +  #  sum of other arguments
·πÅ        # then map over this list-of-lists
 ‚Üë       #  taking
  ¬≥      #  first-arg elements from each
·πÅ        # and flatten the result
```
---
**Alternative approach, also 7 bytes**
```
f¬¢·πò‚Å∞·∏ã2·∏£
```
[Try it online!](https://tio.run/##ASEA3v9odXNr//9mwqLhuZjigbDhuIsy4bij////WzcsNF3/MzE "Husk ‚Äì Try It Online")
Takes arguments in order `[k,j]`,`listmax`.
```
f¬¢·πò‚Å∞·∏ã2·∏£
  ·πò      # repeat
    ·∏ã2   #  the binary digits of 2 (so: [1,0])
   ‚Å∞     #  each by number given in arg 1
 ¬¢       # and repeat this list infinitely;
f        # now use this to filter elements of
      ·∏£  #  1..arg 2
```
[Answer]
# Excel, 68 bytes
```
=LET(a,TOROW(SEQUENCE(,A1)+(A1+B1)*SEQUENCE(C1,,0)),FILTER(a,a<=C1))
```
`k`, `j` and `listmax` in `A1`, `B1` and `C1` respectively. Outputs a horizontal array.
[Answer]
# [Nibbles](http://golfscript.com/nibbles/index.html), 5.5 bytes
```
|,_-@%-$~+@
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m708LzMpKSe1eMGCpaUlaboWq2t04nUdVHVV6rQdICJQiRXR5jomOsaGsVA-AA)
Find all numbers \$n\$ from \$1\$ to \$m\$ such that \$(n-1) \bmod (k+j) < k\$.
```
|,_-@%-$~+@
|           filter
 ,           range
  _           max number
            by the following value being strictly positive:
   -         subtract
    @         k (number of elements to keep)
     %        modulo
      - ~      subtract 1 from
       $        the element
         +     add
          @     k (number of elements to keep)
                j (number of elements to drop)
```
[Answer]
# [Nibbles](http://golfscript.com/nibbles/index.html), 5.5 bytes (11 nibbles)
```
+.`/+@$,_<@
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m708LzMpKSe1eMGCpaUlaboWq7X1EvS1HVR04m0cICJQiRXR5jomOsaGsVA-AA)
Different approach to [xigoi's Nibbles answer](https://codegolf.stackexchange.com/a/263316/95126), but still 5.5 bytes...
```
+.`/+@$,_<@
  `/         # make chunks of size
    +@$      #  sum of first two arguments
       ,_    # from the range 1..third argument
 .           # then, for each chunk
         <@  #  take first arg elements
+            # and flatten the list of chunks
```
[Answer]
# JavaScript (ES6), 46 bytes
Expects `(k)(j)(listmax)`.
```
k=>j=>g=m=>m--?m%(k+j)<k?[...g(m),m+1]:g(m):[]
```
[Try it online!](https://tio.run/##bU9dT4MwFH3nV9wsMWmz0q0FhkxhT/royx4ZD8gK8lGYwEyM8bfj7ZbNmRhoLpyPe06r9CMdsr48jHbb7dWUh1MdRlUYFaEOI23bG31H6nlFH@tNzDkviKZMz0WyNl/rOJl69X4se0Vm@TCjvFfp/rls1PazzciS8rHbjn3ZFoTy4dCUI5ntWpTlXf@UZm9kgDCCLwugUSPEUDOoGGhIIISB63REyWK3ny8Kin8H8nLUr6qnD2jIunboGsWbriA5qSmpKBZC6ptOAvARYNsRxIKBw8Bj4DMIGMKJJUE4IIIrLxFe4fEv1OovlVgCXHB/DUYsziZpRDgdk4PTxemuzCIXpLzdg/n36MEywsWDXeTyFLg0mbeBTmJ5IDzD3MBoRJ9nyqBe@ldOIOZjnCP@kZ/KYrSQN9ne5cJ4sJNEXCIuvfNdJOLS4EFiBQHge9mc/AA "JavaScript (Node.js) ‚Äì Try It Online")
### Commented
```
k =>                 // 1st function taking k
j =>                 // 2nd function taking j
g = m =>             // 3rd recursive function taking m
m-- ?                // if m is not 0 (decrement it afterwards):
  m % (k + j) < k ?  //   if m modulo (k + j) is less than k:
    [...g(m), m + 1] //     append the result of a recursive call,
                     //     followed by m + 1
  :                  //   else:
    g(m)             //     just do a recursive call and append nothing
:                    // else:
  []                 //   stop
```
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 6 bytes
```
√∏·∏ä‚Å∞·∫éT‚Ä∫
```
[Try it Online!](https://vyxal.pythonanywhere.com/?v=2#WyIiLCIiLCLDuOG4iuKBsOG6jlTigLoiLCIiLCJbMywgMl1cbjYiXQ==)
(or 5.5 bytes if you're using vyncode)
```
√∏·∏ä     # Perform dyadic run length decoding - creates a list of
       # [[list_max] * k, [0] * j]
  ‚Å∞·∫é   # Slice to length list_max
    T‚Ä∫ # Truthy indices + 1
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~41~~ 37 bytes
-4 bytes thanks to [Dingus](https://codegolf.stackexchange.com/users/92901/dingus)
```
->k,j,m{m.times{p _1+1if _1%(k+j)<k}}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72kqDSpcsEiN9ulpSVpuhY3VXXtsnWydHKrc_VKMnNTi6sLFOINtQ0z04CUqka2dpamTXZtLUTxSrdoQx0THRPLWAh_wQIIDQA)
[Answer]
# Minecraft Function, 307 bytes
```
scoreboard players operation r d = c d
execute if score c d matches 0 run scoreboard players operation j d += k d
scoreboard players operation r d %= j d
scoreboard players add c d 1
execute if score r d < k d run tellraw @a {"score":{"name":"c","objective":"d"}}
execute if score c d < m d run function a:b
```
Must be run as a function named `b` in a data pack named `a`. The function increments `c` in a loop while `c < m`. Each iteration, if `c % (k + j) < k`, it prints `c`.
`k`, `j`, and `listmax` are input as scoreboard players `k`, `j`, and `m` for objective `d`. To set up the inputs, run the commands:
```
/scoreboard objectives add d dummy
/scoreboard players set k d <value>
/scoreboard players set j d <value>
/scoreboard players set m d <value>
```
The above commands could be considered part of the program, but since they are necessary to provide input they have not been counted.
[Answer]
# Swift, 40 bytes
```
{k,j,l in(1...l).filter{($0-1)%(k+j)<k}}
```
[Try it on SwiftFiddle!](https://swiftfiddle.com/z5tfmrpklfa6jkrrjdyepnogje)
[Answer]
# [><> (Fish)](https://esolangs.org/wiki/Fish), 48 bytes
```
![i](https://$ "read a character")![:](https://$ "Duplicate the top item on the stack")![i](https://$ "read a character")![+](https://$ "Pop 2 values of the stack then perform the given operation.")![i](https://$ "read a character")![0](https://$ "Push the number (0-9)")![v](https://$ "Change Cursor Direction")![/](https://$ "Reflect the cursor direction")
![v](https://$ "Change Cursor Direction")   ![1](https://$ "Push the number (0-9)")![+](https://$ "Pop 2 values of the stack then perform the given operation.")![>](https://$ "Change Cursor Direction")![$](https://$ "Move the top element of the stack back 1")![:](https://$ "Duplicate the top item on the stack")![@](https://$ "Move the top elemnt of the stack back 2")![$](https://$ "Move the top element of the stack back 1")![:](https://$ "Duplicate the top item on the stack")![@](https://$ "Move the top elemnt of the stack back 2")![(](https://$ "Greater than, less than. Push 1 or 0 to the stack.")![?](https://$ "Pop 1 value of the stack, if it's 0 skip the next instruction and move forward 2 spaces.")![;](https://$ "Halt")![:](https://$ "Duplicate the top item on the stack")![r](https://$ "Reverse the stack")![:](https://$ "Duplicate the top item on the stack")![}](https://$ "Shifts the entire stack left or right")![$](https://$ "Move the top element of the stack back 1")![:](https://$ "Duplicate the top item on the stack")![}](https://$ "Shifts the entire stack left or right")![$](https://$ "Move the top element of the stack back 1")![r](https://$ "Reverse the stack")![$](https://$ "Move the top element of the stack back 1")![@](https://$ "Move the top elemnt of the stack back 2")![%](https://$ "Pop 2 values of the stack then perform the given operation.")![)](https://$ "Greater than, less than. Push 1 or 0 to the stack.")![?](https://$ "Pop 1 value of the stack, if it's 0 skip the next instruction and move forward 2 spaces.")
![\](https://$ "Reflect the cursor direction")![1](https://$ "Push the number (0-9)")![+](https://$ "Pop 2 values of the stack then perform the given operation.")![:](https://$ "Duplicate the top item on the stack")![n](https://$ "output a number in decimal")![a](https://$ "Push the hexadecimal (10-15)")![o](https://$ "output a character")![\](https://$ "Reflect the cursor direction")
```
Hover over any symbol to see what it does
[Try it](https://mousetail.github.io/Fish/#eyJ0ZXh0IjoiaTppK2kwdi9cbnYgICAxKz4kOkAkOkAoPzs6cjp9JDp9JHIkQCUpP1xuXFwxKzpuYW9cXCIsImlucHV0IjoiNyA0IDMxIiwic3RhY2siOiIiLCJzdGFja19mb3JtYXQiOiJudW1iZXJzIiwiaW5wdXRfZm9ybWF0IjoibnVtYmVycyJ9)
Unformatted version of code if above looks broken:
```
i:i+i0v/
v   1+>$:@$:@(?;:r:}$:}$r$@%)?
\1+:nao\
```
[![enter image description here](https://i.stack.imgur.com/NSmQ2.png)](https://i.stack.imgur.com/NSmQ2.png)
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~15~~ 12 bytes
```
Ôº©‚äï‚åïÔº°‚Ä¶‚≠Ü¬≤‚≠ÜÔºÆŒπÔºÆ0
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMM5sbhEwzMvuSg1NzWvJDVFwy0zL8UxJ0fDuTI5J9U5I79AI7gEqDLdN7FAw0hHAcHxzCsoLfErzU1KLdLQ1FHI1AQSKGJAvpKBkiYQWP//b6hgomBi@V@3LAcA "Charcoal ‚Äì Try It Online") Link is to verbose version of code. Would have been 1 fewer byte with 0-indexing. Explanation: Now a port of @lyxal's Vyxal answer.
```
      ¬≤         Literal integer `2`
     ‚≠Ü          Map over implicit range and join
        ÔºÆ       Next input
       ‚≠Ü        Map over implicit range and join
         Œπ      Outer value
    ‚Ä¶           Cyclically extended to length
          ÔºÆ     Third input as a number
  ‚åïÔº°            Find all occurrences of
           0    Literal string `0`
 ‚äï              Vectorised increment
Ôº©               Cast to string
                Implicitly print
```
[Answer]
# [Arturo](https://arturo-lang.io), 31 bytes
```
$[k j l]->select l=>[k>%&-1k+j]
```
[Try it!](http://arturo-lang.io/playground?wlsAym)
```
$[k j l]->          ; a function taking three args
    select l=>[     ; select elts in [1..l], assign current elt to &
        k>          ; is k greater than...
        %&-1        ; current elt minus one modulo...
        k+j         ; k plus j?
    ]               ; end select
```
[Answer]
# [><> (Fish)](https://esolangs.org/wiki/Fish), 43 bytes
```
![i](https://. "read a character")![i](https://. "read a character")![:](https://. "Duplicate the top item on the stack")![i](https://. "read a character")![+](https://. "Pop 2 values of the stack then perform the given operation.")![0](https://. "Push the number (0-9)")![v](https://. "Change Cursor Direction")![1](https://. "Push the number (0-9)")
![)](https://. "Greater than, less than. Push 1 or 0 to the stack.")![r](https://. "Reverse the stack")![}](https://. "Shifts the entire stack left or right")![:](https://. "Duplicate the top item on the stack")![r](https://. "Reverse the stack")![:](https://. "Duplicate the top item on the stack")![<](https://. "Change Cursor Direction")![\](https://. "Reflect the cursor direction")![v](https://. "Change Cursor Direction")![?](https://. "Pop 1 value of the stack, if it's 0 skip the next instruction and move forward 2 spaces.")![)](https://. "Greater than, less than. Push 1 or 0 to the stack.")![%](https://. "Pop 2 values of the stack then perform the given operation.")![{](https://. "Shifts the entire stack left or right")![@](https://. "Move the top elemnt of the stack back 2")![:](https://. "Duplicate the top item on the stack")![&](https://. "If the register is empty, pop the top element of the stack and move it to the register. Else push the value of the register to the stack.")![@](https://. "Move the top elemnt of the stack back 2")![:](https://. "Duplicate the top item on the stack")![$](https://. "Move the top element of the stack back 1")![}](https://. "Shifts the entire stack left or right")![:](https://. "Duplicate the top item on the stack")![&](https://. "If the register is empty, pop the top element of the stack and move it to the register. Else push the value of the register to the stack.")![;](https://. "Halt")![?](https://. "Pop 1 value of the stack, if it's 0 skip the next instruction and move forward 2 spaces.")
![1](https://. "Push the number (0-9)")![+](https://. "Pop 2 values of the stack then perform the given operation.")![:](https://. "Duplicate the top item on the stack")![n](https://. "output a number in decimal")![a](https://. "Push the hexadecimal (10-15)")![o](https://. "output a character")![^](https://. "Change Cursor Direction")![+](https://. "Pop 2 values of the stack then perform the given operation.")![>](https://. "Change Cursor Direction")
```
Hover over any symbol to see what it does
In plaintext:
```
ii:i+0v1
)r}:r:<\v?)%{@:&@:$}:&;?
1+:nao^+>
```
[Try it](https://mousetail.github.io/Fish/#eyJ0ZXh0IjoiaWk6aSswdjFcbilyfTpyOjxcXHY/KSV7QDomQDokfTomOz9cbjErOm5hb14rPiIsImlucHV0IjoiMzEgNyA0Iiwic3RhY2siOiIiLCJzdGFja19mb3JtYXQiOiJudW1iZXJzIiwiaW5wdXRfZm9ybWF0IjoibnVtYmVycyJ9)
![control flow](https://i.stack.imgur.com/8kUq8.png)
[Answer]
# [Desmos](https://desmos.com/calculator), 36 bytes
```
l=[1...m]
f(k,j,m)=l[mod(l-1,k+j)<k]
```
Uses the same modulo trick that some other answers here have done to filter for the appropriate numbers.
[Try It On Desmos!](https://www.desmos.com/calculator/wxkq6chrj0?nographpaper)
[Try It On Desmos! - Prettified](https://www.desmos.com/calculator/gj59pizzxr?nographpaper)
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 8 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
LI¬π–∏¬£Œπ–ΩÀú
```
Inputs as \$max, [k,j]\$.
[Try it online](https://tio.run/##AR8A4P9vc2FiaWX//0xJwrnQuMKjzrnQvcuc//82ClszLDJd) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfWVC6KGV/30iDq27sOPQ4nM7L@w9Pee/zv/oaDOdaGMdo9hYHYVoQ0OdaEMdQwjbUifaSMfQGMIxQ@KYWIJUmYDZRkYgCQjb0BisyADCMdCJNtUxNIWoMgebC9FuDLTEHKZFJ9rSUsfSMjY2FgA).
Here an alternative 8 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage) approach:
```
LDI√ÖŒì¬π‚àç√è
```
[Try it online](https://tio.run/##yy9OTMpM/f/fx8XzcOu5yYd2PuroPdz//78ZV7SxjlEsAA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfWVC6KGV/31cIg63npt8aN2jjt7D/f8Pr9f5Hx1tphNtrGMUG6ujEG1oqBNtqGMIYVvqRBvpGBpDOGZIHBNLkCoTMNvICCQBYRsagxUZQDgGOtGmOoamEFXmYHMh2o2BlpjDtOhEW1rqWFrGxsYCAA).
**Explanation:**
```
L         # Push a list in the range [1, first (implicit) input `max`]
 I        # Push the second input-pair [`k`,`j`]
  ¬π–∏      # Repeat it the first input amount of times as list
    ¬£     # Split the first list into parts of those sizes,
          # containing empty trailing lists if it's out of bounds
     Œπ    # Uninterleave this list of lists into two parts
      –Ω   # Pop and only keep the first part
       Àú  # Flatten it
          # (after which the result is output implicitly)
```
```
L         # Push a list in the range [1, first (implicit) input `max`]
 D        # Duplicate this list
  I       # Push the second input-pair [`k`,`j`]
   √ÖŒì     # Pop the top two lists, and run-length decode it,
          # resulting in `k` amount of 1s followed by `j` amount of 2s
     ¬π‚àç   # Shorten/extend it to a length equal to the first input `max`
       √è  # Only leave the values in the ranged list at the truthy positions
          # (only 1 is truthy in 05AB1E)
          # (after which the result is output implicitly)
```
[Answer]
# [Java (JDK)](http://jdk.java.net/), 71 bytes
Output is an IntStream if that's acceptable.
```
(k,j,l)->java.util.stream.IntStream.range(1,l+1).filter(i->--i%(k+j)<k)
```
[Try it online!](https://tio.run/##fVLNjtowEL7vU4wsVXIUx8ImQNNtqTj2UPXQva32YIJBDiaksYOKqj321kdoX25fhE5@oCyEJrHsjGa@nxlnaqeibLE@FNXcmhRSq5yDz8rk8OPuDsDkXpdLlWqYYQDwybCCV95Y7nyp1YZ/yv3X5gRLiumwZnUVZO1mg3sse66xnFceKWZg4QMc6JplzAbR9DYgL1W@0lQwG4qAL41FLdRE0ygyb@g6zIL36@BwX0N36juG3dYsQO@UbfQUqlQb0appzvLsPGSAXCZfgf5e6NTrRdD57MKldpX1KNg1/2a5P8mjli/pEf2I3KIGjWsE2TuvN3xbeV5gubc5pUcirr9VyjraMgQfycvvn0DekZc/v4AEYRc@de@1xU5dj6j/zMcdvZXaV2V@NspZWaq9437b4lLHN6p42H6ZZ1RHU0JCHfBSL6pUU0IYVWyOg1PhPCSMBNwV1nhaH2/JbSaywVtFW4LHJ1Dl6qSnmRWAYPiKOsBwkUdsK85nxGDCIGEgxBMB6DrblUgmhkwk5yU4BDHGNbmVPb7Kvs4ULGZx8kpKjSlabFkX4j6sFeIe4x6P@/hiJiVc8KGbt4iD1kSMC53JQa/WAcq91Dq8zhwxgd/gIhPhEX3UZw2p5eQ8XfSkTVD7UEA/atMN9CHkmZHRsfG40KDEuMS4HLXNkhiXdTy5JksShp/4R3ZKwcv0fPgL "Java (JDK) ‚Äì Try It Online")
---
If that's not acceptable, then here's a more classic solution with an array as output (**81 bytes**) :
```
(k,j,l)->{var r="";for(int i=0;i<l;)r+=i++%(k+j)<k?i+",":"";return r.split(",");}
```
[Try it online!](https://tio.run/##dVJLbtswEN3nFAMBASSIEUxasqsobuADdNVlkAVr0wEl@lOKMhoEXnbXI7SXy0Xcp5/r2KokgsLozfsMlcu9vMuXxXFXfTN6QQsjy5K@SL2ht5sbIr1xyq7kQtEcBcL11Vm9eXl6ppWPj1SwGkN5u5kgA@hQd5ZOOhDOydDs6BcsZya4@/y2l5bszPOy1dY2BHo2yvSDyQIbznQY3vpFmAcPxaMOPebdA2iVq@yGbFTujHY@qkF2OGa1Rme6k9pv9ZLUXpqGdyetXPPWVvMuzt7HrMtB6sdOLZxaBh/ikVVlZRzNKMeAosppE82tla9l5LYtxDfRyu9FeoGWPGimAK7X0ql1tK1ctEOLMxvf7/Ui9b2SpvRboeDRe//9k5D3/c8v8oKwK5@mOZB0jUPyT6ch7UvZZ2hmQMQZbl4XGJb3BJ/InTCaMkoZcf7sEXVWuxbB@Jjx9LwFqfgEa/o/9OQKfY3kLGZx@sFKzclbblE3Yh/XDrHH2OPJkF7MhKALPaT5BB5E4zEWkonRoNcR7F56HV8jE8bxjC6QoAd7MhQN0mJ6DucDsCm8jzkNszbTQA4uzoIk/eCxEFCgLlAXSTssgbqo6@m1WJoyPPyf2AmCn@lw/As "Java (JDK) ‚Äì Try It Online")
[Answer]
# [Scala](https://www.scala-lang.org/), 48 bytes
```
(k,j,l)=>for(i<-0 until l if i%(k+j)<k)yield i+1
```
[Try it online!](https://tio.run/##dVLBboJAED2Xr5hLk924jewiUoyY9NhDT6Ynw4EKmoUtWlibmsZvpzOoSSMr2WGS2Xnz3hto15nJut1HWawtvGW6hl/P@84MVG2l9@UM2GttBVxfHJIF5rz4KfJl8bXCUgpJxypRCsOTxWbXMD1/8uFQW23AgN6AfmTVqOTzih91YXLQI9nlxQY@kY1lzbadwUvTZMfV0ja63qZ8Bu@1tpCgFMDnYY9la2p2lsSkADqSc4DxeHew@4NtAVZYDASEAiIBMTWk3i1UYRl7ZIzYGyhdTTGi@6jpHdQQgTcTPLFDInHIM5eiAZgDUo55QrCpkx@nKeWYpnq3zxeBE7KGRd/twac2t4dgiMBFSgrfiQh6TaHTOmlR0RAmHe1RPyeQbm8Xln5r2CnVP6Ph9YNh4AIUkdKawvNSFdYV1eMhaYxLopC3GlP84U7eqfsD)
Same modulo trick.
[Answer]
# [Bash](https://www.gnu.org/software/bash/)+coreutils, 41 bytes
```
seq 1 $3|xargs -n$[$1+$2]|cut -d\  -f1-$1
```
[Try it online!](https://tio.run/##Xc5NCgIxDAXgvad4iy4UKTRNndKzqIvxp7oSnCoI1rPXFIRpJVl95CU5jOla4nL1RknnOwiK82ucLgn6praK1sru8/H5gD7tAB1JKyqfRYQFI3jkKUnICLDQgAaoFjVQIxT@YegiDq6fcLC2AzIgnmEDkjbdWXnFz@BlB7d/hFCbflC@ "Bash ‚Äì Try It Online")
~~[59 bytes](https://tio.run/##Xc69DsIgEAfw3af4Dwxt0KQH2AYp8UGMgxKJpENjGbXPjjQxaTF30@8@77f4TL6q30jOMmn8OFVVsGRCb50J3DLiTNS5Hh8vsAB2GWzgjA60H3p3Hk7uauY07zwEJHSHzxRBaDLITC02QEvQBpYR0v/QFiMKquxQEKIAakByhSMoZ1Ocza90K3R5h9z@ofWS9IP0BQ "Bash ‚Äì Try It Online")~~: `c=$3;for((i=1;i<=c;i+=$1+$2)){ seq $i $[k=i+$1-1,k<c?k:c];}`
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 46 [bitsv2](https://github.com/Vyxal/Vyncode/blob/main/README.md), 5.75 bytes
```
‚ÇÄf·∫ãf·∫éT‚Ä∫
```
[Try it Online!](https://vyxal.pythonanywhere.com/?v=2#WyI9IiwiIiwi4oKAZuG6i2bhuo5U4oC6IiwiIiwiWzMsIDJdXG42XG4iXQ==)
Vyncode!!!
## Explained
```
‚ÇÄf·∫ãf·∫éT‚Ä∫¬≠‚Å°‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å°‚Å™‚Äè‚Å†‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å™‚Äè‚Å†‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å£‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å¢‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å§‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å£‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å°‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å§‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å¢‚Å™‚Äè‚Å†‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å£‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå¬≠
‚ÇÄf·∫ã      # ‚Äé‚Å°A list of [[1] * k, [0] * j]
   f     # ‚Äé‚Å¢flattened
    ·∫é    # ‚Äé‚Å£with the first listmax items taken, wrapping if needed
     T‚Ä∫  # ‚Äé‚Å§truthy indices + 1
üíé
```
Created with the help of [Luminespire](https://vyxal.github.io/Luminespire).
[Answer]
# [Go](https://go.dev), 79 bytes
```
func(k,j,n int)(o[]int){for i:=0;i<n;i++{if i%(k+j)<k{o=append(o,i+1)}}
return}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=bVLNSsNAEAaP-xRjQUjMVjOTTdKo9RX0XnIItZG1Nikh9VL6JF6K4EPp0_hta2tSZHcY-Ga-nyV5_3iut1_ny2I6L55ntChspexiWTft1aBctAP1VjRU0vhz1ZbD0ddDuaqm3ly_6Ips1fpePcldX5d1Q_ZmHN7au-rWBsHalmQvvHnw4t_N1_W4WC5n1ZNXaxuwv9moZtaummqzl_0-M0535-75tFbXl4oJh2k4vKcJa4o0xZpSTZkGnCshjoiz41wAJ6j0MEr6oxyChswfwS3zniRuCT1yPugG3SROyJBIVwf-I3AQhg0KWSTcGYbOs2sY5Somjt2kA4MIXuzCYF_S44yBpbCL-J_1XVhYs3S848ODUcgkwAW4xPu3CHBxeJarLCPcg3KuLq_VY4Ov9lp5pccah32_A4mGC2f_YEkPY220OV0zWuSUGYLcw2KN_ByeqMFB0h6WQi7qh8syjeuw359nu933Hw)
Port of [@SanguineL's answer](https://codegolf.stackexchange.com/a/263314/77309).
[Answer]
# [Nim](https://nim-lang.org/), 60 bytes
```
proc r(k,j,m:int)=
 for n in 1..m:
  if(n-1)%%(j+k)<k:echo n
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m704LzN3wYKlpSVpuhY3bQqK8pMVijSydbJ0cq0y80o0bbkU0vKLFPIUMvMUDPX0cq24FBQy0zTydA01VVU1srSzNW2yrVKTM_IV8iBmrCzSMNcx0TE21ITwYWYDAA)
]