text:
Falcon Heavy stages
Choose a set of four bytes without replacement (i.e. no byte repeated), and not necessarily in any particular order, from any one of the following four sets:

The characters of any one single-byte encoding
The Unicode characters in the range 00–FF
The signed decimal integers in the range −128–127
The unsigned decimal integers in the range 0–255

The four values you chose (please state which they are) will be the valid inputs. You must pair each value with one of the below ASCII artworks.
Given (by any means) one of your four valid inputs, respond (by any means, even list of strings) with the corresponding ASCII art. Extra white-space is allowed on all sides, as long as the image is in there in one contiguous 2D area.
First byte:
     /\
    /  \
   |    |
   |    |
   |    |
   |____|
    \__/
    |  |
    |  |
    |  |
    |  |
 /\ |  | /\
/  \|  |/  \
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
|  ||  ||  |
AAAAAAAAAAAA

Second byte:
  /\
 /  \
|    |
|    |
|    |
|____|
 \__/
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 |  |
 AAAA

Third byte:
  /\
 /  \
|    |
|    |
|    |
|____|
 \__/
 |  |
 |  |
 |  |
 |__|
  /\

Fourth byte:
 db
_/\_
\__/
|  |
|  |
|  |
|__|
 /\

What's new about this ASCII art Kolmogorov complexity challenge?

The ability to select valid inputs presents a new aspect to the challenge. The inputs are clearly too limited to encode the entire result, but can carry enough information to merit attention.
The multiple possible outputs share a lot of structure, so reuse of code or sub-images is feasible both within each image and between images.
There is enough duplication that even languages which are not well-geared towards challenges like this have a fair chance of being able to use clever code rather than just hard-coding strings extensively.

db sounds like an Aston Martin! AFAIK it's a Tesla Roadster.

@LevelRiverSt Bowie, not Brown!

Is leading / trailing whitespace allowed, particularly on the left?

@LevelRiverSt Thanks. I forgot to write it, though I did think of it.

Is this really [tag:animation]?

JavaScript (ES6), 247 bytes
RegPack'ed. Expects 0...3 as input.
n=>[...'BigFu!#?%$Rocket'].reduce((s,c)=>(x=s.split(c)).join(x.pop()),`oF#$!
FRFRFRF|??|$i$t$t$t$t%# t #
!t!BBB
uuceeeeeee%c%|?|
o#, db
_#_
iggg
|?|%#g|o|e%t%t%tkgttgttcu,o#%!
RRR|??|%ieF R|oo|
$
oo%
 ?__#/\\!/o\\uAAAAFo g
ti\\?/Bkkk`).split`,`[n]

Try it online!

BigFu!#?%$Rocket? But this is just Falcon Heavy!

@Adám That's right. But BFR.reduce() == FalconHeavy :p

This is genius. For a second I was like wait what, theres a javascript builtin for that?! Then I came to my senses... +1!

Impressive as ever.

"FRFRFRF" = "Fu!#?%$RocketFu!#?%$RocketFu!#?%$RocketFu!#" right? I love this answer more than anything lol.

Charcoal, 67 bytes
ＮθＦ⁼³θ«ＰAA↑↑¹⁸↗²‖ＭＭ⁴±χ»¿θ«↙²↓⁴Ｍ↗__¶\_¶»↓d/_¶ _\↓×⁴∨›²θ⁶¿‹¹θAA↑¶/_‖Ｍ

Try it online! Link is to verbose version of code. Takes input as a number 3-0. Explanation:
Ｎθ

Input the number.
Ｆ⁼³θ«ＰAA↑↑¹⁸↗²‖ＭＭ⁴±χ»

If it is 3, draw half the booster, then mirror it, then move to the tip of the rocket.
¿θ«↙²↓⁴Ｍ↗__¶\_¶»

If it is not 0, draw the left half of the front fuel tank.
↓d/_¶ _\

But if it is 3, draw left half of the nose cone.
↓×⁴∨›²θ⁶

Draw the left side of the rocket.
¿‹¹θAA↑¶/_‖Ｍ

Draw the appropriate base of the rocket and then mirror to finish.

Did you create Charcoal just for this contest?

@nielsbot Charcoal is 7 months old (see commit log).

I was kidding. But I guess it raises the question: is it golfing if you create a language to solve the problem? Where's the boundary?

@nielsbot I think that counts as one of the standard loopholes.

Clean, 292 278 273 271 262 261 bytes
-5 bytes thanks to Adám
import StdEnv,Text
e=[k,k,k,"|__|",m]
l=repeatn
o="\\__/"
n="/  \\"
m="/\\"
u="|    |"
s="AAAA"
k="|  |"
?z=[m,n,u,u,u,"|____|",o:z]

\i=[cjustify 12[c\\c<-:q]\\q<-[?[k,k,k,k,m+" "+k+" "+m,n+k+n,k+k+k:l 18(k+k+k)]++[s+s+s],?(l 24k++[s]),?e,["db","_/\\_",o:e]]!!i]

Try it online!
A lambda function, mapping the Int values 0..3 to the images in the order listed in the OP.

287

@Adám Thanks! I was able to apply that, but I only saw it after I'd shortened it further - still saves bytes though :)

Uh, why are there two snippets?

@EriktheOutgolfer the second one is the lambda. The first one is the code it depends on. I don't put them in the same snippet because I can't multiline an assignment into the snippet.

Ruby, 234 212 205 bytes
->n{y=*"| "
h=%w{/ /\ }+["|  "]*3+%w{|__ \\_}+y*3
t=%w{|_ /}
[h+["| ","/\\ | ","/  \\| ",*["|  || "]*18,?A*6],h+y*21<<?A*2,h+t,%w{d _/ \\_}+y*3+t][n].map{|a|a.rjust(6," ")+a.reverse.tr("\\\\/d","/\\\\b")}}

Try it online!
Takes an integer 0-3. Builds an array of the left halves of each phase, indexes in, then pads and reflects each row. All padding is to the same width, so the latter phases have leading whitespace. Returns an array of strings.
-2 bytes: Declare y as an array right away instead of needing *[y] later.
-5 bytes: Replace x="\\" with t=%w{_| \\}.
-5 bytes: Less dereferencing, more array addition.
-1 bytes: h+y*21+[?A*2] -> h+y*21<<?A*2 in phase 1.
-3 bytes: The spec allows the omission of *$/ to join the result.
-4 bytes: ["b","\\_","_/"] -> %w{b \\_ _/} in phase 3.
-2 bytes: Use %w notation in the head array also.
-7 bytes: Use rjust instead of manual padding (this also means generating the left side and mirroring it, instead of starting with the right side)
Ungolfed:

->n{
  y=*"| "                                            # Same as y=[" |"]
  h=%w{/ /\ }+["|  "]*3+%w{|__ \\_}+y*3              # Head for phases 0-2
  t=%w{|_ /}                                         # Tail for phases 2,3
  [
    h+["| ","/\\ | ","/  \\| ",*["|  || "]*18,?A*6], # Phase 0
    h+y*21<<?A*2,                                    # Phase 1
    h+t,                                             # Phase 2
    %w{d _/ \\_}+y*3+t                               # Phase 3
  ][n].map{|a|                                       # Choose phase
    a.rjust(6," ") +                                 # Pad left to width 6
    a.reverse.tr("\\\\/d","/\\\\b")                  # Add mirror (right side)
  }
}

Python 2, 292 290 284 282 281 bytes
i,j,d,e,x,y=input()," "," /\\ ","/  \\","|  |","\__/"
f=i<1
l,m,n,p,q,s=3*f*j,j*(i<3),d*f,e*f,x*f,j*(i>0)
print"\n".join(([l+j+d,l+j+e]+[l+"|    |"]*3+[l+"|____|",l+j+y],[" db\n_/\_",y])[i>2]+([l+j+x]*4+[n+s+x+n,p+s+x+p]+[q+s+x+q]*18+[s+"A"*(4,12)[f]],[m+x]*3+[m+"|__|",m+d])[i>1])

Try it online!
Takes an integer 0 to 3 as input and uses list indexing (1 or 0) to build each output.
-2 for an unneeded pair of brackets.
-6 by removing a variable assignment that was only used once.
-2 for another single use variable.
-1 with a tip from @Rod

The n, p and q variables are unnecessary too (-2 bytes each). " db" and "_/\_" will be joined with "\n" later, you can turn both into " db\n_/\_" to save another byte. You can (probably) move the +y, from each element, out of the list (and remove the const too) something like (...)[i>2]+["\__/"]

@Rod Thanks for the \n tip. I missed that one. Not sure about n,p and q though. They are used twice each, one each side of the main rocket to define whether the boosters are needed or not. Simailarly y in one case needs newline before it and in the other case some other characters. Could probably benefit from a complete rewrite to be honest. Feel free to take any ideas from it and use them to post your own answer.

Red, 333 bytes
f: func[g][t:{    }b:{ /\ }c:{/  \}d:{   |}e:{|}j:{\__/}k:{|  |}a:{AAAA}h:[1[t b]1[t c]3[d t e]1[d{____}e]1[t j]]z:[3[t k]1[t{|__|}]1[t b]]r: func[w][foreach[i v]w[loop i[print rejoin v]]]switch g[1 do[r h r[4[t k]1[b k b]1[c k c]18[k k k]]r[1[a a a]]]2 do[r h r[24[t k]]r[1[t a]]]3 do[r h r z]4 do[r[1[t{ db}]1[t{_/\_}]1[t j]]r z]]]

