text:
The Ever Amplifying Zigzag
Write a program or function that takes in a positive integer N and outputs the first N numbers of this amplifying zigzag pattern, using only the lines needed:
                                         26
                                       25  27                                      .
         10                          24      28                                  .
        9  11                      23          29                              .
 2     8     12                  22              30                          44
1 3   7        13              21                  31                      43
   4 6           14          20                      32                  42
    5              15      19                          33              41
                     16  18                              34          40
                       17                                  35      39
                                                             36  38
                                                               37

So, if N is 1 the output is
1

If N is 2, the output is
 2
1

If N is 3 the output is
 2
1 3

If N is 4 the output is
 2
1 3
   4

If N is 10 the output is
         10
        9
 2     8
1 3   7
   4 6
    5

If N is 19 the output is
         10
        9  11
 2     8     12
1 3   7        13
   4 6           14
    5              15      19
                     16  18
                       17

and so on.
Notes

Each peak or trough of the zigzag reaches its point one more line away from the line with the 1 on it than the previous peak or trough.

N is not limited to 44. The zigzag grows in the same pattern and larger N should be supported.

Numbers with multiple digits should only "touch" at their corners, as depicted. Make sure this works when N is 100 and above.

There should be no empty (or space only) lines in the output except one optional trailing newline.

Any line may have any amount of trailing spaces.

Scoring
The shortest code in bytes wins. Tiebreaker is earlier answer.

What's the maximum possible N?

@JuliePelletier In theory there is none, but you can assume it will be less than 2^16.

Is using control characters allowed or are we limited to digits spaces and linefeeds?

@Dennis Let's say no. Just digits/spaces/newlines.

Somebody should submit that to the OEIS in that format as a joke.

Jelly, 41 37 29 bytes
RDµḌ’½Ċ-*_\x©L€Ṣ.ị®ạ€⁶ẋj"FZj⁷

Try it online!
How it works
RDµḌ’½Ċ-*_\x©L€Ṣ.ị®ạ€⁶ẋj"FZj⁷  Main link. Argument: n (integer)

R                              Range; yield [1, ..., n].
 D                             Decimal; yield A =: [[1], ..., [1, 0], ...].
  µ                            Begin a new, monadic chain. Argument: A
   Ḍ                           Undecimal; convert back to falt range.
    ’                          Decrement to yield [0, ..., n-1].
     ½Ċ                        Take the square root and round up (ceil).
       -*                      Elevate -1 to each rounded square root.
         _\                    Cumulatively reduce by subtraction.
                               This yields [1, 2, 1, 0, -1, 0, ...], i.e., the
                               vertical positions of the digits in A.
             L€                Compute the length of each list in A.
           x                   Repeat the nth position l times, where l is the
                               nth length.
            ©                  Copy the result to the register.
               Ṣ               Sort.
                .ị             At-index 0.5; yield the last and first element,
                               which correspond to the highest and lowest position.
                  ạ€®          Take the absolute difference of each position in the
                               register and the extrema.
                               This yields the number of spaces above and below
                               the integers in r as a list of pairs.
                     ⁶ẋ        Replace each difference with that many spaces.
                         F     Flatten the list A.
                       j"      Join the nth pair of strings of spacing, separating
                               by the nth digit in flat A.
                          Z    Zip/transpose the result.
                           j⁷  Join, separating by linefeeds.

Why not make a function in your language (Jelly) that can do that in a few chars while you're at it?

@JuliePelletier The art of writing a good golfing language is about coming up with a set of instructions (and syntax/language semantics) which allow you to write short solutions for as many different tasks as possible, not about being able to solve one very specific and contrived challenge in a single byte. A good golfing language tends to be actually very powerful and expressive, as opposed to just being a collection of built-ins which are useless for anything but the specific function they compute.

@JuliePelletier And it would also go against the rules of PPCG SE

PHP, 211 177 164 163 bytes
Predict the peaks with $n and increase the array dynamically in either direction, using ($x, $y) output cursor.
Numbers are aligned with str_pad() and the final output is the implode() of that array of strings ($g).
for($x=0,$d=-1,$h=$n=2,$y=$a=1;$a<=$argv[1];$y+=$d){$g[$y]=str_pad($g[$y],$x).$a;$x+=strlen($a);if($a++==$n){$h+=2;$n+=$h-1;$d*=-1;}}ksort($g);echo implode(~õ,$g);

Test it online!
Update: removed 34 bytes by getting rid of the unneeded array_pad().
Update2: followed @insertusernamehere's advice to shorten it a bit more.
Update3: followed @Lynn's advice to save one more byte with ~õ which imposes the use of LATIN-1 charset. (not available in online PHP emulator so not included there)

Just a question about this code.. Don't you have to initialize the array $g before you access a specific element? I mean, giving it a length or inserting the rows? I'm not very experienced with PHP, so it just looks weird to me... Thanks.

No.  Once you define $arr = [];, you can refer to $arr[anything].  Some cases will output notices but those are ignored here.  Note that reading stuff like this probably won't help you much to learn a language.  Your comment made me realize I could make it shorter though as I initially thought I'd need to pad my array but I don't.  :)

Haha glad for helping ;) Just realized that in PHP an array and a dictionary are initialized in the same way and are completely the same when looking at the syntax (Why, PHP?!)

Some minor improvements – 164 bytes: for($x=0,$d=-1,$h=$n=2,$y=$a=1;$a<=$argv[1];$y+=$d){$g[$y]=str_pad($g[$y],$x).$a;$x+=strlen($a);if($a++==$n){$h+=2;$n+=$h-1;$d*=-1;}}ksort($g);echo implode("⏎",$g); (Replace ⏎  with an actual newline.)

I believe if you set up your encoding right (Latin-1, not UTF-8), ~õ is a two-byte alternative to "⏎".

@Lynn:  insertusernamehere's suggestion was to use an actual LF instead of "\n" to save a byte.

Looks kinda neat if the output is very large and wraps: http://i.imgur.com/chkGb1e.png

@Julie: Right! But "⏎" with a real LF is three bytes long, while ~õ is even shorter at two bytes. It’s a bitwise-negated bareword (example) consisting of only the byte 0xF5. Negated, that becomes 0x0A, a newline character. (PHP is really messed up. :D)

@Lynn:  I certainly wasn't expecting that but it's a neat trick to save a byte.

Pyth, 60 53 52 46 42 39 38 36 34 32 31 bytes
39: It is now on par with the bug-fixed version of Jelly, and I have out-golfed Dennis' competing version!
38: I have out-golfed Dennis!
36: I have out-golfed Dennis again!
34: Even lower than his bug-fixed version!
31: 32 -> 31 thanks to Dennis.

J1K.u+N=J_WsI@Y2JtQZjsM.t.e++*]*dl`hkabhSK`hk*]*dl`hkabeSKKd
J1K.u+N=J_WsI@Y2JtQZjsM.t.eX*]*dl`hkhaeSKhSKabhSKhkKd
J1K.u+N=J_WsI@Y2JtQZ=-RhSKKjsM.t.eX*]*dl`hkheSKbhkKd
J1K.u+N=J_WsI@Y2JtQQj-#dsMC.eX*]*dl`hkheSKbhkK
J1j-#dsMC.eX*]*dl`hkyQ+Qbhkm=+Z=J_WsI@td2J
J1j-#dsMCmX*]*;l`hdyQ+Q=+Z=J_WsI@td2Jhd
J1j-#dsMCmX*]*;l`hdyQ+Q=+Z=J_WsI@td2Jh
J1j-#dsMCmX*]*;l`hdyQ+Q=+Z=@_BJsI@td2h
j-#dsMCmX*]*;l`hdyQ+Q=+Zsty%s@td2 2h
j-#dsMCmX*]*;l`hdyQ+Q=+Z@_B1.E@d2h
JQj-#dsMCmX*]*;l`hdyQ=+J@_B1.E@d2h
JyQj-#dsMCmX*]*;l`hdJ=+Q@_B1.E@d2h
j-#dsMCmX*]*;l`hdyQ=+Q@_B1.E@d2h
j-#dsMCmX*]*;l`hdyQ=+Q^_1.E@d2h

