[Question]
  [
A newspaper is made of several sheets; for the purposes of this question, each sheet of newsprint holds four pages of the final newspaper. Here is an example of three sheets of newsprint making up a newspaper with twelve pages:
```
 ___________
|2    |   11|
|  ___|_____|_
| |4    |    9|
|_|  ___|_____|_
  | |6    |    7|
  |_|     |     |
    |     |     |
    |_____|_____|
```
(Pages 1, 3, 5, 8, 10 and 12 are on the reverse of these sheets so you can't see them here.)
Your challenge, should you choose to accept it, is to output all the sets of pages that are on each sheet of a given newspaper.
You can take either the number of sheets (which is always a positive integer) or the number of pages (which is always a positive multiple of 4), but please indicate which.
You can output the sets of pages in any reasonable order, as long as it is clear which pages belong in which set.
For example, given an input of 3 sheets or 12 pages, you could output (1, 2, 11, 12), (3, 4, 9, 10) and (5, 6, 7, 8); or you could output (8, 5, 7, 6), (10, 3, 9, 4) and (12, 1, 11, 2); or any variant thereof, but you cannot of course output 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12.
This is code golf, so please make your program or function as short as possible. (I will even accept the shortest overall program as the answer on request of its author if doing so will earn me a Winter Bash hat.)
  
[Answer]
# [convey](http://xn--wxa.land/convey/), 34 bytes
```
}
/1:`%""{
^1"v4!<
+"+v}+1
^<","-}
```
[Try it online!](https://xn--wxa.land/convey/run.html#eyJjIjoifVxuLzE6YCVcIlwie1xuXjFcInY0ITxcbitcIit2fSsxXG5ePFwiLFwiLX0iLCJ2IjoxLCJpIjoiMTIifQ==)
[![left loop](https://i.stack.imgur.com/D1PLS.gif)](https://i.stack.imgur.com/D1PLS.gif)
Pushes `n` and `n+1` to the right per loop.
[![right part](https://i.stack.imgur.com/OAhO1.gif)](https://i.stack.imgur.com/OAhO1.gif)
For each value outputs `i` and `i-pages+1`.
[![all together](https://i.stack.imgur.com/Jvni3.gif)](https://i.stack.imgur.com/Jvni3.gif)
Whenever the left loop passes through the top part, output a newline `/}`.
Allow `n` to pass the loop only `pages % 4` times.
[Answer]
# [J](http://jsoftware.com/), 18 bytes
Takes number of sheets as input
```
_4>:\2/:@(,|.)@#i.
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/403srGKM9K0cNHRq9DQdlDP1/mtypSZn5CtoWKdpKhgisY2Q2MZIbJP/AA "J – Try It Online")
```
_4>:\2/:@(,|.)@#i.
                i.  0…n: 0 1 2
     2         #    repeat each 2 times: 0 0 1 1 2 2
         (,|.)@     append its rotated version: 0 0 1 1 2 2 2 2 1 1 0 0
      /:@           get the indices to sort: 0 1 10 11 2 3 8 9 4 5 6 7
_4  \               group by 4: 0 1 10 11, 2 3 8 9, 4 5 6 7
  >:                and increment: 1 2 11 12, 3 4 9 10, 5 6 7 8
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), 9 bytes
```
←½Sz+↔C2ḣ
```
[Try it online!](https://tio.run/##yygtzv7//1HbhEN7g6u0H7VNcTZ6uGPx////DY0A "Husk – Try It Online")
Argument is the number of pages.
```
        ḣ   # list of all the page numbers 1..input
      C2    # split into groups of two
  S         # hook: S(fgx) means f(x,g(x))
   z        # zip together
    +       # by combining elements from both lists
            # x = the list of groups of two)
     ↔      # and itself reversed
←½          # now take just the first half of this list
            # of lists of 4-pages per sheet