Try it online!
Takes 1 - 4 as input
f: func [ g ] [
    t: {    }
    b: { /\ }
    c: {/  \}
    d: {   |}
    e: {|}
    j: {\__/}
    k: {|  |}
    a: {AAAA}
    h: [1 [t b] 1 [t c] 3 [d t e] 1 [d {____} e ] 1 [t j]]
    z: [3 [t k] 1 [t {|__|}] 1 [t b]]
    r: func [ w ] [
        foreach [ i v ] w [
            loop i [print rejoin v]]]
    switch g [
        1 do [r h r [4 [t k] 1 [b k b] 1 [c k c] 18 [k k k]] r [1 [a a a]]]
        2 do [r h r [24 [t k]] r [1 [t a]]]
        3 do [r h r z]
        4 do [r [ 1 [t { db}] 1 [t {_/\_}] 1 [t j] ] r z]
    ]
]

Rebol, 258 bytes
I made an experiment with Rebol's compress function, compressing a string of all the 4 stages and printing the corresponding part of it after decompression:
f: func[n][o:[[1 374][374 196][570 74][644 37]]
b: decompress debase{eJzjUgAB/RguMKWgAGbUgDg1OFnxQABmKcTEx+uDGTVQOZwM/RgwA2QTyBYQG2wbiAHDw5vjiAS4IEEOCwGoWmQKGsaQAIYE4eAhqeMFSCICGZKSxBWvHxPPBVYKDzkoAVamHwMAjkWmoKkCAAA=}
repeat i o/(n)/2[prin b/(i + o/(n)/1)]]

 f 3
  /\
 /  \
|    |
|    |
|    |
|____|
 \__/
 |  |
 |  |
 |  |
 |__|
  /\

SOGL V0.12, 90 bytes
┐∙2╚;+ƨA+.1>?jj■|_ /√+}R
3<?'».1>⌡9R"    kΓC+SA}‘03ž}.‽'⁴R╬³2±6«ž}.3=?4R╬³"XƧ⁸│\׀2⁴‘4n10žP}╬³

Try it Here!
Inputs 0/1/2/3 correspondingly to the bytes 1/2/3/4

Ruby,  209 183 bytes
->n{z=[a=' /\\ ',b='/  \\']+['|    |']*3+%w{|____| \__/}+[c='|  |']*24+[?A*n]
n>4&&z[10..-n/6]=n>8?[c,a+c+a,b+c+b]+[c*3]*18:['|__|',a]
n==5&&z[0,6]=%w{db _/\_}
z.map{|i|i.center(12)}}

Try it online!
Required inputs as follows:
Centre core + upper stage + fairing: 4
As above + boosters : 12
Upper stage + fairing: 6
Upper stage without fairing 5

The idea is to take the centre core + upper stage + fairing as a default and modify it for the other outputs.
Commented
->n{
  #z = array of parts for centre core + upper stage + fairing, with n A's at the bottom
  z=[a=' /\\ ',b='/  \\']+['|    |']*3+%w{|____| \__/}+[c='|  |']*24+[?A*n]

  #if n not 4, z from element 10 to the last [10..-1] or last but one [10..-2] =
  n>4&&z[10..-n/6]=
    n>8?[c,a+c+a,b+c+b]+[c*3]*18:   #centre core + boosters#
    ['|__|',a]                      #upper stage engine
  n==5&&z[0,6]=%w{db _/\_}        #if n==5, replace first 6 elements with unfaired payload
  z.map{|i|i.center(12)}          #pad each element of array to 12 characters
}                                 #return array of strings (format allowed by question)

The first answer to make non-trivial use of the input! Very nice.

Jstx, 124 bytes
↕t▌ÇÇÉÇ~éÇÇÇÇÇÇÇÉΘçK↑ε♀▄ü╙Çz⌡"#ße┐é+\òEhZ█╣S♪[ƒuø>!f♪K▌;0♂9☺}ås══½☻eP▌◙&£óZß:&╝af$V≈-wº[√D(♪╘Pφó√ò▲¶>å⌡◘├^∟z◘αßj◙÷»|æ⌠┼øk&£b

Explanation
↕t▌ÇÇÉÇ~éÇÇÇÇÇÇÇÉΘçK↑ε♀▄ü╙Çz⌡"#ße┐é+\òEhZ█╣S♪[ƒuø>!f♪K▌;0♂9☺}ås══½☻eP▌◙&£óZß:&╝af$V≈-wº[√D(♪╘Pφó√ò▲¶>å⌡◘├^∟z◘αßj◙÷»|æ⌠┼ # Push literal      /\\n    /  \\n   |    |\n   |    |\n   |    |\n   |____|\n    \__/\n    |  |\n    |  |\n    |  |\n    |  |\n /\ |  | /\\n/  \|  |/  \\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\n|  ||  ||  |\nAAAAAAAAAAAA0\n  /\\n /  \\n|    |\n|    |\n|    |\n|____|\n \__/\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n |  |\n AAAA0\n  /\\n /  \\n|    |\n|    |\n|    |\n|____|\n \__/\n |  |\n |  |\n |  |\n |__|\n  /\0\n db\n_/\_\n\__/\n|  |\n|  |\n|  |\n|__|\n /\
ø                                                                                # Push literal 0
k                                                                                # Push a list of strings obtained by splitting the second stack value with the first stack value.
&                                                                                # Swap the top two stack values.
£b                                                                                # Push the value in the list of the second stack value at the index of the first stack value.

Try it online!

C (clang), 421 408 bytes
r,d,i;f(t){char *s="    ",*e="\n",*l[]={" /\\ ","/  \\","|    |","|____|","\\__/","|  |","AAAA","|__|"," /\\ ","_/\\_","\n"," db","|  ||  ||  |"},*p[]={"VABU3C1DVE8FFF1G","VABU3C1DVE4F1RYAFAKBFBKZ9MM1YGGG","VABU3C1DVE3F1HI","VLJE3F1HI"},*a="",*b,*c=e,*q=p[t];for(r=1;d=*q++;r=(d/48&&57/d)?d-48:r,c=(d/89&&90/d)?e+90-d:c,a=(d/82&&86/d)?s+86-d:a)if(d/65&&77/d)for(b=l[d-65],i=0;i<r;i++)printf("%s%s%s",a,b,c);}

Try it online!

383 bytes


