The obvious order to tabulate coefficients of a bilateral series:
In[744]:= Riffle[1 - #, #] &@Range@5
Out[744]= {0, 1, -1, 2, -2, 3, -3, 4, -4, 5}
In[745]:= FindSequenceFunction@%
Out[745]= 1/4 (-1)^#1 (-1 + (-1)^#1 + 2 #1) &
In[746]:= LeafCount@%
Out[746]= 19
(Codegolfers: Do it in 13.)
But where in my Fourier table is the, say, -13th harmonic? I.e., what is
Out[747]= InverseFunction[1/4 (-1)^#1 (-1 + (-1)^#1 + 2 #1) &]
? Mathematica left it unsolved. Try it at 2:
In[748]:= %@2 // N
Out[748]= -41.98942986800845 - 1.414587830424065 I
And I am the Virgin Mary.
The fancy, ordered-pairs version of FindSequenceFunction failed also.
It is a nice little puzzle to find a terse expression for this function.
But further spazzing with Mathematica turned up the weird identity
<terse expression> =
In[741]:= 1/2 - I ProductLog[Abs@#, (2 # - 1/2) π]/π &
In[742]:= N[% /@ {0, 1, -1, 2, -2, 3, -3, 4, -4}] // Chop // Rationalize
Out[742]= {1, 2, 3, 4, 5, 6, 7, 8, 9}
This uses non-obvious(?) properties of ProductLog:
1/2 - (I ProductLog[k, -(1/2) (1 - 4 k) π])/π == 2 k
(Positive integer k)
1/2 - (I ProductLog[k, -(1/2) (1 + 4 k) π])/π == 1 + 2 k
(Integer k)
(π - 2 I ProductLog[-k, -(1/2) (1 + 4 (-1 + k)) π])/(2 π) == 2 - 2 k
(Positive integer k)
--rwg