text:
URL-Friendly Titles
People on this site really love to embellish their post titles...
Stewie's sequence: + * - / + * - /

However, when this title needs to be included in the page URL, it is simplified:
stewies-sequence

The Challenge
Your task is to create a program or function which, given a string representing a post title, outputs/returns its "URL-Friendly" conversion.
The algorithm is:

Convert to lowercase (where applicable)
Replace every space (), period (.), comma(,) or slash (/) with a dash (-)
Remove any non-alphanumeric characters, except dashes.
Minify groups of adjacent dashes (a---b -> a-b), remove any that are leading/trailing.

Please note that this algorithm is a simplification, and may not always produce the same results as the site's real method.

Rules

You can assume that input:

Will not be empty.
Will contain at least one alphanumeric character.
Will only contain characters in the ASCII range 32-126 (printable)

Full programs or functions are permitted.
A builtin which does the exact task specification is not permitted.
This is code-golf, so the shortest solution (in bytes) wins!

Test Cases
Most posts on this site will serve as tests, but here's a handy list:
Loading... Forever       -> loading-forever
N(e(s(t))) a string      -> nest-a-string
"Hello, World!"          -> hello-world
URL-Friendly titles      -> url-friendly-titles

C.U.S.R.S                -> c-u-s-r-s
1+2+3+4+...+n = -1/12?   -> 1234-n-1-12
How can I use cmp(a,b)   -> how-can-i-use-cmpa-b

Some longer ones...
Export The $PATH Variable, Line-By-Line   -> export-the-path-variable-line-by-line
Do n and n^3 have the same set of digits? -> do-n-and-n3-have-the-same-set-of-digits
Quine Anagrams! (Cops' Thread)            -> quine-anagrams-cops-thread
The Golfer Adventure - Chapter 1          -> the-golfer-adventure-chapter-1
Bootloader golf: Brainf***                -> bootloader-golf-brainf

And some edge-case checking samples (feel free to suggest more):
0123   ->   0123
a a1   ->   a-a1
2-1=1  ->   2-11

What about leading -s? Will they have to be removed? For example in asdf-, will the last - have to be removed?

Can we use a built-in function to check if the char is alphanumeric like this if(isalphanum(ch))...

@KritixiLithos Minify groups of adjacent dashes (a---b -> a-b), remove any that are leading/trailing. I guess this should make you clear.

And what about _ underscores? My code works except when there are underscores.

@L3viathan Doesn't matter now, I changed my code so that even underscores will be removed

@MukulKumar yes, that's fine. A built-in is only disallowed if it completes this exact algorithm.

@KritixiLithos I just did some poking around and it looks like they actually create dashes,, but because I don't want to invalidate answers, so I'll accept any behaviour with underscores.

Anything about underscores?

@OldBunny2800 you can either replace them with a dash or treat them as invalid characters. really they should create dashes but I don't want to invalidate all the answers by changing the rules now.

Retina, 33 31 bytes
T`L`l
[^a-z ,-9]+

\W+
-
^-|-$

(The program has a trailing newline)
I'm not sure I can squeeze more out of this. This should cover everything. Came similar to Mama Fun Roll's. Another 33 bytes version using recursive regexes
Try it online!
Explanation
T`L`l

This line is simple, it converts to lowercase by Transliterating A-Z (L) to a-z (l, lowercase).

This stage is simple, it essentially gets rid of all unneeded characters to save ourselves a lot of trouble later on
[^a-z ,-9]+

[^a-z ,-9] Matches any character that is NOT:

a-z: lowercase alphabet (remember entire string is lowercase because of previous item)
: space chacacter
,-9 this is char code range of , to 9 which happens to be ,-./0123456789, exactly the characters we need

Next we convert all non alphanumeric chars to dashes (which is now just  and ,./-.
\W+
-

This won't (not) match _ which is included in \w (negation of \W) because it was removed in the previous stage

I think this will fail for inputs like a = b.

I really want to accept this, but as martin said, it doesn't minify adjacent dashes when you input a = b :(

@Flp.Tkc sorry for late response (Finals week right now). I've managed to squeeze out two more bytes and fix it. I believe this correctly handles such cases now

JavaScript (ES6), 90 82 79 75 bytes
This is an attempt to do the job with a single replace(). This code extracts only the characters that we're interested in and ignores everything else. There's some additional logic to process the hyphens.
s=>(s.toLowerCase().replace(/[ a-z,-9]/g,c=>S=c<'0'?s+'-':s=s?S+c:c,s=0),s)

Test cases

let f =

s=>(s.toLowerCase().replace(/[ a-z,-9]/g,c=>S=c<'0'?s+'-':s=s?S+c:c,s=0),s)

console.log(f(`Loading... Forever`));                         // -> loading-forever
console.log(f(`N(e(s(t))) a string`));                        // -> nest-a-string
console.log(f(`"Hello, World!"`));                            // -> hello-world
console.log(f(`URL-Friendly titles`));                        // -> url-friendly-titles
console.log(f(`C.U.S.R.S`));                                  // -> c-u-s-r-s
console.log(f(`1+2+3+4+...+n = -1/12?`));                     // -> 1234-n-1-12
console.log(f(`How can I use cmp(a,b)`));                     // -> how-can-i-use-cmpa-b
console.log(f(`Export The $PATH Variable, Line-By-Line`));    // -> export-the-path-variable-line-by-line
console.log(f(`Do n and n^3 have the same set of digits?`));  // -> do-n-and-n3-have-the-same-set-of-digits
console.log(f(`Quine Anagrams! (Cops' Thread)`));             // -> quine-anagrams-cops-thread
console.log(f(`The Golfer Adventure - Chapter 1`));           // -> the-golfer-adventure-chapter-1
console.log(f(`Bootloader golf: Brainf***`));                 // -> bootloader-golf-brainf
console.log(f(`0123`));                                       // -> 0123
console.log(f(`a a1`));                                       // -> a-a1
console.log(f(`2-1=1`));                                      // -> 2-11
console.log(f(',a^a,'));                                      // -> aa

For ,a^a,, this code gives -aa- (there are leading/trailing hyphens)

@KritixiLithos Oh, thanks for pointing this out. I didn't pay attention to that rule. That should be fixed.

V, 41, 40, 37, 36 bytes
VuÍ[ .,\/]/-
Í0-9a-z]
Í-«/-
Í^-ü-$

Try it online! or Check all test cases at once!
As usual, here this contains a bunch of unprintable and non-ASCII characters, so here is a hexdump:
0000000: 5675 cd5b 202e 2c5c 2f5d 2f2d 0acd 8430  Vu.[ .,\/]/-...0
0000010: 2d39 612d 7aad 5d0a cd2d ab2f 2d0a cd5e  -9a-z.]..-./-..^
0000020: 2dfc 2d24                                -.-$

It's challenges like these where V's "Compressed regex" system come in handy.
Explanation
First things first, we will convert everything to lowercase. Fortunately there is a really convenient way to do this in two bytes. I wrote a tip about that here. So we do
V           " Visually select this whole line
 u          " Convert this whole line to lowercase

After that we do a bunch of compressed substitute commands. A nice overview of how V's compressed regex works can be foud here, but the basic idea is we can set the high-bit to avoid having to escape certain characters. Another convenience is that ranges (like :%) and flags (like /g) are automagically filled in. But in the end, it all translates to vim substitute commands. In fact, we could even directly translate the rest of the program to vim. That would give us this:
:%s/[ .,/]/-/g
:%s/[^0-9a-z\-]//g
:%s/-\+/-
:%s/^-\|-$//g

If you speak vim-regex, it should be more clear what the rest of the program does now. So here is the rest of the program:
Í               " Substitute:
 [ .,\/]        "   a space, period, comma or forward slash. (Due to a strange bug, this needs to be escaped)
        /-      "   with a dash
Í               " Remove:
 [^0-9a-z]     "   Any character that is not a dash or alpha-numeric
Í               " Substitute:
 -«             "   One or more dashes
   /-           "   with one dash
Í               " Remove:
 ^-             "   A dash at the beginning of a line
   ü            "   OR
    -$          "   a dash at the end of a line

JavaScript (ES6) 91 96
1 bytes saved thx @ETHproductions
s=>s.toLowerCase().replace(/([ .,/-])|\W|_/g,(c,d)=>d?'-':'').replace(/^-*|-*$|-(?=-)/g,'')

Test

F=
s=>s.toLowerCase().replace(/([ .,/-])|\W|_/g,(c,d)=>d?'-':'').replace(/^-*|-*$|-(?=-)/g,'')

;[['Loading... Forever.....', 'loading-forever'],
['N(e(s(t))) a string', 'nest-a-string'],
['"Hello, World!"', 'hello-world'],
['URL-Friendly titles', 'url-friendly-titles'],
['C.U.S.R.S','c-u-s-r-s'],
['1+2+3+4+...+n = -1/12?', '1234-n-1-12'],
['How can I use cmp(a,b)', 'how-can-i-use-cmpa-b'],
['Export The $PATH Variable, Line-By-Line', 'export-the-path-variable-line-by-line'],
['Do n and n^3 have the same set of digits?', 'do-n-and-n3-have-the-same-set-of-digits'],
['Quine Anagrams! (Cops\' Thread)', 'quine-anagrams-cops-thread'],
['The Golfer Adventure - Chapter 1', 'the-golfer-adventure-chapter-1'],
['Bootloader golf: Brainf***', 'bootloader-golf-brainf'],
['0123', '0123'],
['a a1', 'a-a1'],
['2-1=1', '2-11']]
.forEach(t=>{
  var i=t[0],k=t[1],r=F(i)
  console.log(r==k?'OK':'KO',i+' -> '+r,r==k?'':k)
})

This has exactly the same bytecount as my answer if it is converted to a named function

Don't think you need the last * in the last regex, though I may be wrong

I may be mistaken, but are you sure the lookahead is necessary?

@KritixiLithos the lookahead is necessary to keep at least 1 - inside the string, while removing all at start and end

@ETHproductions right, thanks

Python 3, 103 100 96 95 bytes
5 bytes saved thanks to Flp.Tkc
import re
lambda s,y=re.sub,d='-':y('-+',d,y('[^0-9a-z-]','',y('[ .,/]',d,s.lower()))).strip(d)

@Flp.Tkc Indeed..

Oops, I accidentally downvoted this. I can't reverse my vote until you edit this post

@KritixiLithos Done

Retina, 34 bytes

T`L`l
[^a-z\d .,/-]+

\W+
-
^-|-$

Try it online!
Note the trailing newline. Essentially the OP's implementation.

The TIO link points to a slightly different code

Yeah I just fixed it.

You can use T\L`l` to go to lowercase with less bytes

Fails on a.. snd similar

fixed @Downgoat

This doesn't work for the 1+2+3+4+n = - 1/12 test case, but this should cover you (and save a byte)!

[\W] is just \W

MATL, 38 bytes
'-'jyvk45y' .,/'m(t8Y245hm)'-*'45YX6L)

Try it online! Or verify all test cases.
Explanation
'-'jyv       % Take input line. Append and prepend a dash. Gives a char column vector
k            % Convert to lowercase
45y' .,/'m(  % Replace any of ' .,/' by a dash, using assignment indexing
t8Y245hm)    % Keep only alphanumeric chars or dashes, using reference indexing
'-*'45YX     % Replace each run of dashes by a single dash, using a regular expression
6L)          % Remove first and last chars, which are always dashes. Implicitly display

JavaScript (ES6), 74 69 bytes

f=
s=>s.toLowerCase().replace(/[^-/,. a-z\d]/g,``).match(/\w+/g).join`-`
<input oninput=o.textContent=/[a-z\d]/i.test(this.value)?f(this.value):``>

Edit: Saved 5 bytes by realising that I had already deleted all characters except -/,. 0-9a-z so I can use \w to match the remaining words.

I think you have to include the HTML code into the bytecount since it is being used to solve the challenge

@KritixiLithos No, it's only there for demonstration purposes. The question says that my code can assume at least one alphanumeric character, and the HTML code simply tests this before calling the function.

[a-z\d] could be [^\W_] ?

@edc65 Nice, but I then realised that it could be even simpler!

Ruby, 61 60 61 64 53 bytes
(52 bytes of code plus one byte for the -p)
$_=$_.tr("A-Z ,-/","a-z ").gsub(/[^\w ]/){}.split*?-