text:
Pascal's Triangle (Sort of)
Most everyone here is familiar with Pascal's Triangle. It's formed by successive rows, where each element is the sum of its two upper-left and upper-right neighbors. Here are the first 5 rows (borrowed from Generate Pascal's triangle):
    1
   1 1
  1 2 1
 1 3 3 1
1 4 6 4 1
  . . .

Collapse these rows to the left
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
. . .

Sort them in ascending order
1
1 1
1 1 2
1 1 3 3
1 1 4 4 6
. . .

Read this triangle by rows
[1, 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 4, 6 ...]

Given an input n, output the nth number in this series. This is OEIS 107430.
Rules

You can choose either 0- or 1-based indexing. Please state which in your submission.
The input and output can be assumed to fit in your language's native integer type.
The input and output can be given by any convenient method.
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Very nice title!

As per the OEIS link, the only change required to generate this sequence instead of a binomial coefficient is an integer division. That certainly falls under "trivial".

@PeterTaylor This doesn't look like an obvious dupe to me. There are many other possible approaches which can lead to interesting golfing opportunities, especially for languages that don't have a binomial built-in.

@PeterTaylor I'm not convinced this is a duplicate, either. So far, the MATL, JavaScript, and Pascal answers are rather different between the two challenges. However, since my vote is a hammer-open, I won't vote as yet.

Totally agree with @AdmBorkBork . So count me as reopen vote. That makes 3 now. How many votes are required for reopening?

JavaScript (ES6), 79 bytes
0-indexed.
f=(n,a=[L=1])=>a[n]||f(n-L,[...a.map((v,i)=>k=(x=v)+~~a[i-1-i%2]),L++&1?k:2*x])

Demo

f=(n,a=[L=1])=>a[n]||f(n-L,[...a.map((v,i)=>k=(x=v)+~~a[i-1-i%2]),L++&1?k:2*x])

console.log([...Array(79).keys()].map(n => f(n)).join(', '))

How?
f = (                       // f = recursive function taking:
  n,                        //   n = target index
  a = [L = 1]               //   a[] = current row, L = length of current row
) =>                        //
  a[n] ||                   // if a[n] exists, stop recursion and return it
  f(                        // otherwise, do a recursive call to f() with:
    n - L,                  //   n minus the length of the current row
    [                       //   an array consisting of:
      ...a.map((v, i) =>    //     replace each entry v at position i in a[] with:
        k =                 //       a new entry k defined as:
        (x = v) +           //       v +
        ~~a[i - 1 - i % 2]  //       either the last or penultimate entry
      ),                    //     end of map()
      L++ & 1 ?             //     increment L; if L was odd:
        k                   //       append the last updated entry
      :                     //     else:
        2 * x               //       append twice the last original entry
    ]                       //   end of array update
  )                         // end of recursive call

This algorithm directly generates the sorted rows of Pascal's Triangle. It updates n according to the length of the previous row until a[n] exists. For instance, 6 iterations are required for n = 19:
 L | n  | a[]
---+----+------------------------
 1 | 19 | [ 1 ]
 2 | 18 | [ 1, 1 ]
 3 | 16 | [ 1, 1, 2 ]
 4 | 13 | [ 1, 1, 3, 3 ]
 5 |  9 | [ 1, 1, 4, 4, 6 ]
 6 |  4 | [ 1, 1, 5, 5, 10, 10 ]
                        ^^

Nice work.  I'm not sure if I understand exactly how it works though.  My attempt turned out to be much longer than yours.

@kamoroso94 I've added an explanation.

I love this! Really enjoyed figuring out what it was doing.

Octave, 46 bytes
@(n)(M=sort(spdiags(flip(pascal(n)))))(~~M)(n)

1-based.
Try it online!
Explanation
Consider n=4 as an example.
pascal(n) gives a Pascal matrix:
 1     1     1     1
 1     2     3     4
 1     3     6    10
 1     4    10    20

The rows of the Pascal triangle are the antidiagonals of this matrix. So it is flipped vertically using flip(···)
 1     4    10    20
 1     3     6    10
 1     2     3     4
 1     1     1     1

which transforms antidiagonals into diagonals.
spdiags(···) extracts the (nonzero) diagonals, starting from lower left, and arranges them as zero-padded columns:
 1     1     1     1     0     0     0
 0     1     2     3     4     0     0
 0     0     1     3     6    10     0
 0     0     0     1     4    10    20

M=sort(···) sorts each column of this matrix, and assigns the result to variable M:
 0     0     0     1     0     0     0
 0     0     1     1     4     0     0
 0     1     1     3     4    10     0
 1     1     2     3     6    10    20

Logical indexing (···)(~~M) is now used to extract the nonzeros of this matrix in column-major order (down, then across). The result is a column vector:
 1
 1
 1
 1
···
10
10
20

Finally, the n-th entry of this vector is extracted using (···)(n), which in this case gives 1.

Python 2, 86 78 72 bytes
-8 bytes thanks to Rod
g=lambda n,r=[1]:r[n:]and r[n/2]or g(n-len(r),map(sum,zip([0]+r,r+[0])))

Try it online!
Ungolfed
def g(n, row=[1]):
  if n < len(row):
    return row[n/2]
  else:
    next_row = map(sum, zip([0] + row, row + [0]))
    return g(n - len(row), next_row)

Try it online!
The function recursively calculates the row of Pascal's Triangle. Given the current row as row, map(sum, zip([0] + row, row + [0])).
At each call n is reduced by the length of the current row. If the function arrives at the right row the nth lowest number of the row should be returned.
As the first half of a row is in ascending order and each row is symmetrical, the number is at index n/2 (0-indexed, integer division).

Wolfram Language (Mathematica), 55 bytes
The indexing is 1-based.
(##&@@@Sort/@Table[n~Binomial~k,{n,0,#},{k,0,n}])[[#]]&

Try it online!
Explanation
This is likely golfable, I am not a very experienced Mathematica user.
Table[n~Binomial~k,{n,0,#},{k,0,n}]

For each n ∈ [0, Input] ∩ ℤ, generate the table of binomials with each k ∈ [0, n] ∩ ℤ.
Sort/@

Sort each. Uses a shorthand to Map[function,object] – function/@object.
(##&@@@...)[[#]]

Flatten the resulting list and retrieve the element whose index in the list is the input.

R, 58 bytes
function(n)(m=apply(outer(0:n,0:n,choose),1,sort))[m>0][n]

Try it online!
Computes n choose k for each n,k in [0,1,...,n] as a matrix, sorts the rows ascending(*), and removes the zeros, then selects the nth element.
(*) This also transforms them into columns but that's better since R stores a matrix as a vector columnwise, which allows us to index directly into it while preserving order.

Haskell, 143 132 125 123 bytes
((p>>=s.h)!!)
p=[1]:map(\r->zipWith(+)(0:r)(r++[0]))p
h r=splitAt(div(length r)2)r
s(a,b)=reverse b!a
(h:t)!b=h:(b!t)
x!_=x

The first line is a point-free function that takes an index (0-based) and returns the appropriate number in the sequence. Try it online!
This is my first ever Haskell program! I'm sure it can get much shorter. Tips are appreciated.
Saved 2 bytes thanks to nimi
Ungolfed
pascalRows = [1] : map (\row -> zipWith (+) (0:row) (row++[0])) pascalRows
halves row = splitAt (div (length row) 2) row
joinSorted (first, second) = interleave (reverse second) first
interleave [] _ = []
interleave longer shorter = (head longer) : (interleave shorter (tail longer))
f n = (concatMap (joinSorted.halves) pascalRows) !! n

You still have i in function s, which was renamed to !, I guess. If you use an infix function you can drop the () around reverse b: s(a,b)=reverse b!a.

@nimi Ah, thanks--I changed it on TIO but missed a spot on the code here. And thanks for the parentheses tip.

APL (Dyalog), 26 25 bytes
1 byte saved thanks to @ngn
{⍵⊃0~⍨∊(⍋⊃¨⊂)¨↓⍉∘.!⍨⍳1+⍵}

Try it online!

{⍵[⍋⍵]} -> (⍋⊃¨⊂)

JavaScript, 57 bytes
f=(i,r=1)=>i<r?i>1?f(i-2,--r)+f(i<r?i:r-1,r):1:f(i-r,r+1)

0-indexed.
How does this come:
Step 0:
c=(i,r)=>i?r&&c(i-1,r-1)+c(i,r-1):1
f=(i,r=1)=>i<r?c(i>>1,r-1):f(i-r,r+1)

This code is easy to understand:

function c calculate the Combination use formula: C(n,k) = C(n-1,k) + C(n-1,k-1); or 1 if k == 0 or k == n
function f try to find out the row number and index in the row, and then call function c for getting the result.

Step 1:
c=(i,r)=>i>1?--r&&c(i-2,r)+c(i,r):1
f=(i,r=1)=>i<r?c(i,r):f(i-r,r+1)

In this step, we try to modify the call of function c to c(i,r) which makes it as same as parameter of f.
Step 2:
c=(i,r)=>i>1?--r&&c(i-2,r)+c(i<r?i:r-1,r):1
f=(i,r=1)=>i<r?c(i,r):f(i-r,r+1)

We test i<r for whether using function f or function c. That's why we musk keep i<r holds during recursion of function c.
Step 3:
f=(i,r=1)=>i<r?i>1?--r&&f(i-2,r)+f(i<r?i:r-1,r):1:f(i-r,r+1)

At this step, we merge these two function into one.
After some more golf, we finally got the answer described above.

f=(i,r=1)=>i<r?i>1?f(i-2,--r)+f(i<r?i:r-1,r):1:f(i-r,r+1)

for(i=0,x=1;x<10;x++) {
document.write('<p>')
for(j=0;j<x;j++,i++) document.write(`<b>${f(i)}</b>`)
}
p { text-align: center; }
b { display: inline-block; width: 4ch; font-weight: normal; }

APL (Dyalog Classic), 17 bytes
⎕⊃∊i!⍨,\⌊.5×i←⍳99

Try it online!
0-based indexing
note that (49!98) > 2*53, i.e. the binomial coefficient 98 over 49 is greater than 253, so at that point Dyalog has already started losing precision because of IEEE floating point

@Abigail see here and here

JavaScript (Node.js), 65 bytes
Not even an array is used. 0-indexed.
f=(n,i=0,g=x=>x?x*g(x-1):1)=>n>i?f(n-++i,i):g(i)/g(c=n>>1)/g(i-c)

Try it online!
Explanation:

f=(n,i=0,                 )=>                                     // Main Function
         g=x=>x?x*g(x-1):1                                        // Helper (Factorial)
                             n>i?                                 // Is n > i?
                                 f(n-++i,i):                      // If so, call function
                                                                  // f(n-i-1, i+1) to skip
                                                                  // . i+1 terms
                                            g(i)/g(c=n>>1)/g(i-c) // If not, since sorting
                                                                  // . the binomial coeffs
                                                                  // . equals to writing
                                                                  // . the first floor(i/2)
                                                                  // . coefficients twice
                                                                  // . each, so a shortcut

Jelly, 13 bytes
0rcþ`ZṢ€Ẏḟ0⁸ị

Try it online!
Using Uriel's Dyalog algorithm.
1-indexed.
Explanation:
0rcþ`ZṢ€Ẏḟ0⁸ị
0r            Return inclusive range from 0 to n
    `         Call this dyad with this argument on both sides
   þ           Outer product with this dyad
  c             Binomial coefficient
     Z        Zip
       €      Call this link on each element
      Ṣ        Sort
        Ẏ     Concatenate elements
         ḟ0   Remove 0s
           ⁸ị Take the nth element

Could you add an explanation? I can't figure out what þ is doing here.

@Shaggy It's outer product, I'll add an explanation.

Batch, 128 bytes
@set/as=2,t=r=m=i=1
:l
@if %1 geq %t% set/as+=r,t+=r+=1&goto l
@for /l %%i in (%s%,2,%1)do @set/ar-=1,m=m*r/i,i+=1
@echo %m%

0-indexed.

Can you add an explanation, please? I can't quite follow the logic here.

@AdmBorkBork The first three lines calculate the row r and column %1-(s-2) of the %1th of the series. The fourth line then uses that to calculate the binomial coefficient (n k) = n!/(n-k)!k! = n(n-1)...(n+1-k)/(1)(2)...k = (n/1)((n-1)/2)...((n+1-k)/k). Where's MathJax when I need it?

05AB1E, 10 bytes
0-indexed
ÝεDÝc{}˜sè

Try it online!
Explanation
Ý             # push range [0 ... input]
 ε    }       # apply to each element
  DÝc         # N choose [0 ... N]
     {        # sort
       ˜      # flatten result to a list
        sè    # get the element at index <input>

Jelly, 11 bytes
Ḷc€`Ṣ€Fḟ0ị@

Try it online!
A monadic link taking the index and returning an integer - uses 1-based indexing.
How?
Performs the challenge pretty much just as it is written, just with more of the right of Pascal's triangle (zeros) which is then thrown away...
Ḷc€`Ṣ€Fḟ0ị@ - Link: integer, i    e.g. 1   or    9
Ḷ           - lowered range            [0]       [0,1,2,3,4,5,6,7,8]
   `        - repeat left as right arg [0]       [0,1,2,3,4,5,6,7,8]
 c€         - binomial choice for €ach [[1]]     [[1,0,0,0,0,0,0,0,0],[1,1,0,0,0,0,0,0,0],[1,2,1,0,0,0,0,0,0],[1,3,3,1,0,0,0,0,0],[1,4,6,4,1,0,0,0,0],[1,5,10,10,5,1,0,0,0],[1,6,15,20,15,6,1,0,0],[1,7,21,35,35,21,7,1,0],[1,8,28,56,70,56,28,8,1]]
    Ṣ€      - sort €ach                [[1]]     [[0,0,0,0,0,0,0,0,1],[0,0,0,0,0,0,0,1,1],[0,0,0,0,0,0,1,1,2],[0,0,0,0,0,1,1,3,3],[0,0,0,0,1,1,4,4,6],[0,0,0,1,1,5,5,10,10],[0,0,1,1,6,6,15,15,20],[0,1,1,7,7,21,21,35,35],[1,1,8,8,28,28,56,56,70]]
      F     - flatten                  [1]       [0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,2,0,0,0,0,0,1,1,3,3,0,0,0,0,1,1,4,4,6,0,0,0,1,1,5,5,10,10,0,0,1,1,6,6,15,15,20,0,1,1,7,7,21,21,35,35,1,1,8,8,28,28,56,56,70]
       ḟ0   - filter discard zeros     [1]       [1,1,1,1,1,2,1,1,3,3,1,1,4,4,6,1,1,5,5,111,1,6,6,15,15,21,1,7,7,21,21,35,35,1,1,8,8,28,28,56,56,70]
         ị@ - index into (sw@p args)    1         3 --------------^

Red, 206 bytes
f: func[n][t: copy[[1]]l: 0
while[l < n][a: copy last t insert append a 0 0 b: copy[]repeat i k:(length? a)- 1[append b a/(i) + a/(i + 1)]append t reduce[b]l: l + k]foreach p t[sort p]pick split form t{ }n]

1-based
Try it online!
Explanation:
f: func [n] [
    t: copy [[1]]                       ; start with a list with one sublist [1]
    l: 0                                ; there are 1 items overall
    while [l < n] [                     ; while the number of items is less than the argument
        a: copy last t                  ; take the last sublist
        insert append a 0 0             ; prepend and append 0 to it
        b: copy []                      ; prepare a list for the sums
        repeat i k: (length? a) - 1 [   ; loop throught the elements of the list
            append b a/(i) + a/(i + 1)] ; and find the sum of the adjacent items
        append t reduce [b]             ; append the resulting list to the total list
        l: l + k                        ; update the number of the items
    ]
    foreach p t [sort p]                ; sort each sublist
    v: pick split form t { } n          ; flatten the list and take the n-th element
]

Perl, 48 bytes
Includes +1 for p
perl -pe '$_-=$%until$_<++$%;$./=$_/--$%for 1..$_/2;$_=$.' <<< 19

Uses base 0 indexing.

Pascal, 373 bytes
function t(n,k,r:integer):integer;begin if(n<k)then t:=r-1 else t:=t(n,k+r,r+1)end;
function s(n,k:integer):integer;begin if(k=0)then s:=n else s:=s(n+k,k-1)end;
function f(n,k:integer):integer;begin if((k<1)or(k>n))then f:=0 else if n=1 then f:=1 else f:=f(n-1,k-1)+f(n-1,k)end;
function g(n:integer):integer;var k:integer;begin k:=t(n,0,1);g:=f(k,(n-s(0,k-1)+2)div 2)end;

g is the function.
Try it online!

n=1 then can be n=1then.

SImilarly, it looks like if(k=0)then can become if k=0then.

if some number always greater than 0, you should use word instead of integer.

MATL, 11 bytes
:qt!XnSXzG)

1-based.
Try it online! Or verify all test cases.
Explanation
Consider input 4 as an example. ; is the row separator for matrices or column vectors.
:     % Implicit input: n. Push the row vector [1 2 ... n]
      S STACK: [1 2 3 4]
q     % Subtract 1, emlement-wise: gives [0 1 ... n-1]
      % STACK: [0 1 2 3]
t!    % Duplicate and transpose into a column vector
      % STACK: [0 1 2 3], [0; 1; 2; 3]
Xn    % Binomial coefficient, element-wise with broadcast. Gives an
      % n×n matrix where entry (i,j) is binomial(i,j), or 0 for i<j
      % STACK: [1 1 1 1;
                0 1 2 3;
                0 0 1 3;
                0 0 0 1]
S     % Sort each column
      % STACK: [0 0 0 1;
      %         0 0 1 1;
      %         0 1 1 3;
      %         1 1 2 3]
Xz    % Keep only nonzeros. Gives a column vector
      % STACK: [1; 1; 1; 1; 1; 2; 1; 1; 3; 3]
G)    % Get the n-th element. Implicitly display
      % STACK: 1

Java 8, 187 bytes
n->{int r=~-(int)Math.sqrt(8*n+1)/2+1,a[]=new int[r],k=r,x=0;for(;k-->0;a[k]=p(r,k))x+=k;java.util.Arrays.sort(a);return a[n-x];}int p(int r,int k){return--r<1|k<2|k>r?1:p(r,k-1)+p(r,k);}

Explanation:
Try it online.
n->{                   // Method with integer as both parameter and return-type
  int r=~-(int)Math.sqrt(8*n+1)/2+1,
                       //  Calculate the 1-indexed row based on the input
      a[]=new int[r],  //  Create an array with items equal to the current row
      k=r,             //  Index integer
      x=0;             //  Correction integer
  for(;k-->0;          //  Loop down to 0
    a[k]=p(r,k))       //   Fill the array with the Pascal's Triangle numbers of the row
    x+=k;              //   Create the correction integer
  java.util.Arrays.sort(a);
                       //  Sort the array
  return a[n-x];}      //  Return the `n-x`'th (0-indexed) item in this sorted array

// Separated recursive method to get the k'th value of the r'th row in the Pascal Triangle
int p(int r,int k){return--r<1|k<2|k>r?1:p(r,k-1)+p(r,k);}

J, 43 38 bytes
](([-2!]){/:~@(i.!<:)@])[:<.2&!@,:^:_1

Try it online!
0-indexed
Notes:

<.2&!@,:^:_1 gives the relevant row number of Pascal's triangle by rounding down the inverse of y choose 2.
/:~@(i.!<:)@] calculates the row and sorts it.
[-2!] gives the index into the row.

Hello. Welcome to the site! This is a nice first answer :)

Your current answer is actually 39 bytes, the f=: doesn't count per standard site rules.  Here's one for 26 bytes

Julia, 70 bytes
f(x)=map(n->binomial(n-1,ceil(Int,x/2-(n^2-n)/4-1)),round(Int,√(x*2)))

1-based
Explanation:
it first find the row number, then the column number, then compute the binomial

Welcome to PPCG!

yeah thx happy face

Vyxal, 9 bytes
ʀƛʀƈs;f$i

Try it Online!
No efficiency at all. 0-indexed.
ʀ         # 0...n
 ƛ   ;    # Mapped to...
  ʀ       # 0...n
   ƈ      # Binomial coefficient with n, vectorised
    s     # Sort these
      f   # Flatten
       $i # Index input into this.

Thunno 2, 8 bytes
ĖDȷc€ṠḞi

Try it online!
or see the interpreter complaining (explained below)
Explanation
ĖDȷc€ṠḞi  # Implicit input
Ė         # Push [0..input]
 Dȷc      # Outer product over ncr with itself
          # NOTE: the interpreter actually tries to calculate all the
          #       values: [0C0, 0C1, 0C2, ..., (input)C(input)], but
          #       fails for the ones where r > n. It silently carries
          #       on, ignoring those values, so we end up with input+1
          #       rows of Pascal's triangle :D. However, if you add
          #       the w (warnings) flag, you'll see all the errors
          #       which were caught by the interpreter (link above)
    €Ṡ    # Sort each row of the triangle
      Ḟ   # Flatten the list of lists
       i  # Index in using the input
          # Implicit output

Vyxal M, 7 bytes
ƛʀƈs;fi

Try it Online!
Explanation
ƛʀƈs;fi  # Implicit input
ƛ   ;    # Map over [0..input]
 ʀƈ      #  nCr with each of [0..that]
   s     #  Sort the resulting list
     f   # Flatten the list of lists
      i  # Index in using the input
         # Implicit output

Pyth, 15 bytes
@u+GSm.cHdhHhQY

0-indexed
Try it
Explanation
@u+GSm.cHdhHhQY
 u          hQY   Reduce on [0, ..., input], starting with the empty list...
  +G              ... append to the accumulator...
    Sm.cHdhH      ... the sorted binomial coefficients.
@              Q  Take the 0-indexed element.

Clean, 80 bytes
import StdEnv

\n=flatten[sort[prod[j+1..i]/prod[1..i-j]\\j<-[0..i]]\\i<-[0..]]!!n

Try it online!
As a lambda function.

C (gcc), 140 123 bytes

Saved 17 bytes thanks to ceilingcat.

F(n){n=n?n*F(~-n):1;}f(n,j,k,c){for(c=j=0;j<n;j++)for(k=0;k<=j/2;k++)if(++c==n||j&1|k-j/2&&++c==n)return F(j)/F(k)/F(j-k);}

Try it online!

Actually, 8 bytes
Largely based on Jonathan Allan's Jelly answer. Uses 0-indexing.
;r♂╣♂SΣE

Try it online!
Ungolfing
          Implicit input n.
;         Duplicate n.
 r        Lowered range. [0..n-1].
  ♂╣      Pascal's triangle row of every number.
    ♂S    Sort every row.
      Σ   Sum each row into one array.
       E  Get the n-th element of the array (0-indexed).
          Implicit return.

It's supposed to produce a single number; the nth in the series.  This produces an array.

Whoops. Fixed. Thanks @recursive

Jelly, 17 bytes
1+2\1,1j$$Ð¡Ṣ€Ẏ⁸ị

Try it online!

Coconut, 69 bytes
def g(n,r=[1])=r[n:]and r[n//2]or g(n-len(r),[*map((+),[0]+r,r+[0])])

Try it online!

Ruby, 56 bytes
->n{a=0;n-=a until n<a+=1;[*2..a].combination(n/2).size}

0-based
First get the row and column in the triangle, then calculate the binomial coefficient corresponding to that position.
Try it online!

Pari/GP, 47 bytes
n->concat([vecsort(Vec((1+x)^i))|i<-[0..n]])[n]

Try it online!

Pyth, 12 bytes
@smS.cMm,dkh

Try it online!

Julia 1.0, 45 bytes
!n=[(0:n.|>i->sort(binomial.(i,0:i)))...;][n]

Try it online!
1-indexed
computes the complete Pascal triangle up to line n, sorts all the lines, flattens everything and returns the n-th element. It's highly inefficient, and computing √(2n) lines would be enough but that would add so many bytes (8)

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:
How many pages have I torn out?
Last month I borrowed a plenty of books from the library. They all were good books, packed with emotions and plot-twists. Unfortunately, at some points I got very angry/sad/disappointed, so I tore some pages out.
Now the library wants to know how many pages I have torn out for each book.
Your goal is to write a program, which takes a sorted, comma-delimited list of numbers as input and prints the minimum and maximum possible page count I could have torn out. Each line represents a book, each number represents a missing page from the book.
Example input:
7,8,100,101,222,223
2,3,88,89,90,103,177
2,3,6,7,10,11
1
1,2

Example output:
4/5
5/6
3/6
1/1
1/2

4/5 means, that I may have torn out either 4 or 5 pages, depending on which side the book's page numbering starts. One could have torn out page 6/7, page 8/9, page 100/101, and page 222/223 (4 pages). Alternatively, one could have torn out page 7/8, page 99/100, page 101/102, page 221/222, and page 223/224 (5 pages).
Remember that a book page always has a front and a back side. Also the page numbering differs from book to book. Some books have even page numbers on the left page; some on the right page. All books are read from left to right.
Shortest code in bytes win. Strict I/O format is not required. Your programs must be able to take one or more books as input. Have fun.

Would it be acceptable if the output values are not guaranteed to be sorted? (such as 4/5 and 5/4)

Don't forget to update to the challenges to specify that output order must be consistent, either all min/max or all max/min. (Although, personally, I'd prefer that not to be part of the spec!)

What would be the reason to programs must be able to take one or more books as input rule? Most (if not all) will just wrap the code to verify a single book into a loop or something. IMHO it just add an overhead to the answer with little to no gains to the challenge. This questions already got lots of answers, so it's better to keep this as is, but keep this in mind for you future challenges.

Suggested test case (courtesy of @Arnauld): 1,3,5,7,9,11,13,15,17,18 - for the benefit of languages whose built-in sort method sorts lexicographically by default (assuming the requirement of consistently sorted output is added to the spec).

05AB1E, 13 bytes
εD>)ÅÈε€θγg}{

Try it online!
Thanks to Emigna for the heads-up on spec changes.
Explanation
εD>)ÅÈε€θγg}{ – Full program.
ε             – For each book...
 D            – Push two copies of it.
  >           – Increment all the elements of the second copy.
   )          – Wrap the whole stack into a list.
    ÅÈ        – Produces the lists of even natural numbers lower or equal to each element.
      ε       – For each (the modified copies of the book):
       €θ     – Get the last item of each.
         γg   – And split into chunks of equal adjacent elements.
           }  – Close the loop.
            { – Sort the resulting list.

Nice submission. I updated the challenge with 2 extra input/output lines. Also strict I/O is not required.

Btw, your program does not take multiple books as input.

@Emigna Thanks for the heads-up. Edited my answer accordingly.

@arminb It should be fixed now.

Python 2, 72 56 68 67 bytes
lambda b:[map(len,map(set,zip(*[[p/2,-p/2]for p in t])))for t in b]

Try it online!

Your program does not accept multiple line inputs (multiple books). I updated the challenge with 2 extra input/output lines. Also strict I/O is not required.

Wouldn't multiple inputs per run fall into strict I/O?

One could argue.

How you take the books and their pages as input is covered by the I/O spec. The requirement that you do take multiple books as input is part of the challenge spec.

JavaScript, 104 93 92 85 80 79 74 bytes
Would be 57 bytes if not for the unnecessary (in my opinion) requirement that each pair of numbers in the output be consistently sorted, or 47 bytes if we only needed to take one book as input.
Input and output are both an array of arrays.
a=>a.map(x=>[0,1].map(n=>new Set(x.map(y=>y+n>>1)).size).sort((x,y)=>x-y))

Initially inspired by Olivier's Java solution and my own (currently deleted) Japt solution.
2 bytes saved thanks to Arnauld (plus another 3 we both spotted at the same time) and 10 bytes added thanks to him spotting the broken sorting I'd hoped nobody would notice while that requirement was still under discussion!

Test cases
Test cases are split into individual books for better readability with the last case (which includes the [1,2] edge case) serving to illustrate that this solution supports multiple books in the input.

f=
a=>a.map(x=>[0,1].map(n=>new Set(x.map(y=>y+n>>1)).size).sort((x,y)=>x-y))
o.innerText=` Input                         | Output\n${`-`.repeat(31)}|${`-`.repeat(21)}\n`+[[[7,8,100,101,222,223]],[[2,3,88,89,90,103,177]],[[2,3,6,7,10,11]],[[1,3,5,7,9,11,13,15,17,18]],[[1],[1,2],[8,10]]].map(b=>` `+JSON.stringify(b).padEnd(30)+"| "+JSON.stringify(f(b))).join`\n`

History

//104
a=>a.map(x=>x.map(y=>b.add(y/2|0)&c.add(++y/2|0),b=new Set,c=new Set)&&[b.size,c.size].sort((x,y)=>x-y)))
// 93
a=>a.map(x=>[new Set(x.map(y=>y/2|0)).size,new Set(x.map(y=>++y/2|0)).size].sort((x,y)=>x-y)))
// 92
a=>a.map(x=>[(g=z=>new Set(z).size)(x.map(y=>y/2|0)),g(x.map(y=>++y/2|0))].sort((x,y)=>x-y))
// 85
a=>a.map(x=>[(g=h=>new Set(x.map(h)).size)(y=>y/2|0),g(y=>++y/2|0)].sort((x,y)=>x-y))
// 80
a=>a.map(x=>[(g=n=>new Set(x.map(y=>(y+n)/2|0)).size)(0),g(1)].sort((x,y)=>x-y))
// 79
a=>a.map(x=>[(g=n=>new Set(x.map(y=>y/2+n|0)).size)(0),g(.5)].sort((x,y)=>x-y))
// 76
a=>a.map(x=>[0,.5].map(n=>new Set(x.map(y=>y/2+n|0)).size).sort((x,y)=>x-y))