Try it online!
How it works
j-#dsMCmX*]*;l`hdyQ=+Q^_1.E@d2h      input: Q
j-#dsMCmX*]*;l`hdyQ=+Q^_1.E@d2hdQ    implicit filling arguments

       m                        Q    for each number d from 0 to Q-1:
                           @d2           yield the square root of d.
                         .E              yield its ceiling.
                      ^_1                raise -1 to that power. this
                                         yields the desired direction.
                   =+Q                   increment Q by this amount.

               hd                        yield d+1.
              `                          yield its string representation.
             l                           yield its length.
           *;                            repeat " " for that number of times
          ]                              yield a list containing the string above.
         *       yQ                      repeat the list for Q*2 times.
                                         the Q has changed, but Q*2 is
                                         an overshoot that is high
                                         enough, so we don't have to
                                         worry about it.

        X                                in that list, replace the
                                         element with index being the
                                         number generated above
                              hd         with d+1.

      C                              transpose the resulting array.
    sM                               flatten each element.
 -#d                                 remove lines containing only spaces.
                                     (filter on truthiness of set difference with space)
j                                    join by newlines.

"39: On par with Jelly"; "38: I have out-golfed Dennis!" For a few hours you did, but it looks like @Dennis doesn't like to get beaten at code-golfing: Jelly 37 bytes ;)

@KevinCruijssen Done.

Nice! xD M̶a̶y̶b̶e̶ I have a wild imagination, but now I imagine you've looked and looked in frustration for hours until you finally found this shorter solution, and now @Dennis will casually wake up and shorten his code again. (Jk, I hope you stay below Dennis!)

@KevinCruijssen Tada! It's now lower than the bug-fixed version.

MATLAB, 148 bytes
n=input('');k=fix(n^.5);m=0;w=1;d=-1;for l=1:n;s=num2str(l);m(k+1,w:w+nnz(s)-1)=s;w=w+nnz(s);k=k+d;d=d*(-1)^(l^.5==fix(l^.5));end;[m(any(m,2),:),'']

Note that the spaces are missing in Octave, as MATLAB prints the the character indexed with 0 as a space, while octave does just omit that character.
Explanation:
n=input('');
k=fix(n^.5);                    %caculate starting height
m=0;w=1;d=-1;                   %initialize counters and output matrix
for l=1:n;
    s=num2str(l);
    m(k+1,w:w+nnz(s)-1)=s;      %insert current index as a string
    w=w+nnz(s);                 %current horizontal position
    k=k+d;                      %current vertical position
    d=d*(-1)^(l^.5==fix(l^.5)); %if we reached a square number, change direction
end
[m(any(m,2),:),'']              %delete all zero rows

Haskell, 144 142 bytes
g n|k<-take n$scanl(+)0$[1..]>>= \x->(-1)^x<$[2..2*x]=unlines[[1..n]>>= \x->show x#(k!!(x-1)==y)|y<-[minimum k..maximum k]]
s#g|g=s|1<2=' '<$s

Usage example:
*Main> putStr $ g 19
         10
        9  11
 2     8     12
1 3   7        13
   4 6           14
    5              15      19
                     16  18
                       17

How it works:
s#g|g=s|1<2=' '<$s              -- # is a helper function that expects a string s
                                -- and a boolean g. It returns s if g is True, else
                                -- as many spaces as there a characters in s

k<-take n$                      -- bind k to the first n elements of
 [1..]>>= \x->(-1)^x<$[2..2*x]  -- 2*x-1 copies of (-1)^x for each x in [1,2,3,...]
                                -- i.e. [-1, 1,1,1, -1,-1,-1,-1,-1, 1,1,1,1,1,1,1..]
 scanl(+)0                      -- build partial sums, starting with 0
                                -- i.e. [0,-1,0,1,2,1,0,-1,-2,-3,-2,-1...]
                                -- -> k is the list of y coordinates for the
                                --    numbers 1,2,3,...

 [  |y<-[minimum k..maximum k]] -- for all y coordinates in k
      \x->show x#(k!!(x-1)==y)  -- map the # function
  [1..n]>>=                     -- over [1..n] (the x coordinates)
                                -- where # is called with
                                --  s -> a string representation of x
                                --  g -> True if k at index x equals the current y
unlines                         -- join with newlines

Edit: Thanks @Lynn for two bytes!

JavaScript (ES6), 213 bytes
with(Math)n=>(a=[...Array(n)].map((_,i)=>n-=1+sqrt(--i)&1||-1).map((e,_,a)=>e-min(...a))).map((e,i)=>r[e][i]=++i,r=[...Array(1+max(...a))].map(_=>a.map((_,i)=>` `.repeat(1+log10(++i)))))&&r.map(a=>a.join``).join`\n`

Where \n represents a literal newline character. Explanation:
with(Math)                          Bring functions into scope
 n=>                                Accepts one parameter
  (a=                               Intermediate result variable
   [...Array(n)].map(               For each number 0..n-1
    (_,i)=>n-=                      Accumulate index for each number
     1+sqrt(--i)&1||-1              Calculate the direction
    ).map((e,_,a)=>e-min(...a))     Scale the smallest index to zero
  ).map((e,i)=>r[e][i]=++i,         Overwrite the padding with 1..n
   r=[...Array(1+max(...a))].map(   Calculate number of lines
    _=>a.map((_,i)=>                For each number 1..n
     ` `.repeat(1+log10(++i)))))    Calculate the padding needed
  &&r.map(a=>a.join``).join`\n`     Join everything together

To shorten pow(-1,ceil(sqrt(i))) I rewrite it as sqrt(i-1)&1||-1 however this doesn't work for i=0 so to fix that I add 1 but this then flips the sign of the result which is why I end up with n-=.

heyyy you got a gold badge! nice job! and holy smokes you almost have as much rep as I do. keep it going!

@CᴏɴᴏʀO'Bʀɪᴇɴ That's "merely" the Fanatic badge. Apparently I'm really close to getting the gold code-golf tag badge!

double holy smokes. I need to get moving XD

Python 2, 137 bytes
l={}
i=x=y=n=v=0
exec"v+=1;l[y]=l.get(y,'').ljust(x)+`v`;x+=len(`v`);i=-~i%-~n;y+=n%4-1;n+=2>>i*2;"*input()
for k in sorted(l):print l[k]

View the output on ideone.

Hm... It doesn't go on and on and on and on.

@Zizouz212 It does, ideone just has a fixed output with and automatically breaks lines that are too long.


text:
Leyland Numbers
Given a natural number \$n\$, return the \$n\$-th Leyland number.
Leyland Number
Leyland numbers are positive integers \$k\$ of the form
$$k = x^y + y^x$$
Where \$x\$ and \$y\$ are integers strictly greater than 1.
They are enumerated in ascending order.
EDIT: @DigitalTrauma suggested I include following "definition":

Imagine we throw \$x^y+y^x\$ in a bag for all possible values of \$x\$ and \$y\$, and avoid throwing in duplicates. Then we sort that bag. The sorted bag is our sequence.

Details
You may use 0 or 1 based indexing, whatever suits you best.
Your program must be able to output at least all Leyland numbers less than the maximum of signed 32-bit integers. (The last Leyland number below this limit is 1996813914, at index 82.)
Test cases
The first few terms are following:
8, 17, 32, 54, 57, 100, 145, 177, 320, 368, 512, 593, 945, 1124

A076980 in OEIS, except for the first entry. Note that because of that additional first entry, the indices on OEIS are shifted by one.
More can be found in the OEIS b-file

They are enumerated in ascending order I'm not really sure what this means. Could you provide a list of x and y?

@DrGreenEggsandIronMan That means, 8 is before 17, not the other way round.

@DrGreenEggsandIronMan I think it's 2^2+2^2=8; 2^3+3^2=17; 2^4+4^2=32; 2^5+5^2=57; 2^6+6^2=100; 3^4+4^3=145 <- Note that 3^4+4^3 (=145) is lower than 2^7+7^2 (=177). So basically all possible combinations of x^y+y^x sorted from lowest to highest smaller than 1996813914.

@DrGreenEggsandIronMan Imagine we throw x^y+y^x in a bag for all possible values of x and y, and avoid thrwoing in duplicates. Then we sort that bag. The sorted bag is our sequence.

Regarding the 2^32 requirement, does that apply to time or memory considerations? Is it acceptable if the program works I'm theory with unlimited time and memory?

No, it should work on your computer and terminate within a reasonable time.

@flawr I think this comment makes it a lot clearer.  Can you edit this into the question?

Very large bag you have there

@LuisMendo Ask @HenriLéonLebesgue and he is going to tell you that this bag is basically nothing.

@flawr Its contained volume is also probably in the neighborhood of -1/12.

MATL, 16 15 13 bytes
Q:Qt!^t!+uSG)

Output is 1-based.
Try it online!
Explanation
Q    % Take input n. Add 1
:Q   % Range [2 ... n+1]. This is enough to be used as x and y
t!   % Duplicate and transpose
^    % Power, element-wise with broadcast. Gives 2D, square array with x^y
     % for all pairs of x and y
t!   % Duplicate and transpose. Gives square array with y^x
+    % Add, element-wise
u    % Keep unique elements. This linearizes (flattens) the 2D array
S    % Sort
G)   % Get the n-th entry. Implicitly display

In Matlab unique sorts the elements. Doesn't it in MATL, too?

@pajonk MATL uses the 'stable' flag for unique by default as that is the more typical usage.

@Suever Ok, thanks for clarifying.

I feel like we use the t!^ (where ^ can be replaced by +, -, or any number of operators) motif a lot. What if we made & mean 1 input for some of those where for a vector it has that behavior?

@Suever That's a great idea! I've done some research with your script; see the chat

Java 10, 225 221 219 216 206 204 193 192 130 129 bytes
n->{var S=new java.util.TreeSet();for(int i=56,t;i<840;)S.add(Math.pow(i/28,t=i%28+2)+Math.pow(t,i++/28));return S.toArray()[n];}

0-indexed
-2 bytes (221 → 219) saved by replacing 1996813915 with (1L<<31) thanks to @LeakyNun.
-3 bytes (219 → 216) thanks to @LeakyNun and @Frozn with something I forgot myself..
-10 bytes (216 → 206) by changing Java 7 to 8.
-2 bytes (206 → 204) by replacing ArrayList with Vector thanks to @TAsk.
-11 bytes (204 → 193) by removing s<(1L<<31)&, since the question states "at least all Leyland numbers less than the maximum of signed 32-bit integers".
-1 byte (193 → 192) by changing Vector to Stack.
-62 bytes (192 → 130) by switching to Java 10 and using var; removing the Collection.sort, import java.util.*;, if-statement and temp-long s by using a java.util.TreeSet (which is a set of unique values and sorts automatically); and using Double and Object return-type instead of Long so we can remove the (int)(...) cast and <Long>.
-1 byte (130 → 129) thanks to @ceilingcat by changing the two nested [2,30] loops to a single [56,840] loop.
Try it here
Explanation:
n->{                             // Method with integer parameter and Object return-type
  var S=new java.util.TreeSet(); //  Create a sorted Set, initially empty
  for(int i=56,t;i<840)          //  Loop `i` in the range [56,840]
    t.add(                       //   Add to the Set:
      Math.pow(i/28,             //    `i` integer-divided by 28
               t=i%28+2)         //    to the power `i` modulo-28 + 2
      +Math.pow(t,               //    And add `i` modulo-28 + 2
                i++/28));        //    to the power `i` integer-divided by 28
                                 //    (and increase `i` by 1 afterwards with `i++`)
  return S.toArray()             //  Convert the sorted Set to an Object-array
           [n];}                 //  And return the value at the input-integer index

10/10 for using java

Since you only need to support up to 2^31-1 (i.e., signed int), can't you swap out a bunch of the long casts?

@TimmyD I don't think so, because they will overflow in the process.

@TimmyD Maybe, but then I need to know the exact range for both for-loops, and even then it probably overflows.. (Also, I was too lazy / 'busy' with work to determine that max myself and just used two times 25 and an if(s<1996813915) check. xD)

Quick golfs: import java.util.*;long c(int n){List<Long>t=new ArrayList();for(int i=2,j;i<25;i++)for(j=2;j<25;j++){long s=(long)(Math.pow(i,j)+Math.pow(j,i));if(s<(1L<<31)&!t.contains(s))t.add(s);}Collections.sort(t);return t.get(n);}

@LeakyNun You've only changed if(s<1996813915& to if(s<(1L<<31)& if I see that correctly? Or you also changed something else?

The for loop variable declaration.

@LeakyNun Ah of course.. Read past that (twice.. in my own code AND in your comment.. >.> ;p)

@LeakyNun According to wolframalpha 24^24+24^24 = 2667471553700568248898162945687552, so I'd say it's more than enough for the 1996813915 maximum. :)

Have you put it in practice?

@LeakyNun Yes, here is a (quick-and-dirty) ideone which outputs the entire list.

@LeakyNun Even though 25^25+25^25 surpasses the max size of long, Math.pow returns Integer.MAX_VALUE when it's above a certain limit. Luckily for me, the max of this question is the same. :) Math.pow source-code

Yes, but it works not because 24^24+24^24 is very big. It works because you removed the bigger numbers. If you keep them there, it would not work.

@TimmyD Ah oops.. Changed to 30..

How about for (int i = 1, j; ++i < 30;) and for (j = 1; ++j < 30;)

@Frozn Thanks, edited. I always forget about that one for basic for-loops. Mostly because for-loops that use someArray.length it requires the -1 to work without ArrayIndexOutOfBoundsException, which is +1 bytes instead of -1.

Largely beaten, after you beat me ;-)

@OlivierGrégoire I've beaten you again. ;p

@KevinCruijssen Good because my solution was clunky as hell!

@ceilingcat Nice combination of the nested loops, thanks!

Haskell, 52 bytes
r=[2..31]
([k|k<-[0..],elem k[x^y+y^x|x<-r,y<-r]]!!)

Really inefficient. Tests each natural number for being a Leyland number, making an infinite list of those that are. Given an input, takes that index element of the list. Uses that only x,y up to 31 need to be checked for 32 bit integers.
Same length with filter:
r=[2..31]
(filter(`elem`[x^y+y^x|x<-r,y<-r])[0..]!!)

In hindsight such an obvious solution, I like it a lot!

Pyth, 17 bytes
0-indexed.
@{Sms^M_Bd^}2+2Q2

Try it online! (Please, keep it at 100.)
How it works
@{Sms^M_Bd^}2+2Q2
@{Sms^M_Bd^}2+2Q2Q  implicit filling. Input:Q

           }2+2Q    Yield the array [2,3,4,...,Q+2]
          ^     2   Cartesian square: yield all the
                    pairs formed by the above array.
   m     d          Map the following to all of those pairs (e.g. [2,3]):
       _B               Create [[2,3],[3,2]]
     ^M                 Reduce by exponent to each array:
                        create [8,9]
    s                   Sum:   17     (Leyland number generated)
  S                 Sort the generated numbers
 {                  Remove duplicate
@                Q  Find the Q-th element.

Slower version
1-indexed.
e.ffqZs^M_BT^}2Z2

Try it online! (Please, keep it at 3.)

Would it help to create an array of powers [[4,8,...][9,27,...]] and add it to its transpose?

@Neil I don't think so. It would be helpful in Jelly, but not in Pyth. Pyth does not automatically vectorize.

Also helps in MATL, it seems.

Why do you keep the slower version?

MATLAB, 58 bytes
1-indexed
n=input('');[A B]=ndgrid(2:n+9);k=A.^B;x=unique(k'+k);x(n)

unique in MATLAB flattens and sorts the matrix.

Thanks for help to @FryAmTheEggman and @flawr.

Husk, 13 12 bytes
!uΞ´Ṫ§+^`^tN