Try it online!

tr(…) – convert upper case characters, space, comma, period, and slash. Temporarily substitute the - with whitespace so I can use strip later on.
  Note the - character in the "A-Z ,-/" expression is actually a range operator, which also makes the . character subject to transformation. This maneuver won’t actually shave off bytes but it’s fancy so it gets to stay.
gsub(/[^\w ]/){} – remove all characters not in the allowed set.
split – technically, we don’t exactly need that array but split eliminates leading and trailing whitespace (which is actually - characters in disguise). As a bonus, this squeezes together runs of multiple spaces.
*?- – Shorthand for .join("-"); this reverses both the preceding split operation and the whitespace transformation at the same time. One more byte is saved by using the abbreviated notation for character literals, which makes the program require Ruby 1.9 or newer.

Update 1: Using gets instead of Ruby’s stream editing mode saves one byte.
Reverted as per ValueInk’s suggestion.
Update 2: (+3 bytes overall)

Fixed edge case ..--hi, $/ (→ hi) (+10 bytes) – once again courtesy of user ValueInk
Took malus for -p (+1 byte)
Got rid of squeeze and used gsub instead (+2 bytes), which allowed me to:
Use strip to handle the leading and trailing dashes (-10 bytes).

Update 3: Hattrick by ValueInk. We save 11 bytes by leveraging String#split’s habit of auto-squeezing runs of the same separator, which enables us to ditch the whole final strip/gsub chain and replace it by a split/join combo. (-11 bytes)

This only returns the string in a REPL environment and fails if run as a proper Ruby program, and that's no good. Full programs or functions/lambdas only. In fact, your old version would've worked with the -p flag, but this definitely won't.

@ValueInk You are of course correct. I’ve changed my solution accordingly. Thanks for your comment; it is exactly the kind of guidance I appreciate a lot as this is my first attempt at golfing.

Thank you for making the fix; I have removed my downvote. A thing to note is that using the -p flag implicitly adds 1 byte to your code (because it changes your code execution from ruby -e 'your code' to ruby -pe 'your code'). I have also found one edge case where it gives -hi- for input like ..--hi, $/ when you should be removing all leading/trailing dashes and thus be returning hi.

@ValueInk Thanks once again. I have edited my answer to fix both issues.

-2 bytes by changing gsub(/[^\w ]/){} to tr('^a-z ',''), and then end with .split*?- instead of .strip.gsub... since it automatically handles duplicates and the ends of the string, all in one go!

@ValueInk Regarding that tr: unfortunately, we’re supposed to preserve the digits (the \w regexp covers that); another possible variation of tr('^a-z0-9','') would actually add one byte to the tally.
The split/join combo is brilliant though. Thanks – this saved a whopping 11 bytes!

Since nobody said it, welcome to code-golf!

JavaScript, 90 98 94 93 91 90 91 bytes
1 byte saved thanks to @edc65!
1 byte saved thanks to @IsmaelMiguel for spotting a leading semi-colon!
1 byte gained after failing for ,a-^-a,
f=s=>s.toLowerCase().replace(/[^ a-z,-9]/g,"").replace(/[ ,-/]+/g,"-").replace(/^-|-$/g,"")

The thing I like most about this particular submission are the ranges. In the first replace, we remove anything that is not alphanumeric and not a ,,-,.,/ and not a space. We use a-z for detecting the letters, and we use ,-9 to detect those special characters and numbers since the character codes of these ASCII literals all line up!
, = 44
- = 45
. = 46
/ = 47
0 = 48
...
9 = 57

f=s=>s.toLowerCase().replace(/[^ a-z,-9]/g,"").replace(/[ ,-/]+/g,"-").replace(/^-|-$/g,"")

console.log(f("---"));//TEST
console.log(f("!@#$%ˆ&*()_+"));//TEST

console.log(f("Stewie's sequence: + * - / + * - /-"));

console.log(f("Loading... Forever"));
console.log(f("N(e(s(t))) a string"));
console.log(f("\"Hello, World!\""));
console.log(f("URL-Friendly titles"));

console.log(f("C.U.S.R.S"));
console.log(f("1+2+3+4+...+n = -1/12?"));
console.log(f("How can I use cmp(a,b)"));

console.log(f("Export The $PATH Variable, Line-By-Line"));
console.log(f("Do n and n^3 have the same set of digits?"));
console.log(f("Quine Anagrams! (Cops' Thread)"));
console.log(f("The Golfer Adventure - Chapter 1"));
console.log(f("Bootloader golf: Brainf***--"));

console.log(f("0123"));
console.log(f("a a1"));
console.log(f("2-1=1"));
<input oninput=a.textContent=f(this.value)>

Doesn't remove leading dashes: "-1" becomes "-1", when it should become "1".

@L3viathan Should work now

No need to count f= so your byte count is 96 right now. And no need of the \ inside a range in the regexp, so it could be 95. But ... still not working: try ...title

@edc65 I have edited it so it should work now. Also, thanks for the tip for removing the \\ :)

Hei! I'm not that old! (65 not 64)

I believe you don't need the f= and the ; at the end. Just specify that this is an anonymous function. With this, your answer should be 90 bytes long.

@IsmaelMiguel Thanks for spotting the lone ;! But the reason I don't use anonymous functions is because I personally detest them

Then why did you used one?

Here, a shorter one: f=s=>s.toLowerCase().replace(/[ ,-/]+/g,"-").replace(/^-|-$|[^ a-z,-9]/g,""). I've moved the 1st RegExp into the last.

@IsmaelMiguel Doesn't work for a-^-a, it gives a--a. That is why I ordered my regexps in that order

Makes sense. I really didnt test with that.

PHP, 87 bytes
The idea of the regular expressions come from existing answers.
<?=trim(preg_replace(['@[^ a-z,-9]@','@[ ,-/]+@'],['','-'],strtolower($_GET[T])),'-');

It requires you to have a server running PHP, and access over HTTP.
The title must be on the key T, and the result will be printed on the screen.
Example: http://localhost/title.php?T=<my shiny title>

bash/Unix tools, 56 bytes
tr A-Z\ .,/ a-z-|tr -cds a-z0-9- -|sed s/^-//|sed s/-$//

Replace upper-case with lower-case letters, and the required special characters with dashes.
Delete (-d option to tr) characters other than letters, digits, and dashes, and then squeeze (-s option to tr) multiple dashes in a row into a single dash.
Delete dashes at the beginning, and then at the end.

Powershell, 85 Bytes
($args[0].ToLower()-replace'[ .,/]','-'-replace'[^a-z,-9]'-replace'-+','-').Trim('-')

make it lowercase, then 3 regex replaces in a row, and trim any trailing -'s

mightn't $input save you 2 bytes?

Perl 6, 75
{lc .subst(/<[\ .,/]>/,"-"):g.subst(/<[\W]-[\-]>/,""):g.subst(/\-+/,"-"):g}

Lua, 91 bytes
a=a:lower():gsub( '[ .,/]', '-' ):gsub( '[^%w-]', '' ):gsub( '%-+', '-' ):match'%-?(.*)%-?'

Where a is the URL string.
Explanation:

Most of it's pretty straight forward. a:lower() returns the lower-case function
:gsub finds the match of the pattern and replaces it with the string.
'[ .,/]': Brackets mean "or", so this matches space, period, comma, and slash. No need to be greedy because :gsub does all occurrences.
'[^%w-]': ^ means "not" when inside brackets, %w means anything alphanumeric. So '[^%w-] matches anything that's not alphanumeric or a dash.
'%-+': Match as many dashes as you can and replace them with just one dash.
match'%-?(.*)%-?': In Lua, if a string is the function's only argument, no parenthesis are needed. Only needs to check for one dash at the start and end because dashes have been minimized already. No need for anchor characters because .* is match everything, greedy.

C, 194 bytes
i,j;f(char*s,char*d){if(*s>47&*s<58|*s>96&*s<123)d[i++]=*s;if(*s>64&*s<91)d[i++]=*s+32;if(i-j&&*s>43&*s<48|*s==32&&*(s+1)&&*(s+1)>47|(*(s+1)<44&&*(s+1)^32)){d[i++]=45;j=i;}*++s?f(s,d):(d[i]=0);}

Call with:
int main()
{
    char *in="Loading... Forever";
    char out[128];
    f(in,out);
    puts(out);
}

SAS, 108
One of the less competitive answers here due to the verbose syntax of SAS - the 9 character penalty per regex really hurts - but it was a good regex learning exercise:
t=prxchange('s/^-|-$//',-1,prxchange('s/-+/-/',-1,compress(translate(lowcase(t),'----',' .,/'),'-','adk')));

Pyth, 35 bytes
:r::rQ0"[-.,/]"d"[^\w ]"k6"[ -]+"\-

Explanation
    rQ0                              Convert letters to lower case
   :   "[-.,/]"d                     Replace all -.,/ with spaces
  :             "[^\w ]"k            Remove all remaining symbols
 r                       6           Remove leading and trailing spaces
:                         "[ -]+"\-  Turn runs of spaces and dashes to one dash

GNU Sed, 65 bytes
s/.*/\L\0/
s@[ .,/]@-@g
s/[^-a-z0-9]//g
s/-\+/-/g
s/^-\|-$//g

A series of regex substitutions.  Uses non-portable \L from GNU sed to lowercase the input.  Run from a file using sed -f.


text:
Generate all combinations of given list of elements, sorted
Make a code that takes a list and a number as input, and generates all possible combinations with the length of the number. For example, with the list {0,1} and the number 2:
00
01
10
11

Your program doesn't have to expect characters twice or more often in the list, such as {0,0,0,0,0,1,1,5,5}
Make sure you print the combinations out sorted, in the order of the list:
With the list {0,1} and the number 5 (generated by some of my code, which is a way too long to win):
00000
00001
00010
00011
00100
00101
00110
00111
01000
01001
01010
01011
01100
01101
01110
01111
10000
10001
10010
10011
10100
10101
10110
10111
11000
11001
11010
11011
11100
11101
11110
11111

But with the list {1,0} and the number 2:
11
10
01
00

As you can see, reversed list means reversed order.
Take a look at the structure, it's like a tree.
This is code-golf, so the shortest code in bytes wins!

I thought this would be duplicate, but I can't find one

How does the sorting work if the input list isnt sorted?

@Jarko I'd assume the tuples of indices of the input are sorted in the output

Can the output be a list of lists ((0,0),(0,1),(1,0),(1,1)) from a function?

@brad, the default answer is yes unless OP has said something else.

What StewieGriffin says is right.

@StewieGriffin I never understand why people would pick a username like that. Why would you :O?

I don't understand... what's wrong with using my own name as a username?

Do we have to handle lengths of 0?

No, you wont have to.

Jelly, 1 byte
ṗ

TryItOnline
Cartesian power built-in atom, as a dyadic link with left argument the items and right argument the count, or as a full program with first argument the items and second argument the count.

One byte ! That solved it !

You know what, I'm gonna submit a ZERO byte answer! In JAVA! How do you like that, huh? :) (Seriously, though. Nice golfing.)

Haskell, 20 bytes
(mapM id.).replicate

Usage exaple:
*Main> ( (mapM id.).replicate )  2 "01"
["00","01","10","11"]
*Main> ( (mapM id.).replicate )  2 "10"
["11","10","01","00"]

replicate makes n copies of the 2nd parameter and mapM id builds the combinations. Btw, mapM id is the same as sequence, but 1 byte less.

MATL, 2 bytes
Z^

Cartesian power builtin...
Try it online!

Pyth, 2 bytes
^F

A program that takes input in the form list,number and prints a list of lists.
Test suite
How it works
^F   Program. Input: Q
^FQ  Implicit input fill
 F   Fold
^    repeated Cartesian power
  Q  over Q
     Implicitly print

this seems to solve it, but probably somebody else is able to do this with one byte ?

yes, somebody else won(jelly, one byte) but nice solution, anyway

Perl 6, 15 bytes
{[X] @^a xx$^b}

Explanation:
{[X] @^a xx$^b}

{             } # bare block lambda

     @^a        # declare first parameter as Positional
           $^b  # declare second parameter
         xx     # list repeat ｢@a｣, ｢$b｣ times