Nowhere is it written that the output has to be sorted from min to max. The question only says that the input will be sorted.

@OlivierGrégoire; while true that the consistent sorting of the output is not currently included in the spec, arminb has commented on a couple of solutions stating that it is indeed a requirement. I have already commented on the challenge asking for it to be included and stating my preference against it - after all, to me, that would fall under strict I/O.

I think this should work for 64 bytes. However, your current sort method without any callback is flawed. It would fail on e.g. [1,3,5,7,9,11,13,15,17,18].

Thanks, @Arnauld. Had just finished writing an update to map over [0,.5] instead of using g when I spotted your comment. Don't know why I have such a mental block with bitwise operators! I was hoping that the output sorting wouldn't become a requirement and that nobody would notice my broken sort() in the meantime ;) Need to get some work done so will be back in a while to update.

@Shaggy What is the original intent of y/2?  What is the reasoning of dividing the page number in half for this algorithm?

@MicFin, after dividing y by 2, the result is bitwise ORed with 0 which rounds floats down so, essentially, y/2|0 acts as a shortcut for Math.floor(y/2) but can, as Arnauld pointed out, be further shortened to y>>1. (e.g. Math.floor(8/2)===Math.floor(9/2)===(8/2|0)===(9/2|0)===(8>>1)==(9>>1)===4)

