A pattern of large prime numbers appeared where I was not expecting one, and I'm fascinated to know why. I needed to calculate the Taylor Series for
$$f(x)\equiv\ln\left(e^{(x+1)^{2}}+e^{(x-1)^{2}}\right)$$
Because the function is even, the odd derivatives wrt x are obviously zero. But the even derivatives all have the form of $2^n *$(several large primes). For example:
$\left(\frac{d^{20}f}{dx^{20}}\right)_{x=0}=2^{37}*31*41*283*617$
$\left(\frac{d^{50}f}{dx^{50}}\right)_{x=0}=2^{98}*31*251*601*1801*4051*417202699*47464429777438199$
$\left(\frac{d^{100}f}{dx^{100}}\right)_{x=0}=2^{197}*31*41*251*263*379*601*1801*4051*8101*268501*28717943*65677171692755556482181133*503175397608024323584539371320514986481668897$
The powers of 2 are almost but not quite monotonically increasing, and the large primes are widely spaced but certain ones appear often, like 1801 and 4051 in the examples above.
I realize this is a vague question, but I'm perplexed as to why a pattern of primes like this would appear. Any ideas?
Here is some Mathematica code to generate the results. It's not great MMa code because I wrote it to be readable to non-users of MMa.
ord = 25; (* Number of even derivatives to calculate *)
f[x] := Exp[(x + 1)^2] + Exp[(x - 1)^2];
deriv = Table[0, {j, 1, ord}]; (* Initialize an empty table *)
deriv[[1]] = D[Log[f[x]], {x, 2}];
Do[deriv[[j]] = D[deriv[[j - 1]], {x, 2}] // Together, {j, 2, ord}]; (* Calc the derivatives *)
coef = deriv /. x -> 0; (* Evaluate the derivatives at x=0 *)
factors = Table[FactorInteger[Abs[coef[[i]]]], {i, 1, ord}]; (* Prime-factorize all the coefs *)
Do[Print[2*i, "th deriv = ", Abs[coef[[i]]], " -> ", factors[[i]]], {i, 1, Length[coef]}];
See OEIS sequence A000182. There are a number of interesting patterns. For odd primes $p$ it appears that (the signed version) $a(n)$ is periodic mod $p$ with period $(p-1)/2$. If so, then e.g. none of these numbers $a(n)$ are divisible by $3, 5, 7, 11, 13, 19, 23$ or $29$, but $a(n)$ is divisible by $17$ iff $n$ is divisible by $4$ but not by $8$, and by by $31$ if $n$ is divisible by $5$ but not by $15$.
I suspect these can be deduced from the recurrence relation $$a(n) = (-1)^{n-1}+\sum_{i=1}^{n-1}(-1)^{n-i+1}{2 n-1 \choose 2 i-1} a(i)$$