[Question]
  [
### A simple one:
Take a positive integer **n** less than 1000, and output the integers from **1** to **n** interleaved with the integers from **n** to **1**. You must concatenate the numbers so that they appear without any delimiters between them. 
### Test cases:
```
n = 1
11
n = 4
14233241
n = 26
12622532442352262172081991810171116121513141413151216111710189198207216225234243252261
n = 100
110029939849759669579489399210911190128913881487158616851784188319822081218022792378247725762675277428732972307131703269336834673566366537643863396240614160425943584457455646554754485349525051515052495348544755465645574458435942604161406239633864376536663567346833693270317130722973287427752676257724782379228021812082198318841785168615871488138912901191109299389479569659749839921001
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the shortest submission in bytes in each language wins. Explanations are encouraged. 
  
[Answer]
## JavaScript (ES6), 30 bytes
```
f=(n,k=1)=>n?f(n-1,k+1)+n+k:''
```
### How?
This is pretty straightforward but it's worth noting that the string is built from tail to head. An empty string at the beginning is appended last and allows the coercion of the final result to a string to happen.
Below is the detail of the recursion for `f(4)`:
```
f(4) =                                            // initial call
f(4, 1) =                                         // applying the default value to k
f(3, 2) + 4 + 1 =                                 // recursive call #1
(f(2, 3) + 3 + 2) + 4 + 1 =                       // recursive call #2
((f(1, 4) + 2 + 3) + 3 + 2) + 4 + 1 =             // recursive call #3
(((f(0, 5) + 1 + 4) + 2 + 3) + 3 + 2) + 4 + 1 =   // recursive call #4
((('' + 1 + 4) + 2 + 3) + 3 + 2) + 4 + 1 =        // n = 0 --> end of recursion
'' + 1 + 4 + 2 + 3 + 3 + 2 + 4 + 1 =              // final sum
'14233241'                                        // final result
```
### Test cases
```
f=(n,k=1)=>n?f(n-1,k+1)+n+k:''
console.log(f(1))
console.log(f(4))
console.log(f(26))
console.log(f(100))
```
[Answer]
# [Python 2](https://docs.python.org/2/), 46 bytes
```
lambda n:''.join(`x+1`+`n-x`for x in range(n))
```
Thanks to ovs for 4 bytes
[Try it online!](https://tio.run/nexus/python2#S7ON@Z@TmJuUkqiQZ6WurpeVn5mnkVChbZignZCnW5GQll@kUKGQmadQlJiXnqqRp6n5v6AoM69EIU3DRPM/AA "Python 2 – TIO Nexus")
Explanation:
```
lambda n:''.join(`x+1`+`n-x`for x in range(n))
lambda n:                                      # anonymous lambda taking one parameter n
                 `x+1`+`n-x`                   # `x` is repr(x) which is equivalent to str(x) for integers less than INT_MAX
                            for x in range(n)  # integers x in [0, n)
```
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 25 bytes
```
printf %s`seq $1 -1 1|nl`
```
[Try it online!](https://tio.run/nexus/bash#@19QlJlXkqagWpxQnFqooGKooGuoYFiTl5Pw//9/QwMDAA "Bash – TIO Nexus")
Prints decreasing sequence, number lines increasing and printf joins lines
~~Space delimited, 20 bytes :
seq $1 -1 1|nl|xargs~~
[Answer]
-5 thanks to Ørjan Johansen
# [Haskell](https://www.haskell.org/), 33 bytes
```
f n=do a<-[1..n];[a,n-a+1]>>=show
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P00hzzYlXyHRRjfaUE8vL9Y6OlEnTzdR2zDWzs62OCO//H9uYmaegq1CbmKBb7yCRkFpSXBJkU@egp5CmqZCtKGOiY6RmY6hgUHsfwA "Haskell – Try It Online")
[Answer]
# R, 35 bytes
```
n=scan();cat(rbind(1:n,n:1),sep="")
```
[Try it online](https://tio.run/#r#@59nW5ycmKehaZ2cWKJRlJSZl6JhaJWnk2dlqKlTnFpgq6Sk@d/0PwA)
`rbind(1:n,n:1)` creates a 2 row matrix with 1 to n in the first row and n to 1 in the second. The `cat` function collapses this matrix, reading down each column.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~6~~ 5 bytes
Saved a byte using the new interleave built-in as suggested by *rev*
```
LÂ.ιJ
```
[Try it online!](https://tio.run/##yy9OTMpM/f/f53CT3rmdXv//G5kBAA "05AB1E – TIO Nexus")
**Explanation**
```
L        # range [1 ... input]
 Â       # create a reversed copy
  .ι     # interleave the lists
    J    # join
```
[Answer]
## [CJam](https://sourceforge.net/p/cjam), 10 bytes
```
ri,:)_W%]z
```
[Try it online!](https://tio.run/nexus/cjam#@1@UqWOlGR@uGlv1/7@RGQA "CJam – TIO Nexus")
### Explanation
```
ri   e# Read input and convert to integer N.
,    e# Turn into range [0 1 ... N-1].
:)   e# Increment to get [1 2 ... N].
_W%  e# Duplicate and reverse the copy.
]    e# Wrap both in an array to get [[1 2 ... N] [N ... 2 1]]
z    e# Transpose to get [[1 N] [2 N-1] ... [N-1 2] [N 1]]
     e# This list is printed implicitly at the end of the program,
     e# but without any of the array structure (so it's essentially flattened,
     e# each number is converted to a string and then all the strings
     e# are joined together and printed).
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), 29 bytes
```
->n{n.times{|x|$><<x+1<<n-x}}
```
## Explanation:
```
->n{n.times{|x|                # x in range [0..n-1]
               $><<            # output on console
                   x+1<<n-x}}  # x+1, then n-x
```
[Try it online!](https://tio.run/nexus/ruby#S7P9r2uXV52nV5KZm1pcXVNRo2JnY1OhbWhjk6dbUVv7v6AoM69EIS3aJPY/AA "Ruby – TIO Nexus")
[Answer]
# Pyth, 7 bytes
```
jksC_BS
```
Try it online: [Demonstration](https://pyth.herokuapp.com/?code=jksC_BS&input=100)
### Explanation:
```
jksC_BSQ   implicit Q (=input number) at the end
      SQ   create the range [1, ..., Q]
    _B     bifurcate by inversion, this gives [[1, ..., Q], [Q, ..., 1]]
  sC       zip and flatten result
jk         join to a string
```
[Answer]
# [Whitespace](https://web.archive.org/web/20150618184706/http://compsoc.dur.ac.uk/whitespace/tutorial.php), 71 bytes
```
   
 
 	
		 
 			
  
 
	   	
	    
 	
 	 
	 
 	
 	   	
	  	 
 
	 	
 
```
[Try it online!](https://tio.run/nexus/whitespace#LYrBDQAwCALfxxQM4f6rUbWGBMhBbKuFYAK0gOas72gGXbuF/0MdSuoB "Whitespace – TIO Nexus")
## Explanation
```
sssn  ; push 0 - seed the stack with 0 (this will be our 1->n counter, a)
sns   ; dup
tntt  ; getnum - read n (stored on the heap)
sns   ; dup
ttt   ; retr - pull n onto the stack (this will be our n->1 counter, b)
nssn  ; label 'loop'
snt   ; swap - bring a to the top
ssstn ; push 1
tsss  ; add - increment a
sns   ; dup
tnst  ; putnum - output a as a number
snt   ; swap - bring b to the top
sns   ; dup
tnst  ; putnum - output b as a number
ssstn ; push 1
tsst  ; sub - decrement b
sns   ; dup
ntstn ; jez 'exit' if b is 0
nsnn  ; jmp 'loop'
```
The first couple of instructions are needed to set up the stack correctly, Whitespace's input commands write to the heap so we need to copy b (the input value) back onto the stack. We start with a = 0 since it is shorter to declare 0 instead of 1 (saves a byte) and we only need to reorder the increment instruction to cope. After that we just loop and increment a, output a, output b, decrement b, until b reaches 0 (checked after the decrement).
[Answer]
## Haskell, ~~65~~ ~~48~~ 47 bytes
1 byte saved thanks to Laikoni:
```
f n=show=<<(\(l,r)->[l,r])=<<zip[1..][n,n-1..1]
```
---
6 bytes saved thanks to nimi:
```
f n=show=<<(\(l,r)->[l,r])=<<zip[1..n][n,n-1..1]
```
---
Previous answer and explanation:
```
f n=concatMap show$concatMap(\(l,r)->[l,r])(zip[1..n][n,n-1..1])
```
There's already a better Haskell answer here, but I'm new to both Haskell and code golfing, so I may as well post it :)
This function zips the list [1..n] with its reverse, resulting in a list of tuples.
```
[(1,n),(2,n-1),(3,n-2)..(n,1)]
```
Then it uses `concatMap` to map a lambda to this list of tuples that results in a list of lists...
```
[[1,n],[2,n-1],[3,n-2]..[n,1]]
```
...and concatenates it.
```
[1,n,2,n-1,3,n-2..n,1]
```
Then a final `concatMap` maps `show` to the list and concatenates it into a single string.
`f 26
"12622532442352262172081991810171116121513141413151216111710189198207216225234243252261"`
[Answer]
# [Aceto](https://github.com/aceto/aceto), ~~25~~ 22 bytes
```
)&
pX`=
(pl0
id@z
r}Z)
```
### Explanation:
We read an integer and put it on two stacks.
```
id
r}
```
On one, we call range\_up (`Z`), on the other range\_down (`z`), then we set a catch mark to be able to return to this place later:
```
  @z
  Z)
```
We then check if the current stack is empty and exit if so:
```
 X`=
  l0
```
Otherwise, we print from both stacks and jump back to the catch mark:
```
)&
p
(p
```
[Answer]
# Octave, 29 bytes
```
@(n)printf("%d",[1:n;n:-1:1])
```
[Try it online!](https://tio.run/nexus/octave#@@@gkadZUJSZV5KmoaSaoqQTbWiVZ51npWtoZRir@T8xr1jDyEzzPwA "Octave – TIO Nexus")
[Answer]
**Scala, 43 bytes**
It's not the best but it's my first code golf.
```
n=>1.to(n).foldLeft("")((s,x)=>s+x+(n-x+1))
```
[Answer]
# [Perl 6](https://perl6.org), 20 bytes
```
{[~] 1..*Z~($_...1)}
```
[Test it](https://tio.run/nexus/perl6#NVBLaxNRFN7Pr7iLIklTp/e8zyFU3Lpx5UojoukIBduEPEQp7V@vX0JlYLjn9b2O@6n99nG9HO7/tjfrze3Ubl4evzx/bTSOl5@fZxffxnGk@dML5u8P0/7QbtrF5YeP43pz/2N2vbpdXM/H3eaw2c14vhyOwPuEreWw/fX9oS3OJ8vh52b3ev32XZut7h62x8PVavqzndaH6Xb@OLR2t28n@tniPJxftf/Tq3buDE8vD@CmgWgYTi8dSFmE9bVmH4id2dDCwBgFBfekKkrqFETkxGQkpPgEL0aHMOmURZXcAx1gsCir8AnkFZ56B3XvXCWVWmHlXhaliUYx9QJSdWIgSSZpBlk6eRpFKmXKieEkiCk7cxRLJGsEWzh7GEcoZwhXsPSAwujCXiKeoh5i7uJuEq6SLlLO2h1evCtbqViqWqiZq5tpmGqaaBlbN/jFn1EJuoqpYcuxHbhKXJcykJAJUBnoAhYFm4HVwR5QkVBTwlCG3KCSoVagWqHe4MLhJuAq4a6Y4RTpwzXDvSAFRRqGVBzpBFJKpFXESI6QYK9TwFkaZV5uFYqzc76d/gE "Perl 6 – TIO Nexus")
With an input of [100000](https://tio.run/nexus/perl6#Ky1OVSgz00u25sqtVFBLzk9JVbD9Xx1dF6tgqKenFVWnoRKvp6dnqFn7vzixUgEsb2gAAv8B "Perl 6 – TIO Nexus") this takes roughly 10 seconds, including compilation and printing the output.
## Expanded:
```
{                # bare block lambda with implicit parameter ｢$_｣
  [~]            # reduce using concatenation operator ｢&infix:«~»｣
                 # (shorter than ｢join '',｣)
    1 .. *       # Range from 1 to infinity
    Z~           # zip using concatenation operator
    ( $_ ... 1 ) # deduced sequence starting at the input
                 # going down to 1
}
```
The `Z~` needs the `~` because otherwise it generates a list of lists which will stringify with spaces.
There is no need to limit the Range starting at 1, because `Z` stops when any of the input lists run out.  
This saves two bytes (a space would be needed after `$_`)
[Answer]
# Java 61 bytes
```
(int n)->{for(int i=0;i<n;System.out.print(i+1+""+(n-i++)));}
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 5 bytes
```
RṚĖVV
```
[Try it online!](https://tio.run/nexus/jelly#@x/0cOesI9PCwv4fbn/UtEYh61HDnEPbDm171DBXQeHhju1AroJvYoFCTmZeto5CcWpBYlFiSapCfmlJQWlJsUJSpUJeajlQMrVY7/9/Qx0FEx0FIzMdBUMDAwA "Jelly – TIO Nexus")
### How it works
```
RṚĖVV  Main link. Argument: n
R      Range; yield [1, ..., n].
 Ṛ     Reverse; yield [n, ..., 1].
  Ė    Enumerate; yield [[1, n], ..., [n, 1]].
   V   Eval; convert each flat array to a string, interpret it as a Jelly program,
       and yield the output. This concatenates the integers in each pair, yielding
       a flat array of integers
    V  Repeat the previous step, concatenating the intgegers from before.
```
[Answer]
# [Röda](https://github.com/fergusq/roda), ~~21~~ 19 bytes
```
{seq 1,_<>seq _1,1}
```
[Try it online!](https://tio.run/##K8pPSfyfFvO/uji1UMFQJ97GDsSIN9QxrP2fm5iZV80VbWQWW5PGVfsfAA "Röda – Try It Online")
This is an anonymous function that takes input from the stream.
### Explanation
```
{seq 1,_<>seq _1,1}               Anonymous function, takes integer n from the stream
        <>                        Interleave
 seq 1,_                            the range 1 .. n with
          seq _1,1                  the range n .. 1
```
[Answer]
# Clojure, 61 bytes
```
#(let[a(range 1(+ 1 %))](apply str(interleave a(reverse a))))
```
Literally does what is asked. I believe it can be outgolfed by a less trivial solution. 
[See it online](http://ideone.com/Ml9Hix) 
[Answer]
# R, 41 bytes
```
pryr::f(for(i in 1:x){cat(i);cat(x-i+1)})
```
`pryr::f()` creates a function that takes one input. Loops over `1:x` and prints each element of `1:x` along with each element of `x:1`. Prints to STDOUT.
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), ~~10~~ 9 bytes
```
⟦₁g↔ᶻczcc
```
[Try it online!](https://tio.run/nexus/brachylog2#@/9o/rJHTY3pj9qmPNy2O7kqOfn/fyOz/1EA "Brachylog – TIO Nexus")
### Explanation
```
⟦₁           [1, …, Input]
  g↔ᶻc       [[1, …, Input],[Input, …, 1]]
      z      Zip
       cc    Concatenate twice
```
[Answer]
# PHP, 36 35 29 bytes
```
for(;$argn;)echo++$i,$argn--;
```
Saved one byte thanks to Jörg Hülsermann.
  
Saved six bytes thanks to Christoph.
[Answer]
# [V](https://github.com/DJMcMayhem/V), 20 bytes
```
ywo1@"­ñykPjñkògJ
```
[Try it online!](https://tio.run/nexus/v#@19Znm8o7aB0aO3hjZXZARJZjIc3Zh/elO71/7@RAQA "V – TIO Nexus")
Explain:
```
yw                    ' Copy the input number (for looping later)
  o1                 ' Insert a 1 under the input (on a newline)
     @"               ' [Copy register] number of times
       ­ñ      ñ       ' Do the thing inside of this loop
        ykP           ' Copy the current line and line above it, and paste above both
           j        ' decrement the current (top) number, and increment the one below
               k      ' Go to the top line
                ògJ   ' recursively join all of the lines
```
[Answer]
# [Cubix](https://github.com/ETHproductions/cubix), 17 bytes
```
....1I>sO)su.@?(O
```
[Try it online!](https://tio.run/nexus/cubix#@68HBIaedsX@msWleg72Gv7//5sCAA "Cubix – TIO Nexus")
cubified:
```
    . .
    . .
1 I > s O ) s u
. @ ? ( O . . .
    . .
    . .
```
Pushes `1`, reads in the input (`I`), then enters the loop which swaps the top of the stack, outputs it, increments, swaps, outputs the top of the stack, decrements, and stops if the top of the stack is 0.
[Answer]
# [K (ngn/k)](https://gitlab.com/n9n/k), 16 bytes
```
{,//$r,'|r:1+!x}
```
[Try it online!](https://tio.run/##y9bNS8/7/79aR19fpUhHvabIylBbsaLWyOz/fwA "K (ngn/k) – Try It Online")
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf), 5 bytes
```
{îkï-
```
[Try it online!](https://tio.run/##y00syUjPz0n7/7/68Lrsw@t1//835DLhMjLjMjQwAAA "MathGolf – Try It Online")
### Explanation:
```
{      Run a for loop over implicit input
 î     Push 1 based index of loop
  k    Push inputted number
   ï-  Subtract 0 based index of loop
       Implicitly output all this joined together
```
[Answer]
# [Forth (gforth)](http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/), 41 bytes
```
: f 1+ dup 1 do i 1 .r 1- dup 1 .r loop ;
```
[Try it online!](https://tio.run/##TYzBCoAgEETvfcXgNRQN6VDQzyhWEChS328TiHmat292N8R8H3IPX5SyIMCM8E@CgY84GSrDyKrIV4wJa1GCIyA3CMcF3jFcHujt723vp7l5YlcYrdsjYm3KCw "Forth (gforth) – Try It Online")
### Explanation
Loops from 1 to n and outputs the index as well as n-index in a right-aligned space of size 1 (forces no space after output)
### Code Explanation
```
: f               \ start new word definition
  1+ dup 1        \ set up arguments to loop from 1 to n
  do              \ start loop
    i 1 .r        \ output the index in a right-aligned space of size 1
    1- dup        \ subtract 1 from current value of n and duplicate
    1 .r          \ output new n in right-aligned space of size 1
  loop            \ end loop
;                 \ end word definition
```
[Answer]
# Common Lisp, ~~63~~ 54 bytes
```
(lambda(n)(dotimes(i n)(format t"~a~a"(1+ i)(- n i))))
```
[Try it online!](https://tio.run/##S87JLC74r/FfIycxNyklUSNPUyMlvyQzN7VYI1MByEnLL8pNLFEoUapLrEtU0jDUVsjU1NBVyANSQPDfyEzzPwA)
[Answer]
# [Mouse-2002](http://mouse.davidgsimpson.com/mouse2002/), 32 30 bytes
-2 moved conditional to start of loop `(z.^ ... )` instead of `(... z.0>^)`
```
?n:n.z:(z.^a.1+a:a.!z.!z.1-z:)
```
[Try it online!](https://tio.run/##y80vLU41MjAw@v/fPs8qT6/KSqNKLy5Rz1A70SpRT7EKhAx1q6w0/6v8NzQwAAA "Mouse-2002 – Try It Online")
**Explanation:**
```
?n:                                 ~ get input and store in n
   n.z:                             ~ copy n into z
       (z.^                         ~ stop if z equals 0
           a.1+a:                   ~ add 1 to a
                 a.!                ~ print a
                    z.!             ~ print z
                       z.1-z:)      ~ substract 1 from z
```
[Answer]
# MATL, ~~13~~ ~~11~~ 9 bytes
*2 bytes saved thanks to @Luis*
```
:tPv1eVXz
```
Try it at [**MATL Online**](https://matl.io/?code=%3AtPv1e%22%40V%26h&inputs=10&version=20.0.0)
**Explanation**
```
        % Implicitly grab input as a number, N
:       % Create an array from 1..N
tP      % Create a reversed copy
v       % Vertically concatenate the two
1e      % Reshape it into a row vector
V       % Convert to a string
Xz      % Remove whitespace and implicitly display
```
]