Wolfram Language (Mathematica), 37 bytes
Thanks @MartinEnder for 8 bytes!
Sort[Length@*Split/@{#,#+1}~Floor~2]&

Try it online!
Explanation
In: {3, 4, 5}
{#,#+1}

Take (input) and (input + 1). {{3, 4, 5}, {4, 5, 6}}
... ~Floor~2

For each number from above, take the largest even number less it. {{2, 4, 4}, {4, 4, 6}}
Length@*Split/@

For each list from above, split the list by same elements {{{2}, {4, 4}}, {{4, 4}, {6}}}
and take the length of each: {2, 2}
Sort[ ... ]

Sort the output.

You don't need SplitBy: Length@Split@⌊#/2⌋&/@{#,#+1}& works. But then it's even shorter to do the flooring before the map: Length@*Split/@⌊{#,#+1}/2⌋&. And if you like, you can get the same byte count without Unicode: Length@*Split/@{#,#+1}~Floor~2&

Uh, I think the challenge requires a strict I/O format.

Perl 5, 95 + 1 (-a) = 96 bytes
@0=@1=0;map{$i=-1;$F[$i]+1==$F[$i+1]&&$F[$i]%2==$_&&$i++while++$i<@F&&++@{$_}[0]}0,1;say"@0/@1"

Try it online!

There are some cases your program does not execute properly. I updated the challenge with 2 extra input/output lines. Also strict I/O is not required.

I don't see where any of your test cases are failing.  The only thing that isn't working is multiple cases, which you added long after I posted my solution.  In any case, I have updated the solution to handle multiple tests.

Retina 0.8.2, 60 bytes
\d+
$*
.+
$&,/$&,
,(?=.*/)
1,
((11)+,)1\1|1+,
1
%O`1+
1+
$.&

Try it online! Explanation:
\d+
$*

Convert the page numbers to unary.
.+
$&,/$&,

Duplicate the list, interposing a /.
,(?=.*/)
1,

Increment the page numbers in one copy of the list.
((11)+,)1\1|1+,
1

Count the number of pages, but consecutive even and odd numbers only counts as one page.
%O`1+

Sort the counts into order.
1+
$.&

Convert the counts back to decimal.

Nice submission! I updated the challenge with 2 extra input/output lines. Also strict I/O is not required. It seems your program is the only one by now which passes all the test cases.

Can't ,(?=.*/)¶1, be something like ,.*/¶1$& instead?

@Ven No, that would only increment one number, but I need to increment all of them.

Ok, and using overlapping takes it back to same byte count, so fair nuff

Haskell, 62 bytes
import Data.List
p t=sort[length$nub[div(p+o)2|p<-t]|o<-[0,1]]

Try it online!

I don't think this is technically valid, as the question requires a full program (Your goal is to write a program, which takes a sorted, comma-delimmited list of numbers as input )

@Ourous that' right. Also I updated the challenge with 2 extra input/output lines. Also strict I/O is not required.

Java (OpenJDK 9), 163 bytes
import java.util.*;
n->{for(int i=n.length;i-->0;){Set s=new HashSet(),t=new HashSet();for(int p:n[i]){s.add(p/2);t.add(++p/2);}n[i]=new int[]{s.size(),t.size()};}}

Try it online!
Explanations
n->{                                   // Input-output of int[][]
 for(int i=n.length;i-->0;){           // Iterate on books
  Set s=new HashSet(),t=new HashSet(); // Create two hashsets
  for (int p:n[i]) {                   // Iterate over each page
   s.add(p/2);                         // Add the sheet-of-page of books [ even | odd ] to one set.
   t.add(++p/2);                       // Add the sheet-of-page of books [ odd | even ] to the other set.
  }
  n[i]=new int[] {                     // change the input to the number of sheets used.
   s.size(),
   t.size()
  };
 }
}

Note: since there is no requirement about it, the min and max numbers of pages aren't ordered.

Can you chain size with add in Java to maybe save a few bytes? e.g., s.add(p/2).size.

@Shaggy No. I could chain stuff with streams, but that would add a few lot of bytes, not save ;-)

APL (Dyalog Unicode), 37 bytes
{(≢⍵)≤2:⌽≢∘∪¨⌊⍵(1+⍵)÷2⋄≢∘∪¨⌊⍵(1+⍵)÷2}

Try it online!
This can be done for less than half the byte count if the output order of pages doesn't matter:
{≢∘∪¨⌊⍵(1+⍵)÷2}

How?
{(≢⍵)≤2:⌽≢∘∪¨⌊⍵(1+⍵)÷2⋄≢∘∪¨⌊⍵(1+⍵)÷2}⍝ Prefix dfn
{(≢⍵)≤2:                               ⍝ If argument length ≤2
                    ÷2                 ⍝ Divide by 2
              ⍵(1+⍵)                   ⍝ Both the argument and 1+argument
             ⌊                         ⍝ Round down to the nearest integer
           ∪¨                          ⍝ Get the unique values of each
          ∘                            ⍝ And then
         ≢                             ⍝ Get the tally of elements of each
        ⌽                              ⍝ And reverse the result
                      ⋄                ⍝ Else
                       ≢∘∪¨⌊⍵(1+⍵)÷2} ⍝ Same as above, without reverting the result.

21 bytes

Clean, 222 210 204 196 bytes
import StdEnv,ArgEnv,Data.Maybe,qualified GenLib as G
Start=tl[let(Just l)='G'.parseString i;?s=sum[1\\n<-[s,s+2..last(sort l)]|isAnyMember[n,n+1]l]in zip2(sort[?0,?1])['/\n']\\i<-:getCommandLine]

Try it online!
Full-program requirements absolutely murder Clean's ability to compete.
For those who have been paying attention to my answers in Clean, you'll notice import qualified, which is an ugly hack to get around using modules that shouldn't be used together, together - which is only needed here because of another ugly hack to do with GenLib depending on Data.Maybe instead of StdMaybe, which is the result of yet another ugly hack in the libraries translated from Haskell's Data to get functionality before Clean's own libraries are equally complete.
Takes input via command-line arguments.

Nice submission. I updated the challenge with 2 extra input/output lines. Also strict I/O is not required.

@arminb Thanks! I'll be able to shorten it a lot tomorrow in that case.

@arminb I've updated it so it should be valid with the new cases. If the I/O I've used isn't acceptable, I'll revise it again in the morning.

Vyxal, 9 bytes
½₍⌈⌊vUvLs

Try it Online!
Append a \/j for strict I/O compliance (12 bytes)
½         # Halve each
 ₍⌈⌊      # Floor and ceiling of each, paired
    vUvL  # Count unique items in each
        s # Sort

Perl, 40 bytes
Inludes +1 for a
perl -aE 'say/$/*grep${$.}{$_*$`|1}^=1,@F for-1,1' <<< "7 8 100 101 222 223"

Output is not ordered.
Assumes positive page numbers (especially no page 0). Assumes missing pages are only mentioned once. Doesn't care if the input is ordered or not.
Processing only one book per run saves 3 bytes for 37:
perl -aE 'say/$/*grep$z{$_*$`|1}^=1,@F for-1,1' <<< "7 8 100 101 222 223"

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


text:
The NX source-length problem
On PPCG, we have had lots of challenges where the length of your output is dependent on the length of your source code. For the purposes of this challenge, we will call these Source-length problems. The two most well known examples of source-length problems are

Output with the same length as the code (the 1X source-length problem)
Create output twice the length of the code (the 2X source-length problem)

More simply, the NX source length problem is the challenge of creating a program whose output is exactly N times (X) the length of the source code. There have even been some variants on this type of challenge, for example

Output with the same number of digits of pi as the length of the code
triplegolf - not only the source code length counts!

These usually tend to be pretty interesting, although fairly simple to implement. However, we've never had a generalized source-length problem. Until today that is. Here is your challenge for today:

Given a positive integer N, output an answer to the NX source-length problem in the same language.

For example, let's say you wrote a submission in the language foo. If your program or function was given the input 3, you must output a new foo program or function s, that takes no input and whose output is exactly 3 times the length of s. Borrowing Martin's rules on the first challenge, here are some requirements for s:

Your code and your s may use any consistent encoding you like. However, s may only output bytes in the printable ASCII range (0x20 to 0x7E, inclusive), or newlines (0x0A or 0x0D).
s must not be a quine, so the code and the output must differ in at least one byte.
s must be at least one byte long.
If your output contains trailing newlines, those are part of the byte count.
The output doesn't always have to be the same, as long as you can show that every possible output satisfies the above requirements.
Usual quine rules don't apply. You may read the source code or its size, but I doubt this will be shorter than hardcoding it in most languages.

And adding a few rules of my own

Output from errors does not count towards output length.
If your solution fails for large N because of integer size restrictions, this is OK. Keep in mind, that this does not mean you can abuse native number types.

I highly recommend testing your code with inputs that are a different number of digits, since naive approaches that work for 1 digit Ns will fail for 2 digit Ns. Please also include an explanation of how you know your program is valid. Although this isn't mandatory, it is encouraged.
Since this task will be much easier in REPL languages, if you do answer in a REPL, please post your answer as
# Foo REPL, N bytes

so that it is distinguished from a regular answer in foo.
Of course, since this is a code-golf challenge, try to write the shortest possible answer in bytes as you can!
Leaderboard
Please format your answer like this so that it shows up in the leaderboard:
# <Language-name>, <n> bytes

    code
    code

/* Configuration */

var QUESTION_ID = 154961; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 31716; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    else console.log(body);
  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    lang = jQuery(''+lang+'').text();

    languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
  });

  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);

  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