# at this point given ｢ (0,1), 5 ｣
# ((0 1) (0 1) (0 1) (0 1) (0 1))

 [ ]            # list reduce
  X             #    using cross meta-operator

# results in a list of lists
# ((0 0 0 0 0)
#  (0 0 0 0 1)
#  (0 0 0 1 0)
#  (0 0 0 1 1)
#  (0 0 1 0 0)
#  (0 0 1 0 1)
#  ...
#  (1 1 1 1 1))

say {[X] $^a xx$^b}( (0,1), 2 ); # ((0 0) (0 1) (1 0) (1 1))
say {[X] $^a xx$^b}( (1,0), 2 ); # ((1 1) (1 0) (0 1) (0 0))
say {[X] $^a xx$^b}( (0,1,2), 2 );
# ((0 0) (0 1) (0 2) (1 0) (1 1) (1 2) (2 0) (2 1) (2 2))

put {[X] $^a xx$^b}( (0,1), 5 )».join;
# 00000 00001 00010 00011 00100 00101 00110 00111 01000 01001 01010 01011 01100 01101 01110 01111 10000 10001 10010 10011 10100 10101 10110 10111 11000 11001 11010 11011 11100 11101 11110 11111

If they ever upgrade to a release of Rakudo from after the official release of Perl 6 you will be able to run this at Ideone.

JavaScript (Firefox 30+), 55 bytes
f=(a,n)=>n?[for(b of a)for(c of f(a,n-1))[b,...c]]:[[]]

I'm 99% certain recursion is the best way to go about this in JavaScript.

Mathematica, 6 bytes
Tuples

Still worse than Jelly :(
Usage
Tuples[{0, 1}, 5]

{{0, 0, 0, 0, 0}, {0, 0, 0, 0, 1}, {0, 0, 0, 1, 0}, {0, 0, 0, 1, 1}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 1}, {0, 0, 1, 1, 0}, {0, 0, 1, 1, 1}, {0, 1, 0, 0, 0}, {0, 1, 0, 0, 1}, {0, 1, 0, 1, 0}, {0, 1, 0, 1, 1}, {0, 1, 1, 0, 0}, {0, 1, 1, 0, 1}, {0, 1, 1, 1, 0}, {0, 1, 1, 1, 1}, {1, 0, 0, 0, 0}, {1, 0, 0, 0, 1}, {1, 0, 0, 1, 0}, {1, 0, 0, 1, 1}, {1, 0, 1, 0, 0}, {1, 0, 1, 0, 1}, {1, 0, 1, 1, 0}, {1, 0, 1, 1, 1}, {1, 1, 0, 0, 0}, {1, 1, 0, 0, 1}, {1, 1, 0, 1, 0}, {1, 1, 0, 1, 1}, {1, 1, 1, 0, 0}, {1, 1, 1, 0, 1}, {1, 1, 1, 1, 0}, {1, 1, 1, 1, 1}}

Perl, 30 bytes
28 bytes of code + -nl flag.
$"=",";say for glob"{@F}"x<>

To run it:
perl -alE '$"=",";say for glob"{@F}"x<>' <<< "1 0
2"

I think that taking the input as a list of numbers is logical for Perl. However, if we allow some fantasy, and take the input with the brackets and comma (as shown in the question), we can go down to 20 bytes:
perl -nlE 'say for glob$_ x<>' <<< "{1,0}
2"