Try it online!
Tied with MATL, with a similar method.
-1 byte from Zgarb!
Explanation
!uΞ´Ṫ§+^`^tN
           N list of all natural numbers
          t  tail: remove 1
   ´         double: f x = f x x
    Ṫ        cartesian product with the following function
     §       fork: f g h x y = f (g x y) (h x y)
       ^     x^y
      +      plus
        `    reverse: f x y = f y x
        `^   y^x
  Ξ          merge all results together
 u           uniquify
!            take element at input index

The 12-byte code Q:Qt!^&+uSG) would work in recent versions of MATL, but I prefer to keep the original code, which runs in versions predating the challenge :-)

@LuisMendo Husk hasn't been updated since around 2017, so I guess we're on an even playing field.

05AB1E, 20 19 bytes
0-indexed
ÝÌ2ãvyÂ`ms`m+}){Ù¹è

Explained
ÝÌ                     # range(2,N+2)
  2ã                   # get all pairs of numbers in the range
    v                  # for each pair
     yÂ`ms`m+          # push x^y+y^x
             }         # end loop
              ){Ù      # wrap to list, sort and remove duplicates
                 ¹è    # get Nth element of list

Try it online
Saved 1 byte thanks to @Adnan

Very nice! One tip, ÝÌ is short for >L>.

@Adnan: Thanks! I can't belive I didn't think of that :P

ê is sorted_uniquified, if that existed when this was asked.

@carusocomputing: It was bugged until quite recently I'm afraid.

I know these builtins weren't available back then, but 2ã can be â; vy...}) can be ε...}; and {Ù can be ê for -4 bytes.

Mathematica, 60 48 40 bytes
(Union@@Array[#^#2+#2^#&,{#,#},2])[[#]]&

Uses one-based indexing. Union is used by applying it between each row of the 2D matrix created by the Array. There, Union will flatten the 2D matrix into a list while also removing any duplicates and placing the values in sorted order.
Saved 8 bytes thanks to @LLlAMnYP.
Usage

{#+1,#+1} isn't necessary, can be left as {#,#} and {2,2} can be replaced with simply 2.

@LLlAMnYP Thanks! Didn't know that Array would expand the third argument.

Neither did I but I decided to try it anyway and it worked :)

PowerShell v2+, 84 73 68 bytes
(2..30|%{2..($x=$_)|%{"$x*"*$_+'1+'+"$_*"*$x+1|iex}}|sort)[$args[0]]

Saved 11 bytes thanks to @Neil ... saved additional 5 bytes by reorganizing how the iex expression is evaluated.
Naïve method, we simply double-for loop from x=2..30 and y=2..x. Each loop we put x^y + y^x on the pipeline. The 30 was chosen experimentally to ensure that we covered all cases less than 2^31-1 ;-). We pipe those to Sort-Object to order them ascending. Output is zero-indexed based on the input $args[0].
Yes, there are a lot of extraneous entries generated here -- this algorithm actually generates 435 Leyland numbers -- but things above index 81 are not guaranteed to be accurate and in order (there may be some that are skipped).
Examples
PS C:\Tools\Scripts\golfing> .\leyland-numbers.ps1 54
14352282

PS C:\Tools\Scripts\golfing> .\leyland-numbers.ps1 33
178478

PS C:\Tools\Scripts\golfing> .\leyland-numbers.ps1 77
1073792449

JavaScript (Firefox 42-57), 94 bytes
n=>[for(x of Array(32).keys())for(y of Array(x+1).keys())if(y>1)x**y+y**x].sort((x,y)=>x-y)[n]

Needs Firefox 42 because it uses both array comprehensions and exponentiation ([for(..of..)] and **).

Shouldn't you just mark it as ES7?

@mbomb007 I don't think [for...of] made it to ES7.

It's part of ES6

No, that's for(..of..), not [for(..of..)].

Ah, okay. (Non-standard. Do not use.) lol

@mbomb007 Sure, but they're ideal for golfing: they combine both map and filter, they accept any iterable object, not just an array, and they support multiple loops that result in a single array.

In other words, just like any other comprehension (like Python)

Python 3, 76 69 bytes
r=range(2,32);f=lambda n:sorted({x**y+y**x for x in r for y in r})[n]

0-indexed.
https://repl.it/C2SA

It’s okay to just write your answer as r=range(2,32) lambda n:sorted(…)[n]

Jelly, 14 bytes
2 bytes thanks to Dennis.
R‘*€¹$+Z$FṢQị@

Try it online! (Takes ~ 1s for 82 for me) (O(n^2) time)
Original 16-byte answer
2r30*€¹$+Z$FṢQị@

Try it online! (Takes < 1s for me) (Constant time)

R‘*€¹$+Z$FṢQị@ is faster, shorter and has no artificial upper bound.

@Dennis and beats my answer :-P

@Dennis I don't get it. How come it is faster than the second one.

It isn't faster than the second one. The execution time is too short to get an accurate measurement.

Now 13 bytes :-P

Bash + GNU utilities, 63
printf %s\\n x={2..32}\;y={2..32}\;x^y+y^x|bc|sort -nu|sed $1!d

1-based indexing.  It looks like this is pretty much the same approach as @TimmyD's answer.  Instead of nested loops, bash brace expansion is used to generate arithmetic expressions that are piped to bc for evaluation.
Ideone.

Perl 6,  60 58  56 bytes
{sort(keys bag [X[&({$^a**$^b+$b**$a})]] (2..$_+2)xx 2)[$_]}
{sort(keys set [X[&({$^a**$^b+$b**$a})]] (2..$_+2)xx 2)[$_]}
{sort(unique [X[&({$^a**$^b+$b**$a})]] (2..$_+2)xx 2)[$_]}
{squish(sort [X[&({$^a**$^b+$b**$a})]] (2..$_+2)xx 2)[$_]}
{squish(sort [X[&({$^a**$^b+$b**$a})]] (2..31)xx 2)[$_]}
{squish(sort [X[&({$^a**$^b+$b**$a})]] 2..31,2..31)[$_]}
Test:
#! /usr/bin/env perl6
use v6.c;

my &Leyland = {squish(sort [X[&({$^a**$^b+$b**$a})]] 2..31,2..31)[$_]}

say ^14 .map: &Leyland;
time-this {Leyland 81};

sub time-this (&code) {
  my $start = now;
  my $value = code();
  printf "takes %.3f seconds to come up with $value\n", now - $start;
}

(8 17 32 54 57 100 145 177 320 368 512 593 945 1124)
takes 0.107 seconds to come up with 1996813914

Explanation:
{
  squish( # remove repeated values
    sort
      [X[&( # cross reduce with:
        { $^a ** $^b + $b ** $a }
      )]]
        ( 2 .. $_+2 ) # ｢Range.new(2,$_+2)｣ (inclusive range)
        xx 2          # repeat list
  )[$_]
}

Can't you remove the spaces between sort [ and ] 2..31?

@EʀɪᴋᴛʜᴇGᴏʟғᴇʀ That would turn it from a subroutine call sort([... to an array access of a term sort[.... A similar thing happens with the other space.

I guess there you have implemented this half-pseudo code map { $^a ** $^b + $b ** $a },  2..5,5...2
But, how could you think of constructing it that way at the first place? The cross reduce with a closure is particularly tricky. Could you give some sample invocations of that closure?

@LarsMalmsteen There are a lot of things working together there. I don't think that this is a good place to discuss this. If you post your questions to the perl6-users mailing list, I and everyone else on there would be more than happy to help you understand. I think the reason I used reduce [] was to reduce the number of spaces and parens.

Shave another 2 chars: say {squish(sort 2..31 X[&({$^a**$^b+$b**$a})]2..31)[$_]}

F#, 117, 104
Welp, it's shorter than my C# answer at least.
Saved 13 bytes thanks to Reed Copsey in the F# chatroom.
let f n=[for x in 2I..32I do for y in 2I..32I->x**(int y)+y**(int x)]|>Seq.sort|>Seq.distinct|>Seq.nth n

R, 58 54 bytes
1-indexed. Eliminated 4 bytes by using pryr::r instead of function.
unique(sort(outer(2:99,2:9,pryr::f(x^y+y^x))))[scan()]

Explanation
For all numbers from 2 to 99, and 2 to 9,
                  2:99,2:9

apply the function x^y+y^x. This generates a 98x8 matrix.
            outer(2:99,2:9,pryr::f(x^y+y^x))

Sort this matrix (coercing it to a vector):
       sort(outer(2:99,2:9,pryr::f(x^y+y^x)))

Remove all non-unique values:
unique(sort(outer(2:99,2:9,pryr::f(x^y+y^x))))

Read n from stdin, and fetch the nth number from the list:
unique(sort(outer(2:99,2:9,pryr::f(x^y+y^x))))[scan()]

Jelly, 12 bytes
‘€p`*U$§QṢị@