body {
  text-align: left !important;
  display: block !important;
}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}

<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Just a note that the 2X challenge was effectively an NX challenge in most languages, because of the bonus. But then it also had the weird requirement that N still needed to default to 2.

Sorry if this duplicated vote it uncalled for, but it seems they are the same to me. If anyone thinks differently, I'd like to know the differences. It is of course possible I misread either of the challenges.

@KevinCruijssen, if you think there might be a possibility you misread either of the challenges then be careful swinging that dupe hammer around.

@Shaggy I'm fairly certain they are dupes of each other, but I will be completely honest: I recently got gold for code-golf which is why it got marked as duplicate right away, instead of being a 1/5 vote with a comment "Possible duplicate of".. Next time I'll post that comment manually. Although this challenge is much better specified, except for an example like the other had, they are identical: Create a program with input n that prints a program, which in turn prints anything with a string-length of n times the program length.

The only difference is this one specifies positive N, while the other is non-negative and has slightly less restrictive output

@KevinCruijssen Eh, I think the other one allows for different languages for your solution and the output programs, although I won't hammer this open yet.

M, 4 bytes
;“ x

For input n, this prints the program n x.
Try it online!
The program n x sets its argument and return value to n, then executes the x atom to repeat n n times, resulting in an array of n n's.
Try it online!
Proof of validity
Let d be the number of digits of n, so the program n x is d+2 bytes long.
Python 3 (and, therefore, M) prints an array of n n's like [n, ..., n].
Since all n copies of n are d bytes long, the first n-1 copies of n are followed by , (2 bytes), and [] surrounds the array (2 bytes), the output is nd + 2(n-1) + 2 = nd + 2n = n(d+2) bytes long.