Explanations:
glob initial purpose in Perl is list and iterate through filenames, but when its argument contains curly brackets, it generates combinations formed of one element of each bracket group.
-a autosplit on spaces the input, and put the result inside @F array.
$" is the list separator: it's the separator inserted between the elements of a list inside a string. We set it to ,, so "{@F"} produces {.,.} (if @F contains 0 and 1).
Then x is the string repetition operator (and <> gets one line of input).
And finally, say for iterates through the list generated by glob and prints the elements.

Python, 57 bytes
from itertools import*
lambda o,n:list(product(*([o]*n)))

repl.it
Unnamed function taking a list of objects, o and a count, n and returning a list of the combinations.

Pure Bash, 36
printf -vv %$2s
eval echo ${v// /$1}

Input by command-line params - The list is a comma-separated list in braces, e.g.:
./elemcombo.sh "{0,1}" 2

Note the input list needs to be quoted so the calling shell does not expand it too early.
Ideone.

This doesn't seem to work.

It only repeats the input n times, doesn't print all possible combinations.

@IporSircer I clarified the required input format.  Does that work for you now?

bash a.sh "{0,1}" 2 --> {0,1}{0,1} (version 4.4.5(1)-release)

@IporSircer I just git-cloned and built 4.4.5(1)-release and I get the correct output 00 01 10 11.  What is your output when you invoke bash with a -x?  Do you see this answer works in the Ideone link?

Hmm, strange. The code on Ideone is working for me correctly. But when i copypaste the function to a single file, it gets wrong. Making function is the key. See yourself at: https://tio.run/nexus/bash#@19QlJlXkqagW1amoKpiVMyVWpaYo5CanJGvoFJdpq@voK9iWPv//3@lagMdw1olBSMA

@IporSircer It looks like TIO is probably putting the args into an execve() or similar call.  The quotes are only needed when the script is called from another shell in order to prevent the calling shell from doing expansion of the braces.  I the TIO case, the list does not need quotes.  https://tio.run/nexus/bash#@19QlJlXkqagW1amoKpiVMyVWpaYo5CanJGvoFJdpq@voK9iWPv///9qAx0gbQQA

R, 53 45 bytes
function(x,n)rev(expand.grid(rep(list(x),n)))

Try it online!
rev is there to the conform with the precise sort order requested (which doesn't really seem essential to the problem) and adds 5 bytes.

Just rev for 45 bytes :)

Had matrix on the mind and forgot the result was actually a list (data frame).

05AB1E, 2 1 bytes
ã

-1 byte thanks to @Emigna.
Try it online.
Input as number\nlist, output as list of lists.
Explanation:
     # Implicit input `a`, `b`
ã    # Take the Cartesian product of list `b` repeated `a` times

You don't need the I here.

@Emigna Ah of course. I had the I because I initially was trying to figure out how to have multiple inputs and had the number and list reversed. Pretty stupid to keep the I there.. Thanks!

Racket 123 bytes
(let p((s "")(l(map number->string(sort l <))))
(if(= n(string-length s))(displayln s)(for((i l))(p(string-append s i)l))))

Ungolfed:
(define(f l n)
  (let loop ((s "")
             (l (map number->string (sort l <))))
    (if (= n (string-length s))
        (displayln s)
        (for ((i l))
          (loop (string-append s i) l)))))

Testing:
(f '(0 1) 2)
(f '(0 1) 3)
(f '(0 1) 5)

Output:
00
01
10
11

000
001
010
011
100
101
110
111

00000
00001
00010
00011
00100
00101
00110
00111
01000
01001
01010
01011
01100
01101
01110
01111
10000
10001
10010
10011
10100
10101
10110
10111
11000
11001
11010
11011
11100
11101
11110
11111

PHP, 109 bytes
for($o=$a=array_slice($argv,2);--$argv[1];$o=$c,$c=[])foreach($a as$n)foreach($o as$s)$c[]=$n.$s;print_r($o);

Takes the length as the first argument and the list as any further arguments.
Use like:
php -r "for($o=$a=array_slice($argv,2);--$argv[1];$o=$c,$c=[])foreach($a as$n)foreach($o as$s)$c[]=$n.$s;print_r($o);" 5 0 1

Will run into an "out of memory" fatal error if asked for length 0.

You wont have to handle length 0.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Sum digits till Square
Given is any integer x > 0 and any base y > 3.

Sum all digits of x (if written in the set base).
Multiply this by the highest possible digit (is always base -1).
Repeat until this value is (y - 1) ^ 2

Searched is the count of iterations and the steps.
Example 1:
x= 739
y= 7
searched: (7 - 1) ^ 2 = 36

based: (b7)2104
sum: (dec)7
mul: (dec)42

based: (b7)60
sum: (dec)6
mul: (dec)36

2 steps needed -> answer is [2, 739, 42, 36] or [739, 42, 36, 2]

Example 2:
x = 1712
y = 19
s: 324

step1: 1712 -> 360
step2:  360 -> 648
step3:  648 -> 324

3 steps needed -> answer is [3, 1712, 360, 648, 324] or [1712, 360, 648, 324, 3]

Special:
In some cases (some combinations with a base of 3) you will not be able to get to (y - 1) ^ 2 like for x = 53 and y = 3. For this reason y needs to be bigger than 3 and you can ignore this.
The count of iterations need to be the first or the last value
This is code-golf lowest byte-count wins.

Requiring the number of steps in the answer seems like an unnecessary addition to the problem. My solution had to add 21 bytes to do what amounted to finding the length of a list and subtracting 1.

@ngenisis going with just an order of the output, but ignoring the method (array, stack, delim. string, multiple strings....). To keep track of 2 different things (final value and count) avoids the "blind" collecting of values (more or less) and is a good addition to my eye. Maybe a different approach will need 5 more bytes at the calculation but saves 8 at the counting part (just random numbers here).

Jelly, 14 13 bytes
-1 byte by printing as it loops (Ṅ replacing a chain separation, µ and concatenation ;)
Ṅb⁹S×⁹’¤µÐĿL’

TryItOnline!
How?
Ṅb⁹S×⁹’¤µÐĿL’ - Main link: x, y
        µÐĿ   - loop monadically until results are no longer unique and collect
Ṅ             - print z (initially x), then result of previous loop and return z
  ⁹           -     right argument (y, even though monadic)
 b            -     left to base right
   S          -     sum (the result was a list of base y digits)
       ¤      -     nilad followed by link(s) as a nilad
     ⁹’       -         y decremented
    ×         -     multiply
           L  - length(z)
            ’ - decrement
              - implicit print

The alternative 13 byter prints each input to the loop plus a line feed (Ṅ), and finally implicitly prints the decremented count of the collected results, removing the need for a monadic chain separation (µ) and concatenation (;).

As there is no set "output formatting" requested. Multiple outputs will count as long as the order is fine. This way, the 13 byte answer is valid.

Cool, I was not certain, thanks for letting me know!

Perl 6, 60 bytes
{$/=[$^x,*.polymod($^y xx*).sum*($y-1)...($y-1)²];$/-1,|$/}

Expanded:
{    # bare block lambda with placeholder parameters ｢$x｣ ｢$y｣

  $/ = [          # store in ｢$/｣ ( so that we don't have to declare it )

    # generate a sequence

    $^x,          # declare first parameter, and seed sequence generator

    # Whatever lambda

    *\            # the parameter to this lambda

    .polymod(     # broken down with a list of moduli

      $^y         # declare second parameter of the outer block lambda
      xx *        # an infinite list of copies of it

    )
    .sum
    *
    ( $y - 1 )

    # end of Whatever lambda

    ...           # repeat until it reaches

    ( $y - 1 )²
  ];

  # returns
  $/ - 1,         # count of values minus one
  |$/             # Slip ｢|｣ the list into the result
}

Usage:
# store it in the lexical namespace so that it is easier to understand
my &code = {$/=[$^x,*.polymod($^y xx*).sum*($y-1)...($y-1)²];$/-1,|$/}

say code  739,  7; # (2 739 42 36)
say code 1712, 19; # (3 1712 360 648 324)

C, 116 113 bytes
-3 bytes for recalculating square each time
s,t,i;f(x,y){s=y-(i=1);while(x-s*s){t=0;++i;printf("%d ",x);while(x)t+=x%y,x/=y;x=t*y-t;}printf("%d %d ",x,i-1);}

Ungolfed and usage:
s,t,i;
f(x,y){
 s=y-(i=1);
 while(x-s*s){
  t=0;
  ++i;
  printf("%d ",x);
  while(x)
   t+=x%y,    //add the base y digit
   x/=y;      //shift x to the right by base y
  x=t*y-t;
 }
 printf("%d %d ",x,i-1);
}

main(){
 f(739,7);puts("");
 f(1712,19);puts("");
}

JavaScript (ES6), 97 91 84 82 bytes
f=(n,b,k=1,c=b-1)=>[n,(s=(B=n=>n%b*c+(n>b&&B(n/b|0)))(n))-c*c?f(s,b,k+1):[s,k]]+''

Test cases

f=(n,b,k=1,c=b-1)=>[n,(s=(B=n=>n%b*c+(n>b&&B(n/b|0)))(n))-c*c?f(s,b,k+1):[s,k]]+''

console.log(f(1712, 19))
console.log(f(739, 7))

Jelly, 16 bytes
I guess I'll post this anyway, even though it was beaten while I was writing it, because it's a notably different algorithm and it was interesting to write. (I couldn't figure out how ÐĿ parsed from the docs and had to give up on it, despite knowing it would probably lead to a shorter solution than this one.)
ṄbS×⁹’¤ß<’¥n⁸$?‘

Try it online!
Explanation:
ṄbS×⁹’¤ß<’¥n⁸$?‘
Ṅ                 Output {the first argument} and a newline
 b                Convert to base {the second argument}
  S               Sum digits
    ⁹’¤           {the second argument} minus 1, parsed as a group
   ×              Multiply
           n⁸$    {the current value} ≠ {the first argument}, parsed as a group
              ?   If that's true:
       ß          then run the whole program recursively
        <’¥       else run (lambda a,b: (a<b)-1)
               ‘  Increment the result

The use of <’¥ is basically a short way to write a dyad (link with two arguments) that always returns -1 (because we know the answer will never be smaller than the base). Choosing between running that recursively, and the whole program recursively, lets us determine when to stop looping. Then when the stack unwinds at the end of the recursion, we keep incrementing the -1 to determine how many steps there were.

MATL, 25 21 bytes
4 bytes saved thanks to @Luis
XJx`tJYA!UsJq*tJqU-}@

Try it Online!
Explanation
XJ      % Implicitly grab the first input and store in clipboard J
x       % Delete this from the stack
`       % Do...while loop
  t     % Duplicate last element on stack (implicitly grabs second input)
  JYA   % Convert this number to the specified base
  !Us   % Sum the digits
  Jq*   % Multiply by the largest number in this base
  t     % Duplicate this value
  JqU   % Compute (base - 1) ^ 2
  -     % Subtract the two. Evaluates to TRUE if they are not equal
}       % When they are finally equal
@       % Push the number of iterations
        % Implicitly display the stack contents

@LuisMendo Fixed!

Mathematica, 80 bytes
(s=FixedPointList[x(#2-1)(Plus@@x~IntegerDigits~#2),#];s[[-1]]=Length@s-2;s)&

 is the private use character U+F4A1 used to represent \[Function]. If the number of steps weren't required in the answer, this could be done in 60 bytes:
Most@FixedPointList[x(#2-1)(Plus@@x~IntegerDigits~#2),#]&

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Evaluate the Binomial Coefficient
Given two nonnegative integers n,k such that 0 <= k <= n, return the binomial coefficient
c(n,k) := (n!) / (k! * (n-k)!)

Test cases
Most languages will probably have a built in function.
c(n,0) = c(n,n) = 1 for all n
c(n,1) = c(n,n-1) = n for all n
c(5,3) = 10
c(13,5) = 1287

Related challenges
Catalan Numbers Compute the multinomial coefficient Generate Pascal's triangle m-nomial coefficient

Surely this is a dup http://codegolf.stackexchange.com/questions/1744/mathematical-combination/9150#9150 or am I missing something?

I was not aware of that, and I did a thorough search / had it in the sandbox for quite a long time. Too bad it doesn't contain the keyword binomial coefficient...

JavaScript (ES6), 27 bytes
f=(n,k)=>k?n*f(n-1,k-1)/k:1

MATL, 2 bytes
Xn

try it online!

Jelly, 1 byte
c

Try it online!

CJam, 11 bytes
l~S*\0e]e!,

Try it online!
Explanation
This uses a trick that (I think) I first used for the Catalan numbers challenge. CJam doesn't have a built-in for this, and computing three factorials is too expensive. But the binomial coefficient c(n,k) is the number of ways we can select k out of n elements. That is, it's equal to the number of permutations of a list of n elements where k of them have one value and the remaining have another.
l~   e# Read and evaluate input. Dumping n and k on the stack.
S*   e# Get a string of k spaces.
\0e] e# Pad to length n with zeros.
e!   e# Get the unique permutations.
,    e# Count the number of such permutations.

Matlab, 8 bytes
There is a builtin for this calculation:
nchoosek

Haskell, 37 35 bytes
n#0=1
0#k=1
n#k=(n-1)#(k-1)*n`div`k

Mathematica, 8 bytes
Binomial

Yup. Sample usage: Binomial[13,5] or 13~Binomial~5 to obtain 1287.

Haskell, 34 bytes
n#k|k<1||k>=n=1|m<-n-1=m#(k-1)+m#k

Usage example: 13#5 -> 1287.
A variant with the same size for the k<1||k>=ntest is n*k-k*k<1.

Very clever!

J, 1 byte
!

Usage:
   3!5
10
   5!13
1287

Also works in APL.

Jellyfish, 6 bytes
pCi
 i

Try it online!
C is the built-in for binomial coefficients, the is are replaced with one input each, p prints the result.

Python 2, 33 bytes
f=lambda n,k:k<1or n*f(n-1,k-1)/k

Note that this will return True if k = 0, which seems to be allowed by default.
Try it online!

Pyth, 3 bytes
.cF

A program that takes input in the form n,k and prints the result.
Test
How it works
This simply folds c(n,k) over the input.

Actually, 1 byte
Input is of the form k<newline>n. Try it online!
█

Perl 6, 23 bytes
{+combinations $^n,$^p}

{[*] ($^n...0)Z/1..$^p}

( Both are were based on code found at examples.perl6.org, and RosettaCode )

MATL, 10 bytes
:i:&G-:h/p

Try it online!
This does the computation manually, without the builtin:
:     % Take input n implicitly. Range
      % STACK: [1 2 ... n]
i:    % Take input k. Range
      % STACK: [1 2 ... n], [1 2 ... k]
&G-   % Push n and k again. Subtract
      % STACK: [1 2 ... n], [1 2 ... k], n-k
:     % Range
      % STACK: [1 2 ... n], [1 2 ... k], [1 2 ... n-k]
h     % Concatenate the top two arrays horizontally
      % STACK: [1 2 ... n], [1 2 ... k 1 2 ... n-k]
/     % Element-wise division
      % STACK: [1/1 2/2 ... k/k (k+1)/1 (k+2)2 ... n/(n-k)]
p     % Product of array. Implicitly display
      % STACK: 1/1 * 2/2 * ... * k/k * (k+1)/1 * (k+2)2 * ... * n/(n-k)


text:
Equal out bracket types
Based on  THIS question.
Given a string, replace each bracket ()[]{}<> with a bracket of the appropriate type so that the brackets match, and the nested brackets cycle as follows:

Outermost ones are ()
Directly inside of () should be []
Directly inside of [] should be {}
Directly inside of {} should be <>
Directly inside of <> will be () again (cycles)

All non-bracket chars must remain exactly as they are. Open brackets may only be replaced with open brackets of some type, and close brackets with close brackets.
The input will always make this possible. This means its brackets matched correctly if their type is ignored. So, {ab<)c] is a valid input, but ab)(cd or ab((cd are not.
Examples:
2#jd {¤>. = 2#jd (¤).
abcdef    = abcdef
(3×5+(4-1)) = (3×5+[4-1])
<<<>><<>><<<<<<>>>>>>> = ([{}][{}][{<([{}])>}])

The use of native transforming of input this way (auto syntax of language) is not allowed.
As always: shortest code wins.

I don't understand the challenge. What must the output be in terms of the input?

@xnor the output should be the same string like the input, except for the four kinds of brackets. They need to be replaced to match the pattern.

Ah, now I see. I didn't understand that the "should be" are things you're supposed to make be true. I'll edit to try to make it clearer.

I edited the specs. Feel free to change things if I messed them up. I'm not sure what "native transforming of input" means, so I left it alone.

@xnor I wasn't sure how to put it, but there may be languages which will transform brackets just by the compiler in some way. And I don't want a use of something like that...

@DirkReichel I don't think that is something you need to worry about. I can't imagine that any language can do this specific transformation natively, and in the unlikely event that there is such a language all that means is that answers in that language won't be very interesting.

What characters can appear in the input? I see you've got some non-ASCII there.

@MartinEnder in theory: all printable unicode symbols.

@DirkReichel what's the point? Just stick with ASCII. Using different characters adds nothing to the challenge apart from unnecessary restrictions on ascii-only languages.

@Flp.Tkc there is no "need to run with unicode". If your language is ascii-only, only ascii inputs need to run. I assumed something like that as completely "off topic" for this task.

JavaScript (ES6), 79 bytes
s=>s.replace(/./g,c=>~(p=l.indexOf(c))?l[p&4?--k&3|4:k++&3]:c,l='([{<)]}>',k=0)

Test cases

let f =

s=>s.replace(/./g,c=>~(p=l.indexOf(c))?l[p&4?--k&3|4:k++&3]:c,l='([{<)]}>',k=0)

console.log(f("2#jd {¤>."));
console.log(f("abcdef"));
console.log(f("(3×5+(4-1))"));
console.log(f("<<<>><<>><<<<<<>>>>>>>"));

Haskell, 126 bytes
b="([{<"
d=")]}>"
y=cycle
(!)=elem
f(e:c)n(x:r)|x!b=y b!!n:f(y d!!n:e:c)(n+1)r|x!d=e:f c(n-1)r|1<3=x:f(e:c)n r
f c n s=s
f" "0

Try it on ideone. Usage:
*Main> f" "0 "<<<>><<>><<<<<<>>>>>>>"
"([{}][{}][{<([{}])>}])"

Explanation
f takes three arguments: A string that works as stack for closing brackets, an int n for counting the nesting-depth and the input string.
f c n "" = ""                            -- base case for recursion: input string is empty
f (e:c) n (x:r)                          -- for the current char x
   | elem x "([{<" =                     -- check if it is an opening bracket
       (cycle "([{<")!!n :               --   if so, replace it with a bracket of the current nesting depth
           f ((cycle ")]}>")!!n : e : c) --   push the matching closing bracket on the stack
               (n+1) r                   --   increase depth level and check the next char
   | elem x ")]}>" =                     -- if x is a closing bracket
       e :                               --   replace it by the closing bracket from on top of the stack
           f c (n-1) r                   --   decrement depth level and check the next char
   | otherwise     = x : f (e:c) n r     -- otherwise keep x and check the next char

Lex, 132 bytes
%{
int i,o[4]={40,91,123,60};
%}
%%
[[({<] {putchar(o[i++&3]);}
[])}>] {putchar(o[--i&3]+2-!(i&3));}
%%
yywrap(){}
main(){yylex();}

You can save 27 bytes (portable lex) or 30 bytes (using flex as the compiler) via deleting the last two or three lines respectively, at a cost of some number of bytes (probably 2, 3 or 4; the rules are somewhat unclear) in penalties for the -ll command line option when linking the resulting C file. (That is, instead of compiling with lex brackets.l; cc lex.yy.c, you compile with lex brackets.l; cc lex.yy.c -ll.) That's definitely a tradeoff worth making in this situation.

Java, 155 bytes
a->{String s="([{<)]}>";for(int i=0,j=0,k;i<a.length;i++){k=s.indexOf(a[i]);if(k>3){a[i]=s.charAt(--j%4+4);}else if(k>-1){a[i]=s.charAt(j++%4);}}return a;}

Lambda that takes a char[] as it's single argument. We loop through the array, storing it's position in our string of brackets (s) in a variable (k). We check if it's an opening or closing bracket (s.indexAt()), and replace it with the appropriate bracket based on it's level of nesting (s.charAt()), looping appropriately with %4


text:
Generate n-ary numbers
A secondary number is a positive integer whose prime factors (without multiplicity) are all less than or equal to its square root. 4 is a secondary number, because its only prime factor is 2, which equals its square root. However, 15 is not a secondary number, because it has 5 as a prime factor, which is larger than its square root (~ 3.9). Because all prime numbers have themselves as prime factors, no prime number is a secondary number. The first few secondary numbers are as follows:
1, 4, 8, 9, 12, 16, 18, 24, 25, 27, 30, 32, 36, 40, 45, 48, 49, 50, 54, 56

A tertiary number is defined similarly, except all the prime factors must be less than or equal to its cube root. The first few tertiary numbers are as follows:
1, 8, 16, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 125, 128, 135, 144, 150, 160, 162

In general, an n-ary number is one whose prime factors are all less than or equal to its n-th root. Thus, a positive integer \$x\$ is an n-ary number iff each of its prime factors \$p\$ satisfies \$p^n ≤ x\$. Thus, primary numbers are all positive integers (all prime factors less than or equal to themselves), quartenary numbers have all their prime factors less than or equal to their fourth root, and so on.
The Challenge
Given integers k and n as inputs, output the kth n-ary number. k may either be zero- or one-indexed (your choice), and n will always be positive.
Examples
These are the first 20 elements in each sequence up to 10-ary numbers:
Primary: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
Secondary: 1, 4, 8, 9, 12, 16, 18, 24, 25, 27, 30, 32, 36, 40, 45, 48, 49, 50, 54, 56
Tertiary: 1, 8, 16, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 125, 128, 135, 144, 150, 160, 162
Quarternary: 1, 16, 32, 64, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512
5-ary: 1, 32, 64, 128, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152
6-ary: 1, 64, 128, 256, 512, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592
7-ary: 1, 128, 256, 512, 1024, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561
8-ary: 1, 256, 512, 1024, 2048, 4096, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496
9-ary: 1, 512, 1024, 2048, 4096, 8192, 16384, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656
10-ary: 1, 1024, 2048, 4096, 8192, 16384, 32768, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416

Jelly, 12 bytes
Æf*³<‘Ạ
1Ç#Ṫ

Takes n and k (one-indexed) as command-line arguments.
Try it online!
How it works
1Ç#Ṫ     Main link. Left argument: n. Right argument: k

1        Set the return value to 1.
 Ç#      Execute the helper link above for r = 1, 2, 3, ... until k of them return
         a truthy value. Yield the list of all k matches.
   Ṫ     Tail; extract the last match.

Æf*³<‘Ạ  Helper link. Argument: r

Æf       Compute all prime factors of r.
  *³     Elevate them to the n-th power.
    <‘   Compare all powers with r + 1.
      Ạ  All; return 1 if all comparisons were true, 0 if one or more were not.

No byte saving here, but I'd still plump for ÆfṪ*³<‘ since we know that if any factor falsifies the Ạ the one on the right will.

JavaScript (ES7), 95 90 bytes
Reasonably fast but sadly limited by the maximum number of recursions.
f=(k,n,i=1)=>(F=(i,d)=>i-1?d>1?i%d?F(i,d-1):F(i/d,x):1:--k)(i,x=++i**(1/n)|0)?f(k,n,i):i-1

How it works
Rather than factoring an integer i and verifying that all its prime factors are less than or equal to x = floor(i1/n), we try to validate the latter assumption directly. That's the purpose of the inner function F():
F = (i, d) =>         // given an integer i and a divisor d:
  i - 1 ?             //   if the initial integer is not yet fully factored
    d > 1 ?           //     if d is still a valid candidate
      i % d ?         //       if d is not a divisor of i
        F(i, d - 1)   //         try again with d-1
      :               //       else
        F(i / d, x)   //         try to factor i/d
    :                 //     else
      1               //       failed: yield 1
  :                   //   else
    --k               //     success: decrement k

We check if any integer d in [2 ... i1/n] divides i. If not, the assumption is not valid and we return 1. If yes, we recursively repeat the process on i = i / d until it fails or the initial integer is fully factored (i == 1), in which case we decrement k. In turn, the outer function f() is called recursively until k == 0.
Note: Due to floating point rounding errors such as 125**(1/3) == 4.9999…, the actual computed value for x is floor((i+1)1/n).
Demo
(Here with a 97-byte ES6 version for a better compatibility.)

f=(k,n,i=1)=>(F=(i,d)=>i-1?d>1?i%d?F(i,d-1):F(i/d,x):1:--k)(i,x=Math.pow(++i,1/n)|0)?f(k,n,i):i-1

console.log(f(17, 3)); // 144
console.log(f(13, 4)); // 243
console.log(f(4, 10)); // 4096

Brachylog, 21 bytes
:[1]cyt
,1|,.$ph:?^<=

Try it online!
This answer is one-indexed.
Explanation
Input: [N:K]

:[1]cy              Retrieve the first K valid outputs of the predicate below with N as input
      t             Output is the last one

,1                  Output = 1
  |                 Or
   ,.$ph            Take the biggest prime factor of the Output
        :?^<=       Its Nth power is less than the Output

JavaScript (ES7), 93 79 bytes
f=(k,n,g=(i,j=2)=>i<2?--k?g(++m):m:j**n>m?g(++m):i%j?g(i,j+1):g(i/j,j))=>g(m=1)

I couldn't understand Arnauld's answer so I wrote my own and conveniently it came in at two bytes shorter. Edit: Saved 14 bytes with help from @ETHproductions. Ungolfed:
function ary(k, n) {
    for (var c = 1;; c++) {
        var m = c;
        for (var i = 2; m > 1 && i ** n <= c; i++)
            while (m % i == 0) m /= i;
        if (m == 1 && --k == 0) return c;
    }
}

Interestingly, mine was exactly 93 bytes as well before I noticed a bug and decided to evaluate ++i**(1/n) rather than i**(1/n) because of floating point rounding errors such as 125**(1/3) == 4.999.... (The way it's written, I think your code is not affected by this.)

@ETHproductions Actually, I remembered to include it in the byte count, I just forgot to include it in the answer...

@ETHproductions Seems to work, but I moved the assignment to m to shave off a further two bytes.

Haskell, 86 bytes
m#n=(0:1:filter(\k->last[n|n<-[2..k],all((>0).rem n)[2..n-1],k`rem`n<1]^n<=k)[2..])!!m

Explanation:
(%%%% denotes the code from the line above)
    [n|n<-[2..k],all((>0).rem n)[2..n-1],k`rem`n<1]  -- generates all prime factors of k
    last%%%%^n<=k                                    -- checks whether k is n-ary
    (0:1:filter(\k->%%%%)[2..])!!m                   -- generates all n-ary nubmers and picks the m-th
     m#n=%%%%                                        -- assignment to the function #

filter with a lambda rarely pays off, a list comprehension is usually shorter: m#n=(0:1:[k|k<-[2..],last[n|n<-[2..k],all((>0).rem n)[2..n-1],kremn<1]^n<=k])!!m.

Oh, you can also omit the 0:, because indexing can be 0-based.

... even better: m#n=[k|k<-[1..],last[n|n<-[1..k],all((>0).rem n)[2..n-1],kremn<1]^n<=k]!!m

Pyth, 13 bytes
e.f.AgL@ZQPZE

Try it online.
Works really just like the Jelly solution.
e.f.AgL@ZQPZE
                 Implicit: read n into Q.
            E    Read k.
 .f              Find the first k integers >= 1 for which
   .A            all
          P      prime factors of
           Z     the number
     gL          are at most
         Q       the n'th
       @         root of
        Z        the number.
e                Take the last one.

Perl 6, 88 bytes
->\k,\n{sub f(\n,\d){n-1??n%%d??f n/d,d!!f n,d+1!!d};(1,|grep {$_>=f($_,2)**n},2..*)[k]}

My accidental insight is that you don't need to look at every factor of n, just the largest one, which is what the internal function f computes.  Unfortunately, it blows the stack with larger inputs.
Robustness can be improved by adding a primality test, using the built-in is-prime method on Ints, at a cost of several more characters.

Husk, 10 bytes
!fS≤ȯ^⁰→pN

Try it online!
Explanation
Took me a while to figure out using → on the empty list returns 1 instead of -Inf for ▲ which leaves 1 in the list (otherwise that would cost 2 bytes to prepend it again):
!fS≤(^⁰→p)N  -- input n as ⁰ and k implicit, for example: 4 3
!f        N  -- filter the natural numbers by the following predicate (example on 16):
  S≤(    )   --   is the following less than the element (16) itself?
        p    --   ..prime factors (in increasing order): [2]
       →     --   ..last element/maximum: 2
     ^⁰      --   ..to the power of n: 16
             --   16 ≤ 16: yes
             -- [1,16,32,64,81..
!            -- get the k'th element: 32

R, 93 bytes
f=function(k,n){x='if'(k,f(k-1,n)+1,1);while(!all(numbers::primeFactors(x)<=x^(1/n)))x=x+1;x}

Zero-indexed.
It is a recursive function that just keeps going until it finds the next number in line. Uses to numbers package to find the prime factors.

MATL, 21 bytes
x~`@YflG^@>~A+t2G<}x@

This solution uses one-based indexing and the inputs are n and k, respectively.
Try it Online!
Explanation
x       % Implicitly grab the first input and delete it
~       % Implicitly grab the second input and make it FALSE (0) (this is the counter)
`       % Beginning of the do-while loop
  @Yf   % Compute the prime factors of the current loop index
  1G^   % Raise them to the power of the first input
  @>    % Determine if each value in the array is greater than the current index
  ~A    % Yield a 0 if any of them were and a 1 if they weren't
  +     % Add this to the counter (increments only for positive cases)
  t2G<  % Determine if we have reached a length specified by the second input
}       % After we exit the loop (finally), ...
x@      % Delete the counter and push the current loop index to the stack
        % Implicitly display the result

Nice using ~  to repurpose the second input :-)

Brachylog v2, 16 bytes
{∧.ḋ,1⌉;?^≤}ᶠ⁽t

Try it online!
Credit to Dennis's Jelly solution for getting me thinking in the right direction.
Explanation
Here's a slightly ungolfed version that's easier to parse:
↰₁ᶠ⁽t
∧.ḋ,1⌉;?^≤

Helper predicate (line 2): input is the exponent n, output is unconstrained:
∧           Break implicit unification
 .ḋ         Get the prime factors of the output
   ,1       Append 1 (necessary because 1 has no prime factors and you can't take
            the max of an empty list)
     ⌉      Max (largest prime factor, or 1 if the output is 1)
      ;?    Pair that factor with the input (n)
        ^   Take factor to the power of n
         ≤  Verify that the result is less than or equal to the output

Main predicate (line 1): input is a list containing the index k (1-based) and the exponent n; output is unconstrained:
  ᶠ⁽   Find the first k outputs of
↰₁     calling the helper predicate with n as input
    t  Get the last (i.e. kth) one

APL(NARS), 53 chars, 106 bytes
r←a f w;c
c←0⋄r←1
→3×⍳∼∧/(πr)≤a√r⋄→0×⍳w≤c+←1
r+←1⋄→2

test:
  1 f¨1..20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
  2 f¨1..20
1 4 8 9 12 16 18 24 25 27 30 32 36 40 45 48 49 50 54 56
  3 f¨1..20
1 8 16 27 32 36 48 54 64 72 81 96 108 125 128 135 144 150 160 162
  4 f¨1..20
1 16 32 64 81 96 108 128 144 162 192 216 243 256 288 324 384 432 486 512
  10 f¨1..20
1 1024 2048 4096 8192 16384 32768 59049 62208 65536 69984 73728 78732 82944 93312 98304 104976 110592 118098 124416

Python 2, 114 bytes
f=lambda K,n,i=1:K and f(K-all(j**n<=i for j in range(1,i+1)if i%j==0and all(j%k for k in range(2,j))),n,i+1)or~-i

Try it online!
1-indexed function.

Japt, 14 bytes
Takes n as the first input and k (1-indexed) as the second.
@_k e§Vq}aXÄ}g

Try it

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Swap out some periodic and non-periodic parts
In the decimal representation of every rational number p/q, you have a periodic tail, a non-periodic head, and a section before the decimal point in the following format:
(before decimal point).(non-periodic)(periodic)

Some examples include:
1/70 = 0.0142857... = (0).(0)(142857)
10/7 = 1.428571... = (1).()(428571)            ## no non-periodic part
1/13 = 0.076923... = (0).()(076923)
3/40 = 0.075 = (0).(075)()                    ## no periodic part
-2/15 = -0.13... = -(0).(1)(3)                ## negative
75/38 = 1.9736842105263157894... = (1).(9)(736842105263157894)
                                              ## periodic part longer than float can handle
25/168 = 0.148809523... = (0).(148)(809523)
120/99 = 40/33 = 1.212121... = (1).()(21)
2/1 = 2 = (2).()()                            ## no periodic, no non-periodic
0/1 = 0 = (0).()()
0/2 = 0 = (0).()()
299/792 = 0.37752... = (0).(377)(52)
95/-14 = -6.7857142... = -(6).(7)(857142)
-95/-14 = 6.7857142... = (6).(7)(857142)

The challenge is to swap the periodic and non-periodic parts, leaving the before decimal point alone, to create a new number. For example:
25/168 = 0.148809523... = (0).(148)(809523)
       => (0).(809523)(148) = 0.809523148148... = 870397/1080000

If a number has no periodic part like 0.25 turn that number into a new periodic number, and vice versa.
1/4 = 0.25 = (0).(25)() => (0).()(25) = 0.252525... = 25/99
4/9 = 0.444444... = (0).()(4) => (0).(4)() = 0.4 = 2/5
5/1 = 5 = (5).()() => (5).()() = 5 = 5/1

The challenge

Take a fraction x as input, as a string, two inputs, a rational number, or whatever method suits your language.
Swap the periodic and non-periodic parts of the decimal representation of x to create a new number, leaving the part before the decimal alone. The periodic part always starts as soon as possible so that the non-periodic part is as short as possible. Examples are below.
Return the swapped number as a new fraction. The input is not necessarily reduced though the output should be. Input format is allowed to differ from output format.
The numerator p of x will be an integer with absolute value of one million or less and the denominator q of x will be a non-zero integer with absolute value of one million or less.
The numerator r and denominator s of the result is not guaranteed to be less than one million. Given the length of the periodic parts of these numbers, it is recommended that you avoid directly converting to floats.
This is code golf. Shortest answer in bytes wins.

Examples
1/70 = (0).(0)(142857)     => (0).(142857)(0) = (0).(142857)() = 0.142857 = 142857/1000000
10/7 = (1).()(428571)      => (1).(428571)() = 1.428571 = 1428571/1000000
1/13 = (0).()(076923)      => (0).(076923)() = 0.076293 = 76923/1000000
3/40 = (0).(075)()         => (0).()(075) = 0.075075... = 75/999 = 25/333
-2/15 = -(0).(1)(3)        => -(0).(3)(1) = -0.311111... = -28/90 = -14/45
75/38 = (1).(9)(736842105263157894)
      => (1).(736842105263157894)(9) = (1).(736842105263157895)()  ## since 0.999... = 1
      = 1.736842105263157895 = 1736842105263157895/1000000000000000000
      = 347368421052631579/200000000000000000
25/168 = (0).(148)(809523) => (0).(809523)(148) = 0.809523148148... = 870397/1080000
120/99 = (1).()(21)        => (1).(21)() = 1.21 = 121/100
2/1 = (2).()()             => (2).()() = 2 = 2/1
0/1 = (0).()()             => (0).()() = 0 = 0/1
0/2 = (0).()()             => (0).()() = 0 = 0/1
299/792 = (0).(377)(52)    => (0).(52)(377) = 0.52377377... = 2093/3996
95/-14 = -(6).(7)(857142)  => -(6).(857142)(7) = -6.857142777... = -12342857/1800000
-95/-14 = (6).(7)(857142)  => (6).(857142)(7) = 6.857142777... = 12342857/1800000

There is a missing 0 at the end of test case 2 (10/7): 1428571/100000 should be 1428571/1000000.

As stated there won't be a unique answer for a given input. 1/7 could be represented as (0).()(142857)  or (0).(1)(428571), 1 could be represented as (1).()(), (0).()(9), (0).()(99), (0).(9)(9), etc.

@ngenisis That was implicit in the examples, but I have made it explicit. Thanks for the feedback :)

@R.Kap I have already stated in the challenge that it is best to avoid using floats here. There are ways to find the decimal digits of a number without converting to a float. I hope this answers your question :)

can both p and q be negative?

@edc65 Yes. I'll edit in a test case

Python 2, 292 bytes
def x(n,d):
 L=len;s=cmp(n*d,0);n*=s;b=p=`n/d`;a={};n%=d
 while not n in a:
  a[n]=p;q=n/d;n=n%d
  if q==0:n*=10;p+=' '
  p=p[:-1]+`q`
 p=p[L(a[n]):];a=a[n][L(b):]
 if n==0:p=''
 n=int(b+p+a);d=10**L(p+a)
 if a!='':n-=int(b+p);d-=10**L(p)
 import fractions as f;g=f.gcd(n,d);return(n/g*s,d/g)

Ungolfed version, works in both python 2&3. Also prints decimal representation.
def x(n,d):
# sign handling
 s=n*d>0-n*d<0
 n*=s
# b, a, p: BEFORE decimal, AFTER decimal, PERIODIC part
 b=p=str(n//d)
 a={}
 n%=d
# long division
 while not n in a:
  a[n]=p
  q=n//d
  n=n%d
  if q==0:
   n*=10
   p+=' '
  p=p[:-1]+str(q)
# a/p still contain b/ba as prefixes, remove them
 p=p[len(a[n]):]
 a=a[n][len(b):]
 if n==0: p=''
# print decimal representation
 print("(" + b + ").(" + a + ")(" + p + ")")
# reassemble fraction (with a and p exchanged)
 n=int(b+p+a)
 d=10**len(p+a)
 if a!='':
  n-=int(b+p)
  d-=10**len(p)
# reduce output
 from fractions import gcd
 g=gcd(n,d)
 return(n//g*s,d//g)

Try d=10**len(p+a)

Here's a TIO link for easy testing: Try it online!

Well done on your answer :D. Some further golfing tips: use more semicolons where possible, get rid of the space in the line if n==0: p='', use \`in every place you usestr, such as `n/d`instead ofstr(n/d), and rename lentoLwithL=len;` at the beginning of the function.

@Sherlock9 I didn't even know about the backticks. Thanks for all the advice.

Not a problem. Here's some more :D Two places for semicolons: n=int(b+p+a);d=10**L(p+a) and import fractions as f;g=f.gcd(n,d);return(n/g*s,d/g). Also, I get 295 bytes for your current edit. Is there an extra newline you're forgetting to leave out?

@RainerP. do you have resources or algorithms that you followed explaining how to find the periodicity and to reconstruct the fraction?

Jelly, 102 101 89 87 83 81 79 78 77 74 bytes
This took way to long to write, way too long to debug, and definitely needs a lot of golfing (eight seven six five four links, holy cow), but it is, to the best of my knowledge, correct. Many, many thanks to Dennis for his help here, especially with the first two links. Many thanks to Rainer P. as well, as I ended up borrowing a lot of the algorithm in their Python answer.
Golfing edits: -1 byte thanks to Xanderhall. Bug fix from not using the correct logical NOT builtin. -13 bytes from golfing the numerator links. +1 byte from fixing a bug for negative d with thanks to Dennis. Restructured the links so that the numerator generation is all in one link. -2 bytes from combining the second and third links. -4 bytes from moving some common elements of the third and fourth links to the second link and the main link. -2 bytes from removing some superfluous chain operators. -2 bytes from rearranging the numerator link. -1 byte from moving Ḣ€ to end of the second link. Fixed a bug in the main link. -1 byte from changing Ṫ ... ,Ḣ to Ḣ ... ṭ. -3 bytes from moving the numerator link into the main link.
Golfing suggestions welcome! Try it online!
2ị×⁵d⁴
ÇÐḶ,ÇÐĿḟ@\µḢḅÐfıṭµḢḊṭµḢ€€µF,ḢQ
ÇL€⁵*
×Ṡ©⁸×%µ³,⁴A:/;Ð€2ĿḌ×®,Ç_/€µ:g/

Explanation
First, I'll explain the main link, which calls the other links.
×Ṡ©⁸×%µ³,⁴A:/;Ð€2ĿḌ×®,Ç_/€µ:g/  Main link. Left argument: n (int), right argument: d (int)
                                Split into three chains.
×Ṡ©⁸×%  First chain
×       Multiply n by d.
 Ṡ©     Yield sign(n*d) and save it to the register.
   ⁸×   Multiply by n.
     %  Yield n*sgn(n*d) modulo d.

µ³,⁴A:/;Ð€2ĿḌ×®,Ç_/€  Second chain
                        What follows is the formula for the numerator.
                        (+) means combining the digits of two numbers into one number.
                        ( `integer (+) periodic (+) non-periodic` - `integer (+) periodic` )
µ                     Start a new monadic chain with n*sgn(n*d)%d.
 ³,⁴                  Pair the original two arguments as a nilad.
    A                 Get their absolute values.
     :/               Integer divide to get the integer part of abs(n)/abs(d).
          2Ŀ          Yield the results of the second link.
       ;Ð€            Append the integer part to each item in the right argument.
                        This appends to both lists from the second link.
            Ḍ         Convert each list from decimal to integer.
             ×®       Multiply by sign(n*d) retrieved from the register.
               ;Ç     Concatenate with the result of the third link (our new denominator).
                 _/€  Reduced subtract over each list.
                        Yields the proper numerator and denominator.

µ:g/  Third chain
µ     Start a new monadic chain with [numerator, denominator].
  g/  Yield gcd(numerator, denominator).
 :    Divide [numerator, denominator] by the gcd.
      Return this as our new fraction.

Then, the first link that gets the digits.
2ị×⁵d⁴  First link: Gets the decimal digits one at a time in the format:
          [digit, remainder to use in the next iteration]
2ị      Gets the second index (the remainder).
  ×⁵    Multiply by 10.
    d⁴  Divmod with d.

Now, the second link that gets the periodic and non-periodic parts of n/d, and a lot of other heavy lifting.
ÇÐḶ,ÇÐĿḟ@\µḢḅÐfıṭµḢḊṭµḢ€€µF,ḢQ  Second link: Loops the first link,
                                  separates the periodic digits and non-periodic digits,
                                  removes the extras to get only the decimal digits,
                                  and prepares for the third and fourth links.
                                Split into five chains.
ÇÐḶ,ÇÐĿḟ@\  First chain
ÇÐḶ         Loop and collect the intermediate results **in the loop**.
    ÇÐĿ     Loop and collect **all** of the intermediate results.
   ,        Pair into one list.
       ḟ@\  Filter the loop results out the list of all results,
              leaving only [[periodic part], [non-periodic part]].

µḢḅÐfıṭµḢḊṭ  Second and third chains
µ            Start a new monadic chain.
 Ḣ           Get the head [periodic part].
   Ðf        Filter out any [0, 0] lists from a non-periodic number,
  ḅ  ı        by converting to a complex number before filtering.
               Only removes 0+0j. This removes extra zeroes at the end.
      ṭ      Tack the result onto the left argument again.
       µ     Start a new monadic chain.
        Ḣ    Get the head [non-periodic and extra baggage].
         Ḋ   Dequeue the extra baggage.
          ṭ  Tack the result onto the left argument again.

µḢ€€µF,ḢQ  Fourth and fifth chains
µ          Start a new monadic chain with the processed periodic and non-periodic parts.
 Ḣ€€       Get the head of each list (the digits)
            in both the periodic and non-periodic parts.
    µ      Start a new monadic chain with these lists of digits.
     F     Left argument flattened.
       Ḣ   Head of the left argument.
      ,    Pair the flattened list and the head into one list.
        Q  Uniquify this list. (Only removes if non-periodic part is empty)
             Removes any duplicates resulting from a purely periodic n/d.

The third link, which yields our new denominator.
ÇL€⁵*  Third link: Generate the denominator.
         What follows is the formula for the denominator.
         ( 10**(num_digits) - ( 10**(num_periodic_digits) if len(non-periodic) else 0 ) )
Ç      Yield the results of the second link.
 L€    Get the length of each item in the list.
         The number of digits in total and the number of digits in the periodic part.
   ⁵*  10 to the power of each number of digits.


text:
Create a bad pixel
Your task is to write a program that makes your screen appear to have a bad pixel.
You should choose exactly one pixel on the screen, and exactly one channel between red, green and blue, and make its value either always 0 or always maximum (usually 255). The values of other channels should be the same as if your program didn't run.
You can choose the pixel and channel in whatever ways, such as hardcoding it or generate it randomly on each run. But it must always be visible on fairly modern hardwares.
If the color that originally should be displayed on that pixel has changed, your program should update in less than 0.5 seconds when the system is fast enough.
You cannot make assumptions about what is currently displayed on the screen (such as a taskbar using the default theme).
Your program doesn't need to work when a screensaver, login screen, effect from a window manager, etc, are active.
Shortest code wins.

Can we assume a specific OS?

@Loovjo Yes, you can.

Ow... the requirement to preserve the other channels probably doubles my already-ridiculous byte count.

Bash on Linux - 25 bytes of Latin-1
+3 from @wyldstallyns /
-2 from removing quotes /
-1 because I forgot how this works /
-9 from @Dennis
printf ÿ>/dev/fb0;exec $0

Assumes that /dev/fb0 exists (it does on my Arch Linux system, and I think it should on any other Linux system). Requires root access as well. This does not work for me when X is running. On my system, this just constantly sets the blue channel of the top-left pixel to full (ÿ is 255).

You need echo -n - otherwise this could golf to: yes ff>/dev/fb0

@wyldstallyns Yeah, I've fixed it accordingly. AFAIK, printing the newline would influence more than one pixel (not allowed by challenge description)

Use /*/fb0 and insist haters produce a non-contrived example of side effects.

How is ÿ 255? I don't think this works. 255 is not a valid unicode character, it's not ascii either, so it must rely on one of those ancient codepages that shouldn't ever be used, as they differ from machine to machine.

@orion Portability is not a concern in code golf. As long as it reproducably works on one machine, it's valid.

@wyldstallyns it can still be golfed to yes <character>|tr -d '\n'>/*/fb0, or just using /dev/zero.

printf ÿ>/dev/fb0;exec $0 saves a few bytes.

@orion The yes approach doesn't work. /dev/fb0 has to be reopened after writing one pixel channel.

Oh, right, otherwise it would just blank the entire buffer.

@wyldstallyns /home/fb0 isn't that contrived. It probably exists as a username somewhere.

@ais523 That would just send an extraneous "Is a directory" message to sterr.

@wyldstallyns no, it would output "bash: /*/fb0: ambiguous redirect" and not run the printf.

@ais523 Sorry, I was talking about a prior version that used yes

$0&printf ÿ>/dev/fb0. Saves a few bytes. I'm not sure how reliable it is though.

Visual C++, 102 100 99 98 bytes
#include<Windows.h>
int main(){for(HDC d=GetDC(0);;Sleep(99))SetPixel(d,9,9,GetPixel(d,9,9)|255);}

Runs on Windows, directly using the Win32 API with Visual C++ compiler targeting the console subsystem. Uses the "screen" device context to set the red channel of the pixel at (9,9) to 0xFF.
The sleep is necessary to allow other programs to draw in between the get/set - and 9ms was too short, leading to the pixel getting stuck1 on its initial colour.

1 Unfortunately, not quite the same type of stuck pixel this question is looking for...

HolyC, 13 bytes
GrPlot(,9,9);

Puts a black dot on the persistent layer directly.

What it looks like.

C#, 247 244 371 366 354 352 bytes
Runs on Windows. Gets a device context for the entire screen, and repeatedly maximises the red channel at (9,9).
namespace System.Runtime.InteropServices{using I=IntPtr;class P{[DllImport("User32")]static extern I GetDC(I h);[DllImport("Gdi32")]static extern int GetPixel(I h,int x,int y);[DllImport("Gdi32")]static extern int SetPixel(I h,int x,int y,int c);static void Main(){for(I d=GetDC((I)0);;Threading.Thread.Sleep(99))SetPixel(d,9,9,GetPixel(d,9,9)|255);}}}

I originally didn't want to import GetPixel/SetPixel, but there's no particularly easy way to read a single pixel off a Graphic. So right now this is effectively the same as my VC++ attempt. Maybe saving to bitmap will be shorter...

-5 bytes thanks to @TuukkaX

You can remove the whitespaces from the parameter list of SetPixel.

@TuukkaX Thanks! Missed those.

You can make it sleep for 9ms rather than 99ms

@Rob I tried that, as mentioned in the C++ answer. Unfortunately, 9ms didn't seem to be enough when I tested (Win7). Other programs did not have enough time to paint, so the pixel effectively got stuck on its initial colour.

Could also shorten it by running through about 0x1FFFFFFF iterations in a busy loop instead of the sleep, but this would have to be tuned for every machine to stay within the 0.5s limit.

SmileBASIC, 20 bytes
SPSET.,299,99,1,1,33

Updates constantly.
Sets sprite 0 to a 1x1 area at 299,99 on the sprite sheet (which is a red pixel).
33 is the display attribute, which is 1 (display on) + 32 (additive blending).

Java 7, 266 bytes
import java.awt.*;public class K extends java.applet.Applet{public static void main(String[]a){new K();}Label l=new Label(".");public K(){add(l);}public void paint(Graphics g){s(Color.red);s(Color.green);s(Color.blue);repaint();}void s(Color c){l.setForeground(c);}}

I ran this on windows 7. Opens a Java Applet which has a white background by default. Adds a label with a period and then changes the color of the label ad nauseum.

Not actually sure if this is valid since it only changes the pixel in the applet window. Won't change the pixel color if the applet loses focus... I'll delete this answer if it doesn't meet the challenge's criteria.

Tcl/Tk, 61
wm at . -tr #F0F0F0
wm o . 1
grid [canvas .c]
.c cr o 9 9 9 9

On the image there is a black pixel near the upper left corner of the Vivaldi icon:

If on an interactive shell, there are abbreviations of commands available:
Tcl/Tk, 57
wm at . -tr #F0F0F0
wm o . 1
gri [can .c]
.c cr o 9 9 9 9

There is a black pixel over the V white area of the Vivaldi icon:


text:
Cheating Cyclic Quine
Concept
Write a program that outputs code in its programming language. That code, when executed, must output the original program.
Rules

Since this is a cheating quine, you can read the original source code.
First output program must be in the same language as the original program.
You may not output a regular quine. The two programs must be different.
Standard loopholes apply.
This is code-golf so shortest answer wins, however it will not be selected.

I'm still not entirely sure what constitutes a semi-quine.

@ConorO'Brien It outputs a program that outputs the original program

I see. The wording is quite vague.

Why wont the shortest answer be selected? Is this a Catalog?

We already have another definition for semiquine. This is a cyclic quine. Related.

I'd call it square root of quine. (Because I like how quantum computing has the operator square root of not.)

Really, the only differences between this and the challenge I linked are that cheating quines are allowed and the chain needs to be of length 2. I'm not going to VTC this as a dupe (since my vote is a hammer), but I will put forward the proposal that this might be a dupe.

Just for the record, I'd call it a mutual quine (that challenge requires different languages though).

@Mego I'll give my two cents, This is not a dupe as this is Code-Golf, not Code-Challenge. The Quine Permutation Group challenge asks for a very different solution, as is obvious by Dennis's.

@ATaco The other challenge scored based on code length and chain length. With the exception of the few solutions that are infinitely extendable, most of the chain lengths were small, so the score was dominated by code length.

Since this is a cheating quine, can we choose to not follow the rules?

@Keeta No, cheating only means that you can read the source code

Bash + coreutils, 11 bytes
tr xy yx<$0

This prints
tr yx xy<$0

Try it online!
In turn, that prints
tr xy yx<$0

Not a cheat and in a common language.

I think the tr command is redirected to $0 which is its own source code. So it is "cheaty".

7, 2 bytes
7 uses a 3-bit character set, but takes input packed into bytes (and according to meta, languages with sub-byte character sets are counted using bytes for the file on disk). Here's an xxd dump of the program:
00000000: 4cf4                                     L.

When giving this file to the 7 interpreter, it will output the following program:
00000000: 4fa6 7f                                  O..

which will then in turn output the original program again.
So what's happening here? There's no source reading involved (actually, I don't think it's possible to read the source in 7), although arguably the program is cheating in another way; let me know what you think. Here's how the program works. (Note that each 7 command has two variants, some of which don't have names and can't appear in the original program. There are twelve commands total, in six pairs. I'm using bold for active commands, nonbold for passive commands, and in cases where the active command has no name, I'm giving it the same name as the corresponding passive command and relying on the bold to distinguish. In the case where both are named, e.g. 7 which is the active variant of 1, each command gets its own name and the bold is just syntax highlighting.)

231723       Original program, unpacked into octal
231          Push 237 onto the stack
    23       Push 23 onto the stack
             (implicit) append a copy of the top of stack to the program
      2      Duplicate top of stack (currently 23)
       3     Output top of stack, pop second stack element

At this point, the 7 interpreter sees that the top of stack contains commands (2 and 3) that aren't representable, so it escapes the top of the stack, producing 723 (which is). The first command output selects the output format; in this case, it's format 7, "format the output the same way as the program". So the commands get output packed into bytes. Then the program continues:

23172323
             (implicit) append a copy of the top of stack to the program
        2    Duplicate top of stack (currently 237)
         3   Output top of stack, pop second stack element
          7  Push an empty element onto the stack

At this point, there's nothing but empty stack elements on the stack, so the program exits. We output 23 earlier. If we escape 237 (and we have to, because it contains unrepresentable commands), we get 7231. That gets output directly, making the final output of the program 237231 (formatted the same way as the program, i.e. packed into bytes). That's 4fa67f. (It can be noted that the 1 was entirely pointless in terms of affecting the output; the only reason it's there is to make the two programs different.)
Running 237231 proceeds almost exactly the same way; the difference is that the useless 1 runs just after the first print (and the empty element gets implicitly deleted the second time the current end of the program is reached). Again, the 231 ends up outputting itself, the 23 ends up outputting itself preceded by a 7, and we get 231723, the original program.
The observant might note that the two programs, despite being the same length in the language's "native" octal, are different lengths on disk. That's because a 7 program can be padded with an arbitrary number of 1 bits, and the packed format discards the trailing padding. Here's how the encoding happens:
2  3  1  7  2  3
010011001111010011(1...)
4   c   f   4   padding

In other words, two bytes, 4C F4, are enough to represent the program, so that's all I used.

Snails, 0 bytes

The second program is
1
The first program counts the number of matches of the empty pattern on the empty input (which really has area 0, but the pattern is always run at least once as a hack to allow programs to decide what they want to print on empty input). The second program begins with a quantifier (like {1} in regex), which causes a parse error. Since the program does not parse successfully, STDOUT is the empty string.

I thought there was probably a language that did this (i.e. null program succeeds with a nonempty result, but that result does nothing as a program). I tried HOMESPRING but couldn't get the interpreter to work. Looks like you found another language where it works, though. (Do you have a link to an interpreter?)

@ais523 https://github.com/feresum/PMA or https://tio.run/nexus/snails.

Python 3, 297 279 251 243 225 218 208 180 126 111 bytes
Non-cheating:
A=''';print(("A="+("'"*3+A)*2).translate({65:66,66:65}))''';print(("A="+("'"*3+A)*2).translate({65:66,66:65}))

This prints:
B=''';print(("B="+("'"*3+B)*2).translate({65:66,66:65}))''';print(("B="+("'"*3+B)*2).translate({65:66,66:65}))

which, when executed, prints the original program.

Wow! Cool! I never would have thought of that.

RProgN, 4 Bytes.
The community seems to consider this sort of thing as a cheating quine, which thus satisfies the criteria.
1
2

With a trailing newline.
This prints
2
1

With a trailing newline, which prints the first code.
RProgN prints the stack popping, so from top to bottom.
Try it online!

There was a chat discussion a while back which implied that 1\n1\n in RProgN would be a non-cheating quine, because each of the 1s prints each other (and it'd only be considered cheating if each 1 printed itself). All this really implies is that cheating in quines can be hard to define sometimes. (However, this answer is correct either way, because the question doesn't actually require the quine to cheat, just allows it.)

Also, Although I was reluctant to say, in RProgN 1\n is technically a valid quine, as 1 isn't a constant, but a call to a function which pushes 1 to the stack.

There are multiple definitions of a proper quine in use. That's invalid by at least one, but possibly valid by some of the others.

@ais523 You've sparked my curiosity, You specified RProgN, yet I didn't think that my little language got that much (or any) attention. Was the chat about RProgN in particular, or a language with a similar syntax?

It was about 7, which also has a tendency to print segments of the program "backwards". I was extrapolating from the opinions given there.

Batch, 14 bytes
@echo @type %0

Which when run as cyclicquine.bat outputs
@type cyclicquine.bat

Which when run outputs the original batch file.

Jolf, 6 bytes
1q_a_q

When run, this outputs:
q_a_q1

Which in turn outputs 1q_a_q.
Try it here!
Explanation
1q_a_q
1       the digit one (ignored)
 q      the source code (ignored)
     q  the source code
    _   reversed
   a    and outputted
 _      and reversed (ignored)

q_a_q1
q       the source code (ignored)
     1  the digit one (ignored)
    q   the source code
   _    reversed
  a     and outputted
 _      and reversed (ignored)

JavaScript (ES6), 69 60 59 bytes
(_0=_=>console.log(`(_0=${_0})()`.replace(/0/g,n=>+!+n)))()

Outputs:
(_1=_=>console.log(`(_1=${_1})()`.replace(/1/g,n=>+!+n)))()

-1 byte (@ETHProductions): use 0 in regex instead of \d

Try n=>1-n instead of n=>+!+n.

@Conner O'Brien Unfortunately the 1 will end up replaced by the regex.

@ETHproductions Heh, I should've thought of that.

Bash + Sed, 15 bytes
Same idea as Dennis's Answer.
sed y/xz/zx/ $0

Bash, Cat, and Rev, 19 16 bytes
rev $0 # 0$  ver

-3 thanks to @izabera

Wouldn't this be Bash, Tac, and `Rev?

rev $0 # 0$<space><space>ver for some reason i can't put two spaces in a comment

Oh, nice @izabera

@ConorO'Brien No, tac rev-ed is cat.

@SeeOneRhino Oh.... I see

><>, 16 bytes
"$r00gol?!;50.01

Try it here!
Outputs
"$r00gol?!;50.10

This is a modification of the one provided here. I'm not sure if it's cheating, it reads the codebox and outputs it.

you can change the 00g to :2- and it'll keep the same byte count without reading the codebox.

@Tealpelican, thanks! The goal is for it to be considered "cheating" though :p. (And I don't fully understand that rule)

C (gcc), 55 bytes
N,s[];main(){*s^=read(open(__FILE__,0),s,54);puts(s);}

Note the trailing newline.
First run:
x,s[];main(){*s^=read(open(__FILE__,0),s,54);puts(s);}

Try it online!
Second run:
N,s[];main(){*s^=read(open(__FILE__,0),s,54);puts(s);}

Try it online!
This one is rather simple. It reads the file, and XORs the first byte (technically first int, but it is effectively the same) with 54. Since it is an unused variable, it doesn't affect anything.
Note that this abuses the empty array cheat where GCC will let you write up to one page in an array with empty brackets. It also expects the page to be zero filled, which is the default.
A version which does not write out of bounds is this:
y,s[15];main(){*s^=read(open(__FILE__,0),s,56);puts(s);}

Try it online!
Which will turn into this
A,s[15];main(){*s^=read(open(__FILE__,0),s,56);puts(s);}

Try it online!
I xor against read() because it returns the number of bytes read, and it is shorter than XORing against a constant.

Self-modifying Brainfuck, 22 20 bytes
Note that SMBF stores the program itself to the left of the initial pointer.
~<[<]>[-<->]<.>>[.>]

Try it online!
It will output this (replace \x82 with a 0x82 byte)
\x82<[<]>[-<->]<.>>[.>]

Which in turn will print this:
~<[<]>[-<->]<.>>[.>]

Explanation:
~      Dummy byte to be negated to 0x82 (or on second, 0x7e or ~)
<[<]   Scan backwards to the start of the program
>      Go forwards to the first byte
[-<->] Negate cell 0 into cell minus 1
<.     Print the negated byte
>>     Skip to the second byte of the program
[.>]   Print the rest of the program

Because I can't directly do it with TIO because it treats inputs as UTF-8, here is a Bash script version which prints outputs with xxd:
Try it online!
Self-modifying Brainfuck (infinite loop, theoretical), 15 bytes
This version is shorter, but instead of exiting normally, it hangs in an infinite loop. Note that you won't see this in the console as the console is line buffered.
<[.<]-[][+]<.[<

Try it online!
This will print this:
<[.<]+[][-]<.[<

which, when run, will print this
<[.<]-[][+]<.[<

Try it online!
Note that in both cases, the code will get stuck in an infinite loop after printing, so you have to manually stop TIO or wait for the timeout
Explanation:
<[.<]    Print the program backwards
-[]      Enter an infinite loop to avoid executing the backwards code
[+]<.[<  The same code backwards (minus the last bracket) which uses a minus
         instead of a plus before the infinite loop.

My previous 11 byte infinite loop solution:
<[.<]]<.[<+

Try it online!
I thought this was an infinite loop which just sat there spinning, but the instruction pointer will eventually underflow and the program will very slowly print endless 0x00 as it tries to traverse a 4 GB loop.

Vyxal, 10 bytes
`:qpq`:qpq

Try it Online!
This outputs
`\`:qpq\`:qpq`

Which outputs the original code.
The first is a quine that unevaluates itself, and the second is a string.


text:
Make a ASCII Hexagon Ring Tiling
Using ASCII print a section of a hexagon ring tiling.
Here's a small section:
       /\__/\
      /_/  \_\
 /\__/\ \__/ /\__/\
/_/  \_\/__\/_/  \_\
\ \__/ /\__/\ \__/ /
 \/__\/_/  \_\/__\/
 /\__/\ \__/ /\__/\
/_/  \_\/__\/_/  \_\
\ \__/ /\__/\ \__/ /
 \/__\/_/  \_\/__\/
      \ \__/ /
       \/__\/

Here's a larger section:
\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\
 \/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\
 /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /
/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/
\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\
 \/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\
 /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /
/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/
\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\
 \/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\
 /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /
/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/

Challenge
Given 2 integers h and w, where h is the height and w is the width, output a hxw section of a hexagon ring tiling.
Examples
Input 1
4x4
Output 1
 /\__/\ \__/ /\__/\ \__/ /
/_/  \_\/__\/_/  \_\/__\/
\ \__/ /\__/\ \__/ /\__/\
 \/__\/_/  \_\/__\/_/  \_\
 /\__/\ \__/ /\__/\ \__/ /
/_/  \_\/__\/_/  \_\/__\/
\ \__/ /\__/\ \__/ /\__/\
 \/__\/_/  \_\/__\/_/  \_\
 /\__/\ \__/ /\__/\ \__/ /
/_/  \_\/__\/_/  \_\/__\/
\ \__/ /\__/\ \__/ /\__/\
 \/__\/_/  \_\/__\/_/  \_\
 /\__/\ \__/ /\__/\ \__/ /
/_/  \_\/__\/_/  \_\/__\/
\ \__/ /\__/\ \__/ /\__/\
 \/__\/_/  \_\/__\/_/  \_\

Input 2
3x3
Output 2
 /\__/\ \__/ /\__/\
/_/  \_\/__\/_/  \_\
\ \__/ /\__/\ \__/ /
 \/__\/_/  \_\/__\/
 /\__/\ \__/ /\__/\
/_/  \_\/__\/_/  \_\
\ \__/ /\__/\ \__/ /
 \/__\/_/  \_\/__\/
 /\__/\ \__/ /\__/\
/_/  \_\/__\/_/  \_\
\ \__/ /\__/\ \__/ /
 \/__\/_/  \_\/__\/

Input 3
1x3
Output 3
 /\__/\ \__/ /\__/\
/_/  \_\/__\/_/  \_\
\ \__/ /\__/\ \__/ /
 \/__\/_/  \_\/__\/

Input 4
3x6

Output 4
 /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /
/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/
\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\
 \/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\
 /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /
/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/
\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\
 \/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\
 /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /
/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/
\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\
 \/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\

Clarifications

My question is similar to this one: Me Want Honeycomb.
The input will be on a single line in the form hxw.
Output to stdout (or something similar).
This is code-golf so shortest answer in bytes wins.

You should clarify exactly how large of a section we must output, to remain clear and objective

I just saw your comment I'll fix the dimensions to make it more clear

Since I don't think the moderators saw my comment, if the question stays on hold for the next 2 hours, ill make an updated question with the edits I did and a 4th example for clarity. Sorry for the confusion and if the edits I made aren't close to what you wanted please post comment telling me what's needed.

Should this be tagged kolmogorov-complexity?

ill add it in 1 sec...

Befunge, 137 bytes
I seem to have created some kind of scifi hand gun.
&>4*>~>$&>\>1-:4%3v
>00gg,\1-:v^_@#:\<>+00p\::6*\00g2/+2%+1+66+:
^%+66<:+1\_$$55+,^
_\/__\/_/  \
\ \__/ /\__/\
/_/  \_\/__\/
 /\__/\ \__/

Try it online!
Explanation
&>4*>                    Read the height and multiply by 4.
     ~>$                 Drop the 'x' separator.
        &>\              Read the width and swap below the height

>                        Start of the outer loop.
 1-                      Decrement the height.
   :4%3+00p              Calculate the pattern y offset: height%4+3
           \             Swap the width back to the top.

::6*\00g2/+2%+1+         Calculate the line length: w*6+(w+y/2)%2+1
                66+:     Initialise the pattern x offset to 12, and duplicate it.

>                        Start of the inner loop.
 00gg                    Get a pattern char using the x on the stack and the saved y.
     ,                   Output the char.
      \1-                Swap the line length to the top of the stack and decrement it.
         :v              Check if it's zero, and if so...
          _                 ...break out of the loop to the right.
       +1\               Otherwise swap the x offset back to the top and increment it.
 %+66<:                  Mod it with 12 to make sure it's in range.
^                        Then return to the beginning of the inner loop.

$$                       Drop the x offset and line length.
  55+,                   Output a newline.
     \<                  Swap the height back to the top of the stack.
 _@#:                    Check if it's zero, and exit if that's the case.
^                        Otherwise return to the start of the outer loop.

Lua, 174 176 156 bytes
The code would print height-amount of lines, not height-amount of hexagons. Added *4, that fixed it, but added 2 extra bytes.
Saved some bytes by changing the counter from if to modulo, and by putting two io.read()s into one.
Uses io.read() as input.
a,w,h,n,d={[[ /\__/\ \__/]],[[/_/  \_\/__\\]],[[\ \__/ /\__/]],[[_\/__\/_/  \\]]},io.read(,),"",0 for i=h*4,0,-1 do d=d+1 d=5%d end n=a[d]print(n:rep(w))end

Replicates the strings width-amount of times via string:rep(width), then iterates height-amount of times with a for-loop. Needed [[]] (literal strings) because the backslashes really screwed stuff up.
Old Version:
a,w,h,n,d={[[ /\__/\ \__/]],[[/_/  \_\/__\\]],[[\ \__/ /\__/]],[[_\/__\/_/  \\]]},io.read(),io.read(),"",0 for i=h*4,0,-1 do d=d+1 d=5%d end n=a[d]print(n:rep(w))end

Python 2, 180 bytes
a,b,c,d=' /\__/\ \__/','/_/  \_\/__\\','\ \__/ /\__/','_\/__\/_/  \\'
h,w=input()
x=w/2
e,E=[(2,1),(7,8)][w%2]
print'\n'.join([a*x+a[:e],b*x+b[:E],c*x+c[:E],' '+(d*x+d[:e])[1:]]*h)

Takes input as two integers
Input: 2,7
Output:
 /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\
/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\
\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /
 \/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/
 /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\
/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\
\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /
 \/__\/_/  \_\/__\/_/  \_\/__\/_/  \_\/__\/

Batch, 266 bytes
@echo off
for /l %%i in (1,1,%1)do call:l %2 " \" /__\/ "_/  \_\" " \__/ /" \__/\
exit/b
:l
call:c %1 " /" %6 %5
call:c %1 / %4 %3
call:c %1 \ %5 %6
:c
set s=%~2
for /l %%j in (2,2,%1)do call set s=%%s%%%~3%~4
set/ao=%1^&1
if %o%==1 set s=%s%%~3
echo %s%

The :c subroutine does all the legwork of concatenating the pieces together for a single line; it is called by :l 4 times (one by fall though by arranging for :l's arguments to be a superset of :c's) to generate the 4 lines for each row of rings. There was also the possibility of falling through for the last row of rings instead but it turned out to be 5 bytes longer.