Try it online!
Similar algorithm to Leaky Nun's Jelly answer but with a few improvements
How it works
‘€p`*U$§QṢị@ - Main link. Takes n on the left
 €           - Yield [1, 2, ..., n]
‘            - Increment each to [2, 3, ..., n+1]
  p`         - Take the Cartesian product with itself, yielding all pairs [[2, 2], [2, 3], ..., [n+1, n+1]]
      $      - Run the previous two commands over each pair, [x, y]:
     U       -   Reverse the pair to yield [y, x]
    *        -   Raise to the power to yield [x*y, y*x]
       §     - Take the sum of each, yielding [8, 17, ..., 2(n+1)*(n+1)]]
        Q    - Deduplicate
         Ṣ   - Sort in ascending order
          ị@ - Take the nth element in this list

Haskell, 99 98 96 95 94 bytes
It is probably easily outgolfed, but that was the best I was able to come up with.
import Data.List
f n|n<2=[]|n>1=sort.nub$f(n-1)++[x^n+n^x|x<-[2..n]]
g n=(f.toInteger$n+3)!!n

import Data.List
f n|w<-[2..toEnum$n+3]=(sort$nub[x^y+y^x|x<-w,y<-w])!!n
Do you know why toInteger/toEnum is needed?

Wow, this is crazy=) Feel free to add it as your own answer, as it is qutie different from mine! If we omit toInteger in my solution we'll have an overflow using int, because we iterate way higher (to n+3 instead of n) when working with the list. Otherwise we'd need to hardcode the first four terms or so. What exactly does toEnum do in your solution?