Operation Flashpoint scripting language, 68 bytes
f={format["g={i=0;s={};while{i<%1}do{i=i+1;s=s+{    }+g};s}",_this]}

A function that takes a number n as input and outputs a function g that produces output with n times the length of its own source code.
Example:
3 call f

outputs
g={i=0;s={};while{i<3}do{i=i+1;s=s+{    }+g};s}

which outputs
    i=0;s={};while{i<3}do{i=i+1;s=s+{    }+g};s    i=0;s={};while{i<3}do{i=i+1;s=s+{    }+g};s    i=0;s={};while{i<3}do{i=i+1;s=s+{    }+g};s

Alternative version ( 75  71 bytes):
f={format[{g={i=0;s={};while{i<%1}do{i=i+1;s=s+"g={"+g+"}"};s}},_this]}

Outputs a function g which outputs its own source code n times.
Example:
3 call f

outputs
g={i=0;s={};while{i<3}do{i=i+1;s=s+"g={"+g+"}"};s}

which outputs (when called with hint call g)

How do you choose where to take your screenshots? Do you do a screenshot in a different place each time?

@cole I just take them where I happen to feel like taking them. Usually it's a different place each time. I used to take them always in the same place before Magic Octopus Urn suggested taking them in other places as well.

MATL, 20 19 18 bytes
`@G*qVn4+@-}3M'Z"'h

This ouputs a program of the form

abc
Z"

followed by a newline, where abc represents a positive integer. The function Z" gives a string of that many spaces, which is implicitly printed with a trailing newline.
Try it online!
Examples:

Input 142 produces the program
993
Z"

(plus newline). Try it online with footer code that changes space to ! for visibility.
The program length is 7 (including the newline), and its output has 994 characters (993 spaces and 1 newline), which equals 142*7.
Input 143 produces the program
1143
Z"

with a trailing newline. Try it online with the same modification.
The program length is 8 (including the trailing newline), and its output has 1144 characters (1143 spaces and 1 newline), which equals 143*8.

Explanation
The most difficult part is, given input N, computing the number abc. Let f denote the function "number of digits of". The code finds the first positive integer K that satisfies
f(K*N-1)+4 = K

The 1 above accounts for the trailing newline which is output by the produced program after the string of spaces, and the 4 accounts for the length of the Z" statement and the two newlines in the produced program. The number abc to be included in the output program is then K*N-1.
In the examples above:

For N=142 the obtained K is 7, which gives K*N-1 = 993.
For N=143 the obtained K is 8, which gives K*N-1 = 1143.

Commented code
`         % Do...while
  @       %   Push iteration index. This is a potential K
  G       %   Push input, N
  *       %   Multiply
  q       %   Subtract 1
  V       %   Convert to string (*)
  n       %   Number of characters
  4       %   Push 4
  +       %   Add
  @       %   Push K
  -       %   Subtract. This is the loop condition. If 0 (meaning the
          %   condition f(K*N-1)+3 = K is fulfilled) the loop is exited
}         % Finally (execute on loop exit)
  3M      %   Push string (*) from automatic clipboard
  'Z"'    %   Push string 'Z"'
  h       %   Concatenate horizontally
          % End (implicit). Display with trailing newline (implicit)

Befunge-98, 22 21 14 bytes
Edit: Didn't see that the output has to be printable ASCII only. Funnily enough, this saved a byte.
Edit: I was being stupid. What do you do if you to do something X times, N times? You do it X times N, times, duh.
Edit: Just realised this won't work with 10 or 13, because they print newlines, so I changed to the alternate version:
"&3*1-''5k,@.k

which can't print newlines.
Try it online! Try it N = 1, 2, 3 and 100
The NX program is in the form:
'N k.@

Where N is the char code of the inputted number. Prints N*3*("0 ")
Old version:
"&''fk,@.k7p01-1_@#!:

Try it online! Try N = 1, 2, and 3

Haskell, 55 bytes
f n="'a'<$[1.."++show(n*(10+length(show$n*10+10)))++"]"

Try it online!

Zsh, 28 22 bytes
repeat $1 echo rev \$0

For input n, this prints n copies of rev $0 and a linefeed.
Try it online!
The generated programs print n reversed copies of themselves.
Try it online!

Any reason why you chose rev over cat, apart from giggles?

The rules state that the code and the output must differ in at least one byte. cat would violate this rule when n = 1.

JavaScript (ES6), 51 bytes
n=>`_=>("${n}"[r="repeat"](2)+" "[r](41))[r](${n})`

Outputs (e.g.) _=>("42"[r="repeat"](2)+" "[r](38))[r](42) which has length 42 and whose output has length 1764.

Python 2, 56 bytes
f=lambda n:"print`f`*"+`n*n`+','+'#'*(33*n-9-len(`n*n`))

Creates a string of the form
print`f`*<number>################...#####

where the number is n^2 and there are enough #s to make the string 33n characters long. Depending on the way your OS stores memory addresses, the 33 might need to change.
There's also that annoying +',' in the middle so that it conforms to the newline requirement; if anyone can figure out how to shorten that it would be much appreciated.
There's a less iffy version with 58 bytes in the following form:
f=lambda n:"print`id`*"+`n*n`+','+'#'*(22*n-10-len(`n*n`))

which functions identically and more reliably, but at the cost of using "id" instead of "f" as the function and having to subtract 10 instead of 9, using an extra character.
An explanation of this technique is given here.

Clean, 117 bytes
import StdEnv
$l n="import StdEnv\nf={#'0'\\\\_<-[1.."+++fromInt n+++"],_<-[0.."+++fromInt l+++"]}"

\n= $(size($99n))n

Try it online!
An anonymous function taking Int and giving the source for a function returning a string of the requisite length, having the signature f :: String. While this is technically reliant on the native integer type having less than 256 bits, I don't believe that this qualifies as abuse thereof.


text:
The modulo parity party
You are given an array A of n strictly positive integers, with n ≥ 2.
Your task is to map each entry Ai to:

1 if Aj mod Ai is odd for each j such that 1 ≤ j ≤ n and j ≠ i
2 if Aj mod Ai is even for each j such that 1 ≤ j ≤ n and j ≠ i
0 otherwise (mixed parities)

Example
For A = [ 73, 50, 61 ], we have:

50 mod 73 = 50, 61 mod 73 = 61 → mixed
73 mod 50 = 23, 61 mod 50 = 11 → all odd
73 mod 61 = 12, 50 mod 61 = 50 → all even

Therefore, the expected output is [ 0, 1, 2 ].
Rules

You may use any three distinct values (of any type) instead of 0, 1 and 2 as long as they're consistent. Please specify your mapping if you're not using the one described in the challenge.
Should there be any doubt about that, zero is even.
This is code-golf, so the shortest answer in bytes wins!

Test cases
[ 1, 2 ] --> [ 2, 1 ]
[ 3, 4 ] --> [ 1, 1 ]
[ 1, 2, 3 ] --> [ 2, 1, 0 ]
[ 4, 4, 4 ] --> [ 2, 2, 2 ]
[ 73, 50, 61 ] --> [ 0, 1, 2 ]
[ 941, 459, 533 ] --> [ 1, 0, 0 ]
[ 817, 19, 928, 177 ] --> [ 1, 2, 1, 1 ]
[ 312, 463, 336, 729, 513 ] --> [ 0, 2, 0, 0, 0 ]
[ 53, 47, 33, 87, 81, 3, 17 ] --> [ 0, 0, 0, 1, 0, 2, 0 ]

Related

Do the output values have to be integers or would [1], [0, 1], and [1, 1] work?

@Dennis Any consistent values are fine. So yes, that would work!

Python 2, 68 67 66 bytes
-1 byte thanks to Mr. Xcoder
-1 byte thanks to ovs

x=input()
for j in x:k=sum(i%j%2for i in x);print(k<len(x)-1)+0**k

Try it online!
Returns 1,0,2 instead 0,1,2.

replace (k<1) with 0**k for -1 byte.

Jelly, 9 bytes
%þœ-€0Ḃ‘Ṭ

Returns [1, 1], [0, 1], [1] instead of 0, 1, 2.
Try it online!
How it works
%þœ-€0Ḃ‘Ṭ  Main link. Argument: A (array)

%þ           Build the modulus table.
  œ-€0       Remove one 0 from each list of moduli.
      Ḃ      Take the last bit of each.
       ‘     Increment, mapping 0 and 1 to 1 and 2.
        Ṭ    Untruth; map each array to an aray of 1's at the specified indices.
             This yields:
                 [1] if the array contains only 1's (all even).
                 [0, 1] if the array contains only 2's (all odd).
                 [1, 1] if the array contains 1's and 2's.

Could you replace ‘ṬUḄ with Q€Ḅ to save a byte?

Sadly, no. Q€ could return [0, 1] or [1, 0].

Oh, right. I think [1], [1,1], and [0,1] are three distinct values so %þœ-€0Ḃ‘Ṭ should be acceptable for 9. EDIT - ah I see you asked this exact question :)

Another 9 byte alternative is ¹-Ƥ%"%2‘Ṭ