```
[Answer]
# [Perl 5](https://www.perl.org/) `-n`, 38 bytes
```
$,=$";say$.++,$.++,$_--,$_--while$_>$.
```
[Try it online!](https://tio.run/##K0gtyjH9/19Fx1ZFybo4sVJFT1tbB0LE6@qCifKMzJxUlXg7Fb3//w2N/uUXlGTm5xX/1/U11TMwNPivmwcA "Perl 5 – Try It Online")
Takes the number of pages as input
[Answer]
# [APL (Dyalog Extended)](https://github.com/abrudz/dyalog-apl-extended), ~~16~~ 14 bytes
```
¯1 4⍴⍋2/,∘⌽⍨…⎕
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/qKM97f@h9YYKJo96tzzq7TbS13nUMeNRz95HvSseNSx71DcVpOR/GpcRAA "APL (Dyalog Extended) – Try It Online"), [Stax](https://staxlang.xyz/#p=854aaf5cc29ce02fe98c14f424&i=12)
A port of xash's solution.
a full program which returns a matrix.
-2 bytes from Bubbler.
[Answer]
# [R](https://www.r-project.org/), 48 bytes
```
function(N)split(rbind(x<-1:N,N:1)[x],(x-1)%/%4)
```
[Try it online!](https://tio.run/##K/qfpmCj@z@tNC@5JDM/T8NPs7ggJ7NEoygpMy9Fo8JG19DKT8fPylAzuiJWR6NC11BTVV/VRPN/moahkeZ/AA "R – Try It Online")
Takes input as the number of pages.
# [R](https://www.r-project.org/), 51 bytes
```
function(N)split(1:(4*N),c(x<-rep(1:N,e=2),rev(x)))
```
[Try it online!](https://tio.run/##K/qfpmCj@z@tNC@5JDM/T8NPs7ggJ7NEw9BKw0TLT1MnWaPCRrcotQAo4KeTamukqVOUWqZRoamp@T9Nw1jzPwA "R – Try It Online")
Takes input as number of sheets.
[Answer]
# Scala, 37 bytes
```
p=>1.to(p/2)zip p.to(p/2,-1)grouped 2
```
[Try it online!](https://scastie.scala-lang.org/SpYcaEVyRSuW5EkPjXaOOw)
Returns an iterator of 2-element vectors, each containing a 2-tuple of page numbers opposite each other.
[Answer]
# [Python 2](https://docs.python.org/2/), 46 bytes
```
def f(n,i=2):i>n>_;print~-i,i,n-1,n;f(n-2,i+2)
```
[Try it online!](https://tio.run/##K6gsycjPM/r/PyU1TSFNI08n09ZI0yrTLs8u3rqgKDOvpE43UydTJ0/XUCfPGiiva6STqW2k@T9NwxBIAgA "Python 2 – Try It Online")
Takes the number of pages `n` as input.
A function that prints and terminates with error. If we avoid errors, many different ways to structure the code come out very close.
**50 bytes**: [Try it online!](https://tio.run/##K6gsycjPM/r/P9M2zzYzr6C0REOTqzwjMydVIVPLyC7PKlPX1si6oCgzr0S3LlMnU9tIJ08byMjTzfz/39AIAA "Python 2 – Try It Online")
```
i=n=input()
while i*2>n:i-=2;print-~i,i+2,n+~i,n-i
```
**50 bytes**: [Try it online!](https://tio.run/##K6gsycjPM/r/P882M6@gtERDkyvT1pCrPCMzJ1Uh0ybPqqAoM69Ety5TJ1MnT9dQJ886U9vWyDpP1xaox9AIAA "Python 2 – Try It Online")
```
n=input()
i=1
while i<n:print-~i,i,n-1,n;i+=2;n-=2
```
**51 bytes**: [Try it online!](https://tio.run/##K6gsycjPM/r/P882M6@gtERDkyvT1pCrPCMzJ1UhU8vIJs@qoCgzr0S3LlMnUydPF4y1Da0ztW2BmgyNAA "Python 2 – Try It Online")
```
n=input()
i=1
while i*2<n:print-~i,i,n-i,n-i+1;i+=2
```
**51 bytes**: [Try it online!](https://tio.run/##K6gsycjPM/r/P802JzE3KSVRIU8n09bQKk8/UyvaIDYxLyVaI1MnU9tQJ08XiDVjtdM08nSNgCJGmv8LijLzShTSNEw0uWBMCwTTEKgCAA "Python 2 – Try It Online")
```
f=lambda n,i=1:n/i*[0]and[(i,i+1,n-1,n)]+f(n-2,i+2)
```
**51 bytes**: [Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSHPKlojUydT21AnTzcThLUNNdPyixQyFTLzFIoS89JTNYBS@kY6Rpqx/wuKMvNKFNI0TDS5YEwLBNPQSPM/AA "Python 2 – Try It Online")
```
lambda n:[(i,i+1,n-i,n-i+1)for i in range(1,n/2,2)]
```
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), ~~21~~ 19 bytes
-2 bytes thanks to coltim
```
 {1+0N 4#<x,|x:&x#2}
```
[Try it online!](https://tio.run/##y9bNz/7/P82q2lDbwE/BRNmmQqemwkqtQtmo9n@1RoV1mkKFZq2DuqGCkYKxgsl/AA "K (oK) – Try It Online")
A port of [xash's J solution](https://codegolf.stackexchange.com/a/216596/75681) - please upvote it too!
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 7 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
ḶạÞH‘s4
```
A monadic Link accepting the number of pages (four times the number of sheets) which yields a list of lists of the page numbers belonging to each sheet.
**[Try it online!](https://tio.run/##ARoA5f9qZWxsef//4bi24bqhw55I4oCYczT///8yOA "Jelly – Try It Online")**
### How?
```
ḶạÞH‘s4 - Link: integer, P   e.g.  12
Ḷ       - lowered range (P)        [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11]
   H    - halve (P)                6
  Þ     - sort by:
 ạ      -   absolute difference  ( [ 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5] )   
        -                       -> [ 6, 5, 7, 4, 8, 3, 9, 2,10, 1,11, 0]
    ‘   - increment                [ 7, 6, 8, 5, 9, 4,10, 3,11, 2,12, 1]
      4 - four                     4
     s  - split into chunks        [[7,6,8,5],[9,4,10,3],[11,2,12,1]]
```
[Answer]
# [AWK](https://www.gnu.org/software/gawk/manual/gawk.html), 46 43 bytes
```
x=$1{for(;y<x;)$++v=++y","++y","x--","x--}1
```
Takes the number of pages.
```
x=$1{
```
Set `x` to the number of pages. That will always evaluate to true
given the rules, so the block of code will always run.
```
     for(;y<x;)
```
Loop until the forward page counter `x` is larger then the
backwards page counter `y`. It's effectively looping once for
every 4 pages, since `x` and `y` both change by 2 each time
through the loop.
```
               $++v=++y","++y","x--","x--
```
Set positional argument `v` (incremented before it's used) to the
next set of 4 pages, adjusting the forward and backwards counters
as they are used.
```
                                         }
```
Ends the code block.
```
                                          1
```
An unconditionally true test with no defined code block causes the
default action, which is to print all the positional arguments
joined by the `OFS` variable. The default for that is a space.
[Try it online!](https://tio.run/##SyzP/v@/wlbFsDotv0jDutKmwlpTRVu7zFZbu1JJRwlCVujqQshaw///jY0A "AWK – Try It Online")
[Answer]
# JavaScript (ES6), 47 bytes
```
f=(n,N=1)=>N<n?[[N,N+1,n-1,n],...f(n-2,N+2)]:[]
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/f8/zVYjT8fP1lDT1s7PJs8@OtpPx0/bUCdPF4hjdfT09NI08nSNgGJGmrFW0bH/k/PzivNzUvVy8tM10jQMjTT1svIz8zTUFfQV1DU1uVCljQxQpf8DAA "JavaScript (Node.js) – Try It Online")
[Answer]
# [Ruby 2.7](https://www.ruby-lang.org/), 43 bytes
```
->n{((1..n/2)%2).map{|v|[v,v+1,n-v,n-v+1]}}
```
No TIO link, as TIO supports an older version of Ruby.
---
# [Ruby](https://www.ruby-lang.org/), 45 bytes
```
f=->n,k=1{k<n ?[[k,k+1,n-1,n]]+f[n-2,k+2]:[]}
```
[Try it online!](https://tio.run/##KypNqvz/P81W1y5PJ9vWsDrbJk/BPjo6Wydb21AnTxeIY2O106LzdI2AIkaxVtGxtf/Tog2NYvVyEwuqa8pqChTKav8DAA "Ruby – Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~72~~ 70 bytes
* -2 bytes thanks to ceilingcat
Takes the number of physical pages.
I compute the last page and then loop through each physical page, getting the distance from the bounds for each one starting from the last page (the middle page numbers).
```
f(n,i,j){for(i=n*4;n--;)printf("%d/%d/%d/%d ",j+1,i-j,++j,i-j,j=n*2);}
```
[Try it online!](https://tio.run/##NU3ZCsIwEHzfr1giSmITtbUeEPVLfCmJ1Q2alh6@lH57TAvCwAzDHEY9jQmh5F6SdGIoq4bT1a9z7ZXSom7IdyVnS7v9A5l0SSpJOZkkbmYXC5nQY1iQN@/ePvDSdpaqzesGEAfwU5Dn34qswAEQJ4s0RDXdaWxN4eeTu2cSVyRuO41137WcMSFiLAY5CQ1jSCGDPeRwgCOc4PwD "C (gcc) – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 7 bytes
Input is the number of pages, output is in a different order, both the pages on each sheet and the sheets.
```
Lι€Âøιн
```
[Try it online!](https://tio.run/##ARoA5f9vc2FiaWX//0zOueKCrMOCw7jOudC9//8yNA "05AB1E – Try It Online")
```
          # implicit input                          8
L         # push the range [1..input]               [1, 2, 3, 4, 5, 6, 7, 8]
 ι        # uninterleave, push [a[0::2],a[1::2]]    [[1, 3, 5, 7], [2, 4, 6, 8]]
  €Â      # duplicate and reverse each list         [[7, 5, 3, 1], [1, 3, 5, 7], [8, 6, 4, 2], [2, 4, 6, 8]]
    ø     # transpose the list of lists             [[7, 1, 8, 2], [5, 3, 6, 4], [3, 5, 4, 6], [1, 7, 2, 8]]
     ι    # uninterleave                            [[[7, 1, 8, 2], [3, 5, 4, 6]], [[5, 3, 6, 4], [1, 7, 2, 8]]]
      н   # take the first element                  [[7, 1, 8, 2], [3, 5, 4, 6]]
```
---
# [05AB1E](https://github.com/Adriandmen/05AB1E), 8 bytes
Takes the number of pages as an input. Output is in the natural order.
```
Lι€Âø€{Ù
```
[Try it online!](https://tio.run/##yy9OTMpM/f/f59zOR01rDjcd3gGkqg/P/P/f0AgA "05AB1E – Try It Online")
```
          # implicit input                          8
L         # push the range [1..input]               [1, 2, 3, 4, 5, 6, 7, 8]
 ι        # uninterleave, push [a[0::2],a[1::2]]    [[1, 3, 5, 7], [2, 4, 6, 8]]
  €Â      # duplicate and reverse each list         [[7, 5, 3, 1], [1, 3, 5, 7], [8, 6, 4, 2], [2, 4, 6, 8]]
    ø     # transpose the list of lists             [[7, 1, 8, 2], [5, 3, 6, 4], [3, 5, 4, 6], [1, 7, 2, 8]]
     €{   # sort each list                          [[1, 2, 7, 8], [3, 4, 5, 6], [3, 4, 5, 6], [1, 2, 7, 8]]
       Ù  # uniquify the list of lists              [[1, 2, 7, 8], [3, 4, 5, 6]]
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~17~~ 14 bytes
Thanks to [Neil](https://codegolf.stackexchange.com/users/17602/neil) for -3 bytes!
```
ＩＥ⪪…⁰⊘θ²⁺⊕ι⁻θι
```
[Try it online!](https://tio.run/##DYxBCoAgEEWv4nIEheoG0aYWbeoEgw4lmKlZ15/mw9u8B9@dWN2NkXnCp8GKGfYcQ4MN00HQGTVj/MhD0dqoQRi9hyW5ShelJiGIW0N6HyhGBS1j7ge2n5xam7M7fg) Link is to verbose version of code.
Input is (now) the number of pages.
### Explanation
```
Ｉ               Cast to string
  Ｅ             Map (forEach)
    ⪪    ²       Split on 2 (split into slices of length 2)
     …⁰          Range from 0...
       ⊘θ        ...to half of first input (θ)
          ⁺⊕ι    Add (concatenate) ι (current item, which is the slice), with every element incremented...
             ⁻θι ...to first input (θ) minus the slice (ι)
```
[Answer]
# PowerShell, 56 52 49 bytes
-4 bytes thanks to Neil!  
-3 bytes thanks to mazzy!
Takes input as the number of pages:
```
param($x)for(;$x-$y){++$y,++$y,$x--,$x---join","}
```
[Try it online!](https://tio.run/##K8gvTy0qzkjNyfn/vyCxKDFXQ6VCMy2/SMNapUJXpVKzWltbpVIHTAAFdMGEblZ@Zp6SjlLt////jUwA "PowerShell – Try It Online")
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal) `Ṁ`, ~~14~~ 13 bytes
```
ƛd›D⁰4*ε:›^›W
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=%E1%B9%80&code=%C6%9Bd%E2%80%BAD%E2%81%B04*%CE%B5%3A%E2%80%BA%5E%E2%80%BAW&inputs=3&header=&footer=)
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 42 bytes
***-1 bytes** from @pxeger*
```
for((x=$1;x>y;)){ echo {,}$[++y]\ $[x--];}
```
~~[Try it online!](https://tio.run/##S0oszvifpqGp8T8tv0hDo8JWxdC6wq7SWlOzWiE1OSNfoVqntlolWlu7MlZHJbpCVze21rr2vyYXV5qCodF/AA "Bash – Try It Online")~~
[Try it online!](https://tio.run/##S0oszvifpqGp8T8tv0hDo8JWxdC6wq7SWlOzWiE1OSNfoVqnViVaW7syNkZBJbpCVzfWuva/JhdXmoKh0X8A "Bash – Try It Online")
I'm usually the Zsh guy, but here Bash wins by a few bytes because it evaluates brace expansion **before** parameter expansion:
```
echo {,}{$[++y],$[x--]}
echo $[++y] $[x--] $[++y] $[x--]
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
Żx2m0Ụs4
```
[Try it online!](https://tio.run/##y0rNyan8///o7gqjXIOHu5cUm/z//98IAA "Jelly – Try It Online")
Another port of xash’s answer, drop that an upvote as well
## How it works
```
Żx2m0Ụs4 - Main link. Takes n on the left
Ż        - [0,1,2,...,n]
 x2      - [0, 0, 1, 1, 2, 2, ..., n, n]
   m0    - Append its reverse
     Ụ   - Grade up; sort the indices by values
      s4 - Split into runs of 4
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~10~~ 9 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
-1 thanks to [ovs](https://codegolf.stackexchange.com/users/64121)!
```
LΣ<I;α}4ô
```
**[Try it online!](https://tio.run/##yy9OTMpM/f/f59xiG0/rcxtrTQ5v@f/fyAIA "05AB1E – Try It Online")**
Port of my Jelly answer. Input is the number of pages (four times the number of sheets).
```
LΣ<I;α}4ô
L         - range
 Σ   }    - sort by:
  <       -   decrement
   I      -   push input
    ;     -   halve
     α    -   absolute difference
       4  - push four
        ô - split into chunks
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~20~~ 11 bytes
```
L2ô2ä`Rδ«Å\
```
[Try it online!](https://tio.run/##yy9OTMpM/f/fx@jwFqPDSxKCzm05tPpwa8z//xYA "05AB1E – Try It Online")
*-9 thanks to @ovs*
]