OK, that's because of (!!) operator which binds n to an Int. Since n is supposed to be under 82, w can be replaced by [2..99] for example and f=(sort(nub[x^y+y^x|x<-[2..99],y<-[2..x]])!!) .  toEnum converts an Int to an Enum, and Integer is an instance of Enum class so toEnum here converts n+3 to an Integer.

C#, 141, 127 bytes.
Oh c#, you are such a long language.
n=>(from x in Enumerable.Range(2,32)from y in Enumerable.Range(2,32)select Math.Pow(x,y)+Math.Pow(y,x)).Distinct().ToList()[n];

This is a lambda that needs to be assigned to delegate double del(int n); to be run, as such:
delegate double del(int n);
del f=n=>(from x in Enumerable.Range(2,32)from y in Enumerable.Range(2,32)select Math.Pow(x,y)+Math.Pow(y,x)).OrderBy(q=>q).Distinct().ToList()[n];

Still shorter than Java.

@flawr Wooooooo?

I know nothing about C#, but couldn't you save Enumerable.Range( to a variable/function/iterator/whatever with a shorter name for reuisng?

I could, but then I would need to include a class and type defs, which ends up costing me a ton.

SQL (PostgreSQL 9.4), 171 bytes
Done as a prepared statement.  Generate a couple of series 2 - 99, cross join them and do the equation.  Densely rank the results to index them and select the first result that has the rank of the integer input.
prepare l(int)as select s from(select dense_rank()over(order by s)r,s from(select x^y+y^x from generate_series(2,99)x(x),generate_series(2,99)y(y))c(s))d where r=$1limit 1

Executed as follows
execute l(82)
s
-----------------
1996813914

This ended up running a lot quicker than I expected

Swift 3, 138 bytes
import Glibc;func l(n:Int)->Int{let r=stride(from:2.0,to:50,by:1);return Int(Set(r.flatMap{x in r.map{pow(x,$0)+pow($0,x)}}).sorted()[n])}