Mathematica, 57 49 48 bytes
(s=#;And@@#.Or@@#&@OddQ@Rest@Sort[s~Mod~#]&)/@#&

This returns:

False.True for 0 (mixed)
True.True for 1 (all odd)
False.False for 2 (all even)

Try it online!
Here's a slightly longer alternative (49 bytes):
Sign[(s=#;Tr@Mod[s~Mod~#,2]&)/@#/.Tr[1^#]-1->-1]&

This one returns:

1 for 0 (mixed)
-1 for 1 (all odd)
0 for 2 (all even)

Try it online!

MATL, 12 bytes
!G\o~tAws1=-

This uses 0, -1, 1 instead of 0, 1, 2 respectively.
Try it online! Or verify all test cases.
Explanation
!    % Implicit input: row vector. Transpose into a column
G    % Push input again
\    % Modulus, element-wise with broadcast. Gives a square matrix
o    % Parity: gives 1 for odd, 0 for even
~    % Logical negate: 0 for odd, 1 for even
t    % Duplicate
A    % All: gives 1 for columns that contain only 1
w    % Swap
s    % Sum of each column
1    % Push 1
=    % Is equal? Gives 1 if the column sum was 1, 0 otherwise
-    % Subtract, element-wise. Implicit display

C (gcc), 118 114 97 92 91 86 bytes

Thanks to Peter Cordes for bugfixing.
Saved four twenty-one bytes thanks to Peter Cordes; suggesting to use a different output value mapping; [0 1 2] ~ [3 2 1].
Saved five bytes; using yet another mapping; [0 1 2] ~ [  ].
Saved a byte; golfed for(i=0;i<n;i++,putchar... to for(i=~0;++i<n;putchar....
Saved five bytes thanks to ceilingcat.

i,j,r;f(A,n)int*A;{for(i=~0;++i<n;putchar(r))for(r=0,j=n;j--;)r|=j-i?A[j]%A[i]%2+1:0;}

Try it online!

Your test functions on TIO don't pass enough args, and this undefined behaviour leads to a division by zero (SIGFPE) from the last test case.  f(I,7) overwrites the first element of I[] (A[] in f()) with one of the args that you're using as locals.  f() assumes that arg was passed on the stack by the caller, but the caller didn't know that, and what's actually on the stack above the return address is A[0].  (i.e. this UB caused t and A[0] to have the same address).  Anyway, this is only UB in your test function on TIO.

And BTW, I couldn't repro the crash locally so I had to add execlp("/usr/bin/objdump", "objdump", "-drwC", "-Mintel", argv[0], 0); to main to get the asm from TIO's gcc 7.2.1, which didn't exactly match my Arch Linux gcc 7.2.1.  After turning that disassembly back into asm source for the calling function, I could repro it locally inside gdb and confirm exactly what was happening.

You might save bytes using a different mapping, like 1 for even, 2 for odd, 3 for mixed, so you can o|=1<<(A[j]%A[i]%2) without needing any fancy decoding for o.

@PeterCordes Thank you for noting, even though I still do not fully understand why the first array entry gets overwritten. I now chose to use global variables instead of local ones, removing the undefined behaviour.

@PeterCordes I also took your golfing suggestion and managed to save four bytes. However, I do not know if this really was what you were suggesting, as you wrote o|=1<<... instead of something along the lines of o|=1<<(t=....

The question says you can choose your own number codes.  1 -> even, 2 -> odd, 3 -> mixed makes it a bitmap where you can just r|=1<<..., like this: i,j,r;f(A,n)int*A;{for(i=0;i<n;i++){for(j=r=0;j<n;j++)j-i&&(r|=1<<A[j]%A[i]%2);printf("%d,",r);}} 97 bytes.  Working on an x86 asm answer using idiv / and edx,1 / bts edi, edx to do the same thing.

And BTW, your original didn't have a bug in the strictest sense, just a requirement on the caller to pass additional args (so you could argue it was your test main() that was buggy).  But yeah, globals work too, without costing any extra bytes.  Up to 6 integer args is safe when targeting the x86-64 System V ABI, because those will be register args, not stack.  But it's still better to avoid UB in the first place.

Thanks a lot for the golf; did not really understand your suggestion to the fullest. Did not know that on x86-64 the problem only comes when using six function parameters, glad to know now! If not a bug, it would probably violate at least partially the allowed I/O format, as the only input is an array (and array length in languages like C).

@ceilingcat Thank you.

JavaScript (ES6), 46 bytes
a=>a.map(A=>a.map(B=>d+=B%A%2,d=0)|!a[d+1]-!d)

Returns -1 (even), 1 (odd), and 0 (mixed).
How it works:
The d accumulator will be:

Zero if all even moduli.  (!a[d+1] == false, !d == 1, false - 1 == -1)
One less *  than the length of the array if all odd moduli.  ( * The accumulator includes an element modulused against itself, resulting in one even modulus.)  (!a[d+1] == true, !d == 0, true - 0 == 1)
Two or more less than the length of the array if a mix.  (!a[d+1] == false, !d == 0, false - 0 == 0)

Test cases:

let f=

a=>a.map(A=>a.map(B=>d+=B%A%2,d=0)|!a[d+1]-!d)

console.log(f([ 1, 2 ] ) + ''); // [ -1, 1 ]
console.log(f([ 3, 4 ] ) + ''); // [ 1, 1 ]
console.log(f([ 1, 2, 3 ] ) + ''); // [ -1, 1, 0 ]
console.log(f([ 4, 4, 4 ] ) + ''); // [ -1, -1, -1 ]
console.log(f([ 73, 50, 61 ] ) + ''); // [ 0, 1, -1 ]
console.log(f([ 941, 459, 533 ] ) + ''); // [ 1, 0, 0 ]
console.log(f([ 817, 19, 928, 177 ] ) + ''); // [ 1, -1, 1, 1 ]
console.log(f([ 312, 463, 336, 729, 513 ] ) + ''); // [ 0, -1, 0, 0, 0 ]
console.log(f([ 53, 47, 33, 87, 81, 3, 17 ] ) + ''); // [ 0, 0, 0, 1, 0, -1, 0 ]

Red, 101 bytes
g: func[b][foreach n b[a: copy[]foreach m b[append a m % n % 2]sort a a: copy next a print unique a]]

Try it online!
Returns 1 0 for mixed, 1 for odd and 0 for even
g: func[b] [
    foreach n b [
        a: copy []
        foreach m b [
            append a m % n % 2
        ]
        sort a
        a: copy next a
        print unique a
    ]
]

Clean, 95 65 63 bytes
import StdEnv

\l=[sum(removeDup[-1^(j rem i)\\j<-l|j<>i])\\i<-l]

Try it online!
As a lambda, taking [Int] and returning [Int], mapping to:

0: mixed
1: all even
-1: all odd

Java 8, 91 89 bytes
a->{for(int z:a){int s=1;for(int y:a)s+=y%z%2;System.out.print(" "+(s<a.length)+(s<2));}}

Using truetrue instead of 2 for even
Using falsefalse instead of 1 for odd
Using truefalse instead of 0 for mixed

Explanation:
Try it online.
a->{                      // Method with integer-array parameter and no return-type
  for(int z:a){           //  Loop over the array
    int s=1;              //   Sum-integer, starting at 1
    for(int y:a)          //   Inner loop over the array again
      s+=y%z%2;           //    Increase the sum by `y` modulo-`z` modulo-2
    System.out.print(" "  //   Print a space
      +(s<a.length)       //    + "true" if the sum is smaller than the length of the array
                          //      (this means there is at least one even)
      +(s<2));}}          //    + "true" if the sum is still 1
                          //      (this means all are even)

J, 27 20 bytes
[:<@~.@}:@\:"1~2||/~

Try it online!
Uses [1 0] [1] [0] instead of 0 1 2
Explanation:
|/~ - makes a table with remainders:
  |/~ 73 50 61
 0 50 61
23  0 11
12 50  0

2| odd or even? :
   2||/~ 73 50 61
0 0 1
1 0 1
0 0 0

<@~.@}:@\:"1 - sort down, drop last element (always a zero), keep the ùnique elements and box each row:
   <@~.@}:@\:"1~2||/~ 73 50 61
┌───┬─┬─┐
│1 0│1│0│
└───┴─┴─┘

16 bytes with 2/:~@:|"1]|1]\.] returning a list of pairs.

@ miles Thank you! Is this output acceptable?

Actually no, I missed that part about distinct values. I'll get back to it in a bit.

Ruby, 58 56 bytes
->r{r.map{m=r.shift;s=r.map{|e|e%m%2}.uniq.sort;r<<m;s}}

Returns [0, 1], [1], [0] instead of 0, 1, 2 (i.e. [0] for all even , [1] for all odd, and [0, 1] for mixed).
Try it online!

Perl 5, 71 69 + 1 (-a) = 70 bytes
map{//;$j=$s='';$j++-$i&&($s+=$_%$'&1)for@F;say$s?0|$s==$#F:2;$i++}@F

Try it online!

Perl, 38 bytes
Includes +3 for -p
#!/usr/bin/perl -p
s/\d+/$@|=$_%$&%2+1for<$`$'>;$@/gee

Outputs 1 for all even, 2 for all odd, 3 for mixed

Pari/GP, 42 bytes
a->[[!s=vecsum([x%y%2|x<-a]),s>#a-2]|y<-a]

Returns [0, 0], [0, 1], [1, 0] instead of 0, 1, 2.
Try it online!

Clojure, 82 bytes
#(for[R[(range(count %))]i R](set(for[j R :when(not= i j)](odd?(mod(% j)(% i))))))

A complete example with output conversion:
(def f #(for[R[(range(count %))]i R](set(for[j R :when(not= i j)](odd?(mod(% j)(% i)))))))
(->> [ 53, 47, 33, 87, 81, 3, 17] f
     (map {#{true} 1, #{false} 2, #{true false} 0}))
; (0 0 0 1 0 2 0)