Ungolfed code
Try it here
import Glibc
func l(n: Int) -> Int {
    // Create a Double sequence from 2 to 50 (because pow requires Double)
    let r = stride(from: 2.0, to: 50.0, by: 1.0)

    return Int(Set(r.flatMap {
        x in r.map {
            pow(x, $0) + pow($0, x)
        }
    }).sorted()[n])

Welcome to Programming Puzzles and Code Golf! Nice first answer, but it'd be better if you could explain what's going on.

Java (JDK), 136 bytes
n->java.util.stream.IntStream.range(0,900).map(l->l+=Math.pow(l%30+2,l/30+2)+Math.pow(l/30+2,l%30+2)-l).sorted().distinct().toArray()[n]

Try it online!

If you start the range at 60 then l/30+2 can be l/30

J, 29 bytes
<:{[:/:~@~.@,[:(^+^~)"0/~2+i.

Uses one-based indexing. Conversion from my Mathematica solution.
The true secret here is that I have :(^+^~) on my side.
Usage
   f =: <:{[:/:~@~.@,[:(^+^~)"0/~2+i.
   f 7
145
   (,.f"0) >: i. 10  NB. Extra commands for formatting
 1   8
 2  17
 3  32
 4  54
 5  57
 6 100
 7 145
 8 177
 9 320
10 368

Explanation
<:{[:/:~@~.@,[:(^+^~)"0/~2+i.  Input: n
                         2+i.  Step one
                     "0/~      Step two
              :(^+^~)          ???
<:{[:/:~@~.@,[                 Profit

More seriously,
<:{[:/:~@~.@,[:(^+^~)"0/~2+i.  Input: n
                           i.  Create the range [0, 1, ..., n-1]
                         2+    Add 2 to each
               (^+^~)"0        Create a dyad (2 argument function) with inputs x, y
                               and returns x^y + y^x
             [:        /~      Use that function to create a table using the previous range
   [:       ,                  Flatten the table into a list
         ~.@                   Take its distinct values only
     /:~@                      Sort it in ascending order
<:                             Decrement n (since J is zero-indexed)
  {                            Select the value at index n-1 from the list and return

... Profit  :D

Axiom 148 bytes
w(n)==(v:List INT:=[];for i in 2..31 repeat for j in i..31 repeat(a:=i^j+j^i;if a>1996813914 then break;v:=cons(a,v));v:=sort v;~index?(n,v)=>0;v.n)

some example
w(n)==
 v:List INT:=[];for i in 2..31 repeat for j in i..31 repeat
        (a:=i^j+j^i;if a>1996813914 then break;v:=cons(a,v));v:=sort v;~index?(n,v)=>0
 v.n
 (2) -> [w(i)  for i in 0..85]
    Compiling function w with type NonNegativeInteger -> Integer

    (2)
    [0, 8, 17, 32, 54, 57, 100, 145, 177, 320, 368, 512, 593, 945, 1124, 1649,
     2169, 2530, 4240, 5392, 6250, 7073, 8361, 16580, 18785, 20412, 23401,
     32993, 60049, 65792, 69632, 93312, 94932, 131361, 178478, 262468, 268705,
     397585, 423393, 524649, 533169, 1048976, 1058576, 1596520, 1647086,
     1941760, 2012174, 2097593, 4194788, 4208945, 4785713, 7861953, 8389137,
     9865625, 10609137, 14352282, 16777792, 16797952, 33554432, 33555057,
     43050817, 45136576, 48989176, 61466176, 67109540, 67137425, 129145076,
     134218457, 177264449, 244389457, 268436240, 268473872, 292475249,
     364568617, 387426321, 536871753, 774840978, 1073742724, 1073792449,
     1162268326, 1173741824, 1221074418, 1996813914, 0, 0, 0]

                                                           Type: List Integer

Perl 5, 70 + 1 (-p) = 71 bytes
for$x(2..32){$r{$x**$_+$_**$x}++for$x..32}$_=(sort{$a<=>$b}keys%r)[$_]

Try it online!

Brachylog, 28 bytes
^₂g{∧{Ċ≥₁>ᵛ1&≜↔;?^ᵐ+}}ᶠ⁽o∋↙?

Try it online!
How it works
^₂g{∧{Ċ≥₁>ᵛ1&≜↔;?^ᵐ+}}ᶠ⁽o∋↙?
^₂g                           7 -> [49]
   {∧{              }}ᶠ⁽      find first 49 outputs whose …
      Ċ≥₁>ᵛ1                  inputs are of form [X,Y],
       ≥₁                     are ordered
         >ᵛ1                  and strictly greater than 1
            &≜                force labels on input
              ↔;?             [2,3] -> [[3,2],[2,3]]
                 ^ᵐ                 -> [9, 8]
                   +                -> 17
                        o∋↙?  order outputs and take the Nth element

Thunno 2, 12 bytes
R⁺2ẉıḲ*S;ṠUi

Try it online!
0-indexed.
Explanation
R⁺2ẉıḲ*S;ṠUi  # Implicit input
R⁺            # Range [2..input+1]
  2ẉ          # Cartesian power of 2
    ı   ;     # Map over each pair:
     Ḳ        #  Bifurcate: push reverse
      *       #  Exponentiation
       S      #  Sum the pair
         Ṡ    # Sort the list
          U   # And uniquify it
           i  # Index in
              # Implicit output

J, 38 31 bytes
0-indexed.

[{[:(#~~:)@/:~@,/[:(+|:)[:^/~2+i.@>:@]
((#~~:)/:~,/(+|:)^/~2+i.29x){~[

Usage
>> f =: ((#~~:)/:~,/(+|:)^/~2+i.29x){~[
>> f 81
<< 1996813914

Python 3, 129->116 bytes
I know there is a shorter python 3 answer, but I still wanted to contribute my solution.
t=[]
for k in range(100):a,b,q=k//10,k%10,a**b+b**a;f=lambda q:0if q in t else t.append(q);f(q)
print(sorted(t)[7:])

This was the best way that I could to think of to handle going through all values for x and all values for y.
If anyone can golf my approach it would be appreciated

Make t a set instead of a list, and replace the last for statements with a plain t.add(q).

Ruby, 62 58 bytes
->n{a,*b=c=2;c+=1while(b<<a**c+c**a;c<32||32>c=a+=1);b[n]}

Try it online!

This seems to be missing a number of entries, the first of which is 54

APL (Dyalog), 27 bytes
{d⊃⍨⍵⊃⍋d←∪,∘.(*⍨+*)⍨1↓⍳1+⍵}

Try it online!

Japt -g, 15 bytes
g2ôU ïÈ**Y+pXÃü

Try it
g2ôU ïÈ**Y+pXÃü
                    :Implicit input of integer U
g                   :Index into the following array
 2ôU                :  Range [2,U+2]
     ï              :  Cartesian product with itself
      È             :  Reduce each pair [X,Y]
       **Y          :    Raise X to the power of Y
          +pX       :    Add Y raised to the power of X
             Ã      :  End reduce
              ü     :  Sort & partition by value
                    :Implicit output of first element

Vyxal, 77 bitsv2, 9.625 bytes
›Ḣ:Ẋ:ReṠUsi

Try it Online!
When the program is ṠUs.
0 indexed.
Explained
›Ḣ:Ẋ:ReṠUsi
›Ḣ:Ẋ         # Cartesian product of the range [2, input + 1]
    :R       # Push a copy with each pair reversed.
      eṠ     # Zip the two lists, reduce by a ** b, and sum each pair.
        Usi  # Uniquify, sort, then get the number at the inputh index.

Created with the help of Luminespire.

source: Stack Exchange

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

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

sort: votes


text:
Golf the Sequence whose Exponential Generating Function is tangent
Almost every function can be expressed as a polynomial with infinite terms.
For example, e^x = 1 + x + x^2/2! + x^3/3! + x^4/4! + ...
For example, sin(x) = x - x^3/3! + x^5/5! - x^7/7! + ...
The coefficients of the n-th terms form a sequence, and the corresponding function is called the Generating Function of the sequence.
The coefficients of the n-th terms form a sequence.
Often, the n-th term would have a denominator of n!. Therefore, we multiply the coefficient by n! to obtain another sequence, whose Exponential Generating Function would be the original function.
For example, the sequence whose Exponential Generating Function is e^x would be 1,1,1,1,....
For example, the sequence whose Exponential Generating Function is sin(x) would be 0,1,0,-1,0,1,0,-1,....
Task
Your task is to find the n-th term of the sequence whose Exponential Generating Function is tan(x).
Testcases
n result
0 0
1 1
2 0
3 2
4 0
5 16
6 0
7 272
8 0
9 7936
10 0
11 353792
12 0
13 22368256
14 0
15 1903757312
16 0
17 209865342976
18 0
19 29088885112832
20 0
21 4951498053124096
22 0
23 1015423886506852352
24 0
25 246921480190207983616
26 0

(Copied from here.) (Warning: the 0-th term is different)
Example implementation
# copied from https://github.com/Mego/Seriously/blob/v2.0/SeriouslyCommands.py#L16
def memoized(f):
    memo = {}
    def m_fun(*args):
        if args in memo:
            return memo[args]
        else:
            res = f(*args)
            memo[args] = res
            return res
    return m_fun

# copied from https://github.com/Mego/Seriously/blob/v2.0/SeriouslyCommands.py#L169
@memoized
def binomial(n,r):
    if r > n:
        return 0
    elif r==n:
        return 1
    res = 1
    i = 1
    while i<=r:
        res *= (n+1-i)
        res /= i
        i+=1
    return int(res)

# 2*u(n+1) = Sum_{k=0..n} binomial(n, k)*u(k)*u(n-k)
# from A000111
@memoized
def u(n):
    if n<0: return 0
    if n==0: return 1
    if n==1: return 1
    return sum([binomial(n-1,k)*u(k)*u(n-1-k) for k in range(n)])//2

def t(n):
    if n%2 == 0: return 0
    return u(n)

print('\n'.join([str(x) + ' ' + str(t(x)) for x in range(26)]))

Ideone it!
References

Generating function on Wikipedia
Exponential generating function on Wikipedia
Exponential generating function example on Wikipedia
Generating function on MathWorld
Exponential generating function on MathWorld
Taylor series on Wikipedia
Derivation of first 9 terms of required sequence
Obligatory OEIS A009006 (Note that the 0-th term is different)
Algorithm
OEIS A000111: up/down numbers

If you want to learn more about generating functions and their use in math, especially combinatorics and numbertheory I highly recommend this "famous" textbook generatingfunctionology by H. Wilf.

(Can't resist): taken literally, your first sentence is extremely false!

You have your meaning of "generating function" and "exponential generating function" backwards. $\sin(x)$ is the exponential generating function of the sequence 0,1,0,-1,0,1,0,-1,0,... - it is not the sequence that is the exponential generating function of $\sin(x)$. What you are asking us to do is to code the sequence exponentially generated by $\tan(x)$.

Looks fine, except "This is also called the Generating Function of that function. The coefficients of the n-th terms form a sequence.", which should probably say something like "The coefficients of the n-th terms form a sequence, and the corresponding function is called the Generating Function of the sequence".

@GlenO Edited .

CJam (33 32 27 26 23 20 bytes)
2,{ee::*_(@+.+}ri*0=

Online demo
Dissection
This essentially implements the recurrence described by xnor.
2,        e# [0 1] represents the base case f(0,j) = j==1
{         e# Loop...
  ee::*   e#   Multiply each array element by its index
  _(@+.+  e#   Sum the array shifted left and the array shifted right
}ri*      e# ... n times
0=        e# Evaluate at j=0

Or with a rather different approach, for 23 bytes:
ri_1&a{{1$+}*]W%0+}@*0=

Online demo. Thanks to Dennis for 3 bytes.
Dissection
1a         e# Push [1]
{          e# Repeat...
  {1$+}*]  e#   Compute array of partial sums
  W%0+     e#   Reverse and append 0
}qi:A*     e# ... A times, where A is the input value
0=A1&*     e# Result is first element if A odd, and 0 otherwise

Or with a very different approach, for 29 bytes:
qie!Ma-{W\+W+3ew{_$.=1=},!},,

Online demo
Unfortunately a special case is required for input 0.
Dissection
qi            e# Take an integer n from stdin
e!            e#   Compute all permutations of [0 ... n-1]
Ma-           e#   Special-case n=0
{             e#   Filter...
  W\+W+       e#     Prepend and postpend -1
  3ew         e#     Take slices of 3 consecutive elements
  {           e#     Filter...
    _$.=1=    e#       Test whether the middle element is the second largest
  },!         e#     ... and require no matches
},,           e#   ... and count

You may be thinking "WTF?! He's answering the wrong question." If so, that's understandable, but both approaches do indeed give the correct results.

In case ot helps, the nightly build on TIO returns an empty array for [WW]3ew.

@Dennis, thanks. However, it turns out that 0 needs to be a special case anyway, because it evaluates to 1.

One would only think you are answering the wrong question if one has not even clicked on my links.

ri_1&a{{1$+}*]W%0+}@*0= saves 3 bytes.

@LeakyNun, so that would be everyone then. I saw that list of links and tl;dr.

@PeterTaylor Actually, I posted many links because I did not have an algorithm. Then, I found the algorithm but I kept the links there anyway.

Julia, 40 38 32 bytes
!n=2(2*4^n-2^n-0^n)abs(zeta(-n))

Input and output is in form of BigFloats. Try it online!
Background
The Maclaurin series of the tangent function satisfies the identity

whenever x lies in its convergence radius, where Bn is a Bernoulli number.
Since B2(n+1) and (-1)n have the same sign, B2n+1 = 0 if n > 0 and B1 = 1/2, we can rewrite the above as follows.

Furthermore, whenever n is a non-negative integer, we have

where ζ denotes the Riemann zeta function.
From this, with the convention 00 = 1, it follows that

which is the formula the implementation uses.

Python, 57 bytes
f=lambda i,j=0:~-j*f(i-1,j-1)-~j*f(i-1,j+1)if i else j==1

Less golfed:
f=lambda i,j=0:j==1 if i==0 else (j-1)*f(i-1,j-1)+(j+1)*f(i-1,j+1)

We can compute the ith coefficient of the exponential generating function by differentiating the tangent function i times and evaluating at 0. Each derivative is a polynomial in tan(x), and its value at 0 is its constant term.
We recursively express the coefficient of tan(x)**j in the ith derivative of tan with the function f(i,j). The recursive expression comes from the relation tan(x)' = 1 + tan(x)**2.
So, the derivative of tan(x)**j is
j*tan(x)**(j-1)*(tan(x)**2+1), or equivalently
j*tan(x)**(j+1) + j*tan(x)**(j-1)

So, the contributors to tan(x)**j in the ith derivative are tan(x)**(j-1) and tan(x)**(j+1) in the (i-1)st derivative, each with coefficient equal to its power. This gives the recursive expression
f(i,j) = (j-1)*f(i-1,j-1) + (j+1)*f(i-1,j+1)

Note that we don't need to exclude negative exponents j because they evaluate to zero anyway and don't contribute because crossing j=0 gives a multiplier of 0.
The base case of i==0 corresponds to tan(x) itself with j==1, and zero coefficients otherwise. The final evaluation happens at the constant term j=0, which is put in as a default value.

This ports to 20 bytes in CJam. Do you mind if I make that my primary answer, or do you want to port and post it?

You should post it, I don't know CJam.

Mathematica, 20 bytes
Tan@x~D~{x,#}/.x->0&

Straight-forward approach. Calculate the nth derivative of tan(x) and evaluate it at x = 0.
Usage

Haskell, 48 bytes
0%1=1
0%_=0
i%j=sum[k*(i-1)%k|k<-[j+1,j-1]]
(%0)

We can compute the ith coefficient of the exponential generating function by differentiating the tangent function i times and evaluating at 0. Each derivative is a polynomial in tan(x), and the value at 0 is its constant term.
We recursively express the coefficient of tan(x)^j in the ith derivative of tan with the function i%j. The recursive expression comes from the relation tan(x)' = 1 + tan(x)^2.
So, the derivative of tan(x)^j is
j*tan(x)^(j-1)*(tan(x)^2+1), or equivalently
j*tan(x)^(j+1) + j*tan(x)^(j-1)

So, the contributors to tan(x)^j in the ith derivative are tan(x)^(j-1) and tan(x)^(j+1) in the (i-1)st derivative, each with coefficient equal to its power.

Sage, 26 bytes
lambda n:tan(x).diff(n)(0)

Like the other solutions in math-oriented languages, this function computes the nth derivative of tan(x) and evaluates it at x = 0.
Try it online

Jelly, 12 11 bytes
Ṛ+\;S
ḂÇ⁸¡Ḣ

Like Peter Taylor's CJam answer, this computes the nth term of Euler's up/down sequence if n is odd and special-cases even n as 0.
Try it online! or verify all test cases.
How it works
ḂÇ⁸¡Ḣ  Main link. Argument: n

Ḃ       Bit; yield n's parity.
 Ç⁸¡    Apply the helper link (Ç) n (⁸) times.
    Ḣ   Head; retrieve the first element of the resulting list.

Ṛ+\;S   Helper link. Argument: A (list or 1/0)

Ṛ       Cast A to list (if necessary) and reverse the result.
 +\     Take the cumulative sum.
   ;S   Append the sum of A.

JavaScript (ES6), 127 45 bytes
f=(n,m=0)=>n?++m*f(--n,m--)+--m*f(n,m):m-1?0:1

Port of @xnor's solutions.

J, 15 13 bytes
There is also the builtin t: which calculates the nth coefficient of the exponential generating function of tan(x).
(1&o.%2&o.)t:

Thanks to @Leaky Nun for reminding me of Taylor series adverbs in J which saved 2 bytes.
Alternative for 15 bytes.
3 :'(3&o.d.y)0'

Another approach is to calculate the nth derivative of tan(x) and evaluate it at x = 0.
Note: In J, the amount of memory used by the derivative function d. grows quickly as n passes 10.
Usage
   f =: (1&o.%2&o.)t:
   f 7
272
   (,.f"0) i. 11  NB. Additional commands are just for formatting the output
 0    0
 1    1
 2    0
 3    2
 4    0
 5   16
 6    0
 7  272
 8    0
 9 7936
10    0

Explanation
(1&o.%2&o.)t:  Input: n
(         )    Define a monad (one argument function), call the input y
 1&o.          Get the trig function sin(x) and call it on y
      2&o.     Get the trig function cos(x) and call it on y
     %         Divide sin(y) by cos(y) to get tan(y)
           t:  Get the nth coefficient of the exponential generating series
               for that function and return

3 :'(3&o.d.y)0'  Input: n
3 :'          '  Define a monad (one argument function) with input y
     3&o.        Get the trig function tan(x)
           y     The input n
         d.      Get the nth derivative of tan(x)
             0   Evaluate the nth derivative at x = 0 and return

Julia, 39 37 bytes
!n=(spdiagm((0:n,1:n+1),(1,-1))^n)[2]

Saved 2 bytes thanks to Dennis.
Not the shortest Julia solution (see Dennis's solution), but this one is done purely using derivative logic... in the form of matrices.
Basically, it uses the fact that the derivative of tan(x) is 1+tan(x)^2. So since the derivative of any power of tan(x), say tan(x)^k, is k tan(x)^(k-1) tan(x)' = k tan(x)^(k-1) + k tan(x)^(k+1), we can use a simple matrix power on a matrix with the appropriate values to generate the expansion, with the second row or column (depending on construction) holding the derivatives of tan(x) itself.
So we just need to find the constant in the resulting expression, and that's the first value in the corresponding row or column.

!n=(spdiagm((0:n,1:n+1),(1,-1))^n)[2] should work.

@Dennis - nice catch. Didn't realise spdiagm would allow that style of construction - tried it with diagm, but of course it didn't work.

Haskell, 95 93 bytes
p=product
f n=sum[(-1)^(n`div`2+j+1)*j^n*p[k-j+1..n+1]`div`p[1..n+1-k+j]|k<-[1..n],j<-[0..k]]

It is basically an implementation of the general formula with some minor optimizations.

MATLAB with Symbolic Toolbox, 84 bytes
n=input('');syms x;c=coeffs(taylor(tan(x),'Order',n+1))*factorial(n);c(end)*mod(n,2)

Example runs:
>> n=input('');syms x;c=coeffs(taylor(tan(x),'Order',n+1))*factorial(n);c(end)*mod(n,2)
7
ans =
272

>> n=input('');syms x;c=coeffs(taylor(tan(x),'Order',n+1))*factorial(n);c(end)*mod(n,2)
8
ans =
0

>> n=input('');syms x;c=coeffs(taylor(tan(x),'Order',n+1))*factorial(n);c(end)*mod(n,2)
9
ans =
7936

Haskell (too many bytes)
Using only operations on lists and Raymond Manzoni's result:
c n = last $ map numerator $ zipWith (*) (scanl (*) (1) [2,3..]) (intersperse 0 $ foldr (.) id (replicate n (\xs->(xs ++ [(1%(1+2*length xs)) * (sum (zipWith (*) xs (reverse xs)))]))) [1])

Unfortunately, this overflows for modest values of n, as it uses Int values. I will try to fix the problem using Integervalues. Until then, suggestions are welcome.

Axiom, 46 bytes
f(n:NNI):NNI==(n=0=>0;eval(D(tan(x),x,n),x=0))

code for test and results
(32) -> [[i, f(i)] for i in 0..26]
   (32)
   [[0,0], [1,1], [2,0], [3,2], [4,0], [5,16], [6,0], [7,272], [8,0], [9,7936],
    [10,0], [11,353792], [12,0], [13,22368256], [14,0], [15,1903757312],
    [16,0], [17,209865342976], [18,0], [19,29088885112832], [20,0],
    [21,4951498053124096], [22,0], [23,1015423886506852352], [24,0],
    [25,246921480190207983616], [26,0]]
                                       Type: List List NonNegativeInteger

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/


text:
Golf the Inverse of Exponential Generating Function
Earlier, we talked about exponential generating functions (e.g.f.).
Task
You will take a few terms of a sequence.
Your task is to find another sequence with that many terms, whose e.g.f., when multiplied to the original e.g.f., would be exactly the constant function 1 accurate to that many terms.
That is, given a0=1, a1, a2, ..., an, find b0=1, b1, b2, ..., bn such that a0 + a1x + a2x^2/2! + a3x^3/3! + ... + anx^n/n! multiplied by b0 + b1x + b2x^2/2! + b3x^3/3! + ... + bnx^n/n! equals 1 + O(x^(n+1)).
Specs

They will start at the zeroth power and will be consecutive.
The first term is guaranteed to be 1.
All the terms are guaranteed to be integers.
There will not be negative powers.

Testcases
Input : 1,0,-1,0,1,0,-1,0 (this is actually cos x)
Output: 1,0, 1,0,5,0,61,0 (this is actually sec x)

Input : 1, 2, 4, 8, 16, 32 (e^(2x))
Output: 1,-2, 4,-8, 16,-32 (e^(-2x))

Input : 1,-1,0,0, 0,  0,  0 (1-x)
Output: 1, 1,2,6,24,120,720 (1/(1-x) = 1+x+x^2+...)

When titling your next challenge, you may want to think about this http://meta.codegolf.stackexchange.com/a/8090/15599

Thank you! I have edited it away! I will bear that in mind next time!

Does the guarantee about integer coefficients apply only to the input, or to both input and output?

@feersum If the input has integer coefficients, then the output will also have integer coefficients.

Example implementation given by Sp3000.

Borderline duplicate

@PeterTaylor How is that a duplicate at all?

Seriously? They're both polynomial division. To make it an exact duplicate you just have to add in the factorial weights and get the same endianness by transforming p(x) = sum_i a_i x^i to p'(x) = x^n p(x^-1) (i.e. reversing the input list of coefficients).

@PeterTaylor - it's not at all a duplicate. The processes are completely different, especially when you factor in that it's being done with exponential generating function format. It's not p(x)=sum_i a_i x^i, it's p(x)=sum_i a_i x^i/i!, and that changes the challenge quite significantly.

Julia, 91 81 77 bytes
!v=(b=[1;0v[r=2:end]];for i=r,j=0:i-2 b[i]-=binomial(i-1,j)v[i-j]b[j+1]end;b)

Usage: ![1 0 -1 0 1 0 -1 0]
Saved 4 bytes thanks to Dennis!
This is a fairly straightforward implementation - it uses the fact that the "exponential" part causes a binomial to appear in the solution. Otherwise, it's just solving for the relevant coefficients.

!v=(b=[1;0v[r=2:end]];for i=r,j=0:i-2 b[i]-=binomial(i-1,j)v[i-j]b[j+1]end;b) saves 4 bytes.

Thanks, Dennis. I was using v[n=end] earlier to grab the length, but didn't think to use a full range like that.

I think that this answer contradicts your comment that "the processes are completely different".