[updated]
Jay,
I give a short list of the used matrices. I'm preparing a code-pad for Pari/gp with which you may then experiment with these matrices. Perhaps tomorrow or friday.
In general
V(x)~ = [1,x,x^2,x^3,...]
A prefix d declares this as diagonalmatrix
So, for instance
V(2)~ = [1,2,4,8,16,...]
F = [0!,1!,2!,...], dF arranges this as diagonal dF^-1 contains the reciprocals (to construct the exponential-series, for instance)
P (binomialmatrix)
\( \hspace{24}
\begin{matrix} {rrrrr}
1 & . & . & . & . & . \\
1 & 1 & . & . & . & . \\
1 & 2 & 1 & . & . & . \\
1 & 3 & 3 & 1 & . & . \\
1 & 4 & 6 & 4 & 1 & . \\
1 & 5 & 10 & 10 & 5 & 1
\end{matrix} \)
Two properties of this matrix are important here.
1) Application of the binomial-rules, when postmutiplied by a formal powerseries
\( \hspace{24}
P * V(x) = V(x+1) \\
P^m * V(x) = V(x + m) \)
2) Derivatives
\( \hspace{24}
V(x)\sim * P = Y\sim \)
Y contains then scaled derivatives for \( \hspace{24} f(x)= sum(k=0,inf,x^k) \)
St2
tirling kind 2, version 1 (Abramowitsch&Stegun)
\( \hspace{24}
\begin{matrix} {rrrrr}
1 & . & . & . & . & . \\
1 & 1 & . & . & . & . \\
1 & 3 & 1 & . & . & . \\
1 & 7 & 6 & 1 & . & . \\
1 & 15 & 25 & 10 & 1 & . \\
1 & 31 & 90 & 65 & 15 & 1
\end{matrix} \)
St2
tirling kind 2, version 2, Wikipedia
\( \hspace{24}
\begin{matrix} {rrrrr}
1 & . & . & . & . & . \\
0 & 1 & . & . & . & . \\
0 & 1 & 1 & . & . & . \\
0 & 1 & 3 & 1 & . & . \\
0 & 1 & 7 & 6 & 1 & . \\
0 & 1 & 15 & 25 & 10 & 1
\end{matrix} \)
I use this version here
S2 : factorial scaled version of St2: dF^-1 * St2 * dF
\( \hspace{24}
\begin{matrix} {rrrrr}
1 & . & . & . & . & . \\
0 & 1 & . & . & . & . \\
0 & 1/2 & 1 & . & . & . \\
0 & 1/6 & 1 & 1 & . & . \\
0 & 1/24 & 7/12 & 3/2 & 1 & . \\
0 & 1/120 & 1/4 & 5/4 & 2 & 1
\end{matrix} \)
This version performs U-exponentiation for a powerseries
V(x)~ * S2 = V(exp(x)-1)~
(see Abramowitsch & Stegun)
Since Input and output are of the form of a powerseries, one can iterate to implement the "x-> (exp(x)-1)"" - iteration
St1 : Stirlingnumbers 1'st kind = inverse of St2
\( \hspace{24}
\begin{matrix} {rrrrr}
1 & . & . & . & . & . \\
0 & 1 & . & . & . & . \\
0 & -1 & 1 & . & . & . \\
0 & 2 & -3 & 1 & . & . \\
0 & -6 & 11 & -6 & 1 & . \\
0 & 24 & -50 & 35 & -10 & 1
\end{matrix} \)
S1 : factorial scaled St1, inverse of S2
\( \hspace{24}
\begin{matrix} {rrrrr}
1 & . & . & . & . & . \\
0 & 1 & . & . & . & . \\
0 & -1/2 & 1 & . & . & . \\
0 & 1/3 & -1 & 1 & . & . \\
0 & -1/4 & 11/12 & -3/2 & 1 & . \\
0 & 1/5 & -5/6 & 7/4 & -2 & 1
\end{matrix} \)
V(x)~ * S1 = V(log(1+x))~
Since this is the inverse of S2, it performs x->log(1+x), and since Input and Output are of the form of a powerseries, this can be iterated
(See also A&S)
B : my base-matrix for T-iteration
\( \hspace{24}
\begin{matrix} {rrrrr}
1 & 1 & 1 & 1 & 1 & 1 \\
0 & 1 & 2 & 3 & 4 & 5 \\
0 & 1/2 & 2 & 9/2 & 8 & 25/2 \\
0 & 1/6 & 4/3 & 9/2 & 32/3 & 125/6 \\
0 & 1/24 & 2/3 & 27/8 & 32/3 & 625/24 \\
0 & 1/120 & 4/15 & 81/40 & 128/15 & 625/24
\end{matrix} \)
This matrix can be understood in two ways:
As
\( \hspace{24}
B= matrix(r,c,c^r/r!) = dF^{-1} * matrix(c^r) = dF^{-1} * VZ \)
just the same way as in your code-snippet
Or
\( \hspace{24}
B = S2 * P\sim
\)
Application is
\( \hspace{24}
V(x)\sim * B = V(e^x)\sim
\)
and since input and output are of the form of powerseries, this can be iterated.
Note that since B = S2 * P~ we have, that
V(x)~ * S2 = V(e^x-1)~
and (see binomial-rules using P -transposed as above))
V(e^x-1)~ * P~ = V((e^x-1)+1)~ = V(e^x)~
we have
V(x)~ * S2 * P~ = V(e^x-1)~ *P~ = V(e^x)~
which is the same as
V(x)~ * B = V(e^x)~
To apply another base s, different from e, such that s<>e, this matrix must be premultiplied by powers of logarithms of s. I use lambda here for brevity. The decomposed description
Bs
\( \hspace{24}
\begin{matrix} {rrrrr}
0^0/0!*\lambda^0 & 1^0/0!*\lambda^0 & 2^0/0!*\lambda^0 & 3^0/0!*\lambda^0 & 4^0/0!*\lambda^0 & 5^0/0!*\lambda^0 \\
0^1/1!*\lambda^1 & 1^1/1!*\lambda^1 & 2^1/1!*\lambda^1 & 3^1/1!*\lambda^1 & 4^1/1!*\lambda^1 & 5^1/1!*\lambda^1 \\
0^2/2!*\lambda^2 & 1^2/2!*\lambda^2 & 2^2/2!*\lambda^2 & 3^2/2!*\lambda^2 & 4^2/2!*\lambda^2 & 5^2/2!*\lambda^2 \\
0^3/3!*\lambda^3 & 1^3/3!*\lambda^3 & 2^3/3!*\lambda^3 & 3^3/3!*\lambda^3 & 4^3/3!*\lambda^3 & 5^3/3!*\lambda^3 \\
0^4/4!*\lambda^4 & 1^4/4!*\lambda^4 & 2^4/4!*\lambda^4 & 3^4/4!*\lambda^4 & 4^4/4!*\lambda^4 & 5^4/4!*\lambda^4 \\
0^5/5!*\lambda^5 & 1^5/5!*\lambda^5 & 2^5/5!*\lambda^5 & 3^5/5!*\lambda^5 & 4^5/5!*\lambda^5 & 5^5/5!*\lambda^5
\end{matrix} \)
Application is
\( \hspace{24}
V(x)\sim * dV(\log(s))*B = V(s^x)\sim
\)
and since input and output are of the form of powerseries, this can be iterated.
Bs numerically
\( \hspace{24}
\begin{matrix} {rrrrr}
1 & 1 & 1 & 1 & 1 & 1 \\
0 & \lambda & 2*\lambda & 3*\lambda & 4*\lambda & 5*\lambda \\
0 & 1/2*\lambda^2 & 2*\lambda^2 & 9/2*\lambda^2 & 8*\lambda^2 & 25/2*\lambda^2 \\
0 & 1/6*\lambda^3 & 4/3*\lambda^3 & 9/2*\lambda^3 & 32/3*\lambda^3 & 125/6*\lambda^3 \\
0 & 1/24*\lambda^4 & 2/3*\lambda^4 & 27/8*\lambda^4 & 32/3*\lambda^4 & 625/24*\lambda^4 \\
0 & 1/120*\lambda^5 & 4/15*\lambda^5 & 81/40*\lambda^5 & 128/15*\lambda^5 & 625/24*\lambda^5
\end{matrix} \)
The terms, that you use can -if at all- mostly be found in the second-column of the matrices or result, since you need only the final scalar result, and not the additional powers, which occur in the next coumns.
So much for short
Gottfried
jaydfox Wrote:Gottfried, I must admit that I haven't put enough study into your matrix methods, having focussed all my attention on Andrew's solution.
Can you point me to a discussion that mentions how to compute the coefficients of S2, P, etc., so that I can be sure I'm looking at the right matrices? If there is a relationship between your matrices and the ones I'm using, I'd like to understand it.
Jay,
I give a short list of the used matrices. I'm preparing a code-pad for Pari/gp with which you may then experiment with these matrices. Perhaps tomorrow or friday.
In general
V(x)~ = [1,x,x^2,x^3,...]
A prefix d declares this as diagonalmatrix
So, for instance
V(2)~ = [1,2,4,8,16,...]
F = [0!,1!,2!,...], dF arranges this as diagonal dF^-1 contains the reciprocals (to construct the exponential-series, for instance)
P (binomialmatrix)
\( \hspace{24}
\begin{matrix} {rrrrr}
1 & . & . & . & . & . \\
1 & 1 & . & . & . & . \\
1 & 2 & 1 & . & . & . \\
1 & 3 & 3 & 1 & . & . \\
1 & 4 & 6 & 4 & 1 & . \\
1 & 5 & 10 & 10 & 5 & 1
\end{matrix} \)
Two properties of this matrix are important here.
1) Application of the binomial-rules, when postmutiplied by a formal powerseries
\( \hspace{24}
P * V(x) = V(x+1) \\
P^m * V(x) = V(x + m) \)
2) Derivatives
\( \hspace{24}
V(x)\sim * P = Y\sim \)
Y contains then scaled derivatives for \( \hspace{24} f(x)= sum(k=0,inf,x^k) \)
St2
tirling kind 2, version 1 (Abramowitsch&Stegun)\( \hspace{24}
\begin{matrix} {rrrrr}
1 & . & . & . & . & . \\
1 & 1 & . & . & . & . \\
1 & 3 & 1 & . & . & . \\
1 & 7 & 6 & 1 & . & . \\
1 & 15 & 25 & 10 & 1 & . \\
1 & 31 & 90 & 65 & 15 & 1
\end{matrix} \)
St2
tirling kind 2, version 2, Wikipedia\( \hspace{24}
\begin{matrix} {rrrrr}
1 & . & . & . & . & . \\
0 & 1 & . & . & . & . \\
0 & 1 & 1 & . & . & . \\
0 & 1 & 3 & 1 & . & . \\
0 & 1 & 7 & 6 & 1 & . \\
0 & 1 & 15 & 25 & 10 & 1
\end{matrix} \)
I use this version here
S2 : factorial scaled version of St2: dF^-1 * St2 * dF
\( \hspace{24}
\begin{matrix} {rrrrr}
1 & . & . & . & . & . \\
0 & 1 & . & . & . & . \\
0 & 1/2 & 1 & . & . & . \\
0 & 1/6 & 1 & 1 & . & . \\
0 & 1/24 & 7/12 & 3/2 & 1 & . \\
0 & 1/120 & 1/4 & 5/4 & 2 & 1
\end{matrix} \)
This version performs U-exponentiation for a powerseries
V(x)~ * S2 = V(exp(x)-1)~
(see Abramowitsch & Stegun)
Since Input and output are of the form of a powerseries, one can iterate to implement the "x-> (exp(x)-1)"" - iteration
St1 : Stirlingnumbers 1'st kind = inverse of St2
\( \hspace{24}
\begin{matrix} {rrrrr}
1 & . & . & . & . & . \\
0 & 1 & . & . & . & . \\
0 & -1 & 1 & . & . & . \\
0 & 2 & -3 & 1 & . & . \\
0 & -6 & 11 & -6 & 1 & . \\
0 & 24 & -50 & 35 & -10 & 1
\end{matrix} \)
S1 : factorial scaled St1, inverse of S2
\( \hspace{24}
\begin{matrix} {rrrrr}
1 & . & . & . & . & . \\
0 & 1 & . & . & . & . \\
0 & -1/2 & 1 & . & . & . \\
0 & 1/3 & -1 & 1 & . & . \\
0 & -1/4 & 11/12 & -3/2 & 1 & . \\
0 & 1/5 & -5/6 & 7/4 & -2 & 1
\end{matrix} \)
V(x)~ * S1 = V(log(1+x))~
Since this is the inverse of S2, it performs x->log(1+x), and since Input and Output are of the form of a powerseries, this can be iterated
(See also A&S)
B : my base-matrix for T-iteration
\( \hspace{24}
\begin{matrix} {rrrrr}
1 & 1 & 1 & 1 & 1 & 1 \\
0 & 1 & 2 & 3 & 4 & 5 \\
0 & 1/2 & 2 & 9/2 & 8 & 25/2 \\
0 & 1/6 & 4/3 & 9/2 & 32/3 & 125/6 \\
0 & 1/24 & 2/3 & 27/8 & 32/3 & 625/24 \\
0 & 1/120 & 4/15 & 81/40 & 128/15 & 625/24
\end{matrix} \)
This matrix can be understood in two ways:
As
\( \hspace{24}
B= matrix(r,c,c^r/r!) = dF^{-1} * matrix(c^r) = dF^{-1} * VZ \)
just the same way as in your code-snippet
Or
\( \hspace{24}
B = S2 * P\sim
\)
Application is
\( \hspace{24}
V(x)\sim * B = V(e^x)\sim
\)
and since input and output are of the form of powerseries, this can be iterated.
Note that since B = S2 * P~ we have, that
V(x)~ * S2 = V(e^x-1)~
and (see binomial-rules using P -transposed as above))
V(e^x-1)~ * P~ = V((e^x-1)+1)~ = V(e^x)~
we have
V(x)~ * S2 * P~ = V(e^x-1)~ *P~ = V(e^x)~
which is the same as
V(x)~ * B = V(e^x)~
To apply another base s, different from e, such that s<>e, this matrix must be premultiplied by powers of logarithms of s. I use lambda here for brevity. The decomposed description
Bs
\( \hspace{24}
\begin{matrix} {rrrrr}
0^0/0!*\lambda^0 & 1^0/0!*\lambda^0 & 2^0/0!*\lambda^0 & 3^0/0!*\lambda^0 & 4^0/0!*\lambda^0 & 5^0/0!*\lambda^0 \\
0^1/1!*\lambda^1 & 1^1/1!*\lambda^1 & 2^1/1!*\lambda^1 & 3^1/1!*\lambda^1 & 4^1/1!*\lambda^1 & 5^1/1!*\lambda^1 \\
0^2/2!*\lambda^2 & 1^2/2!*\lambda^2 & 2^2/2!*\lambda^2 & 3^2/2!*\lambda^2 & 4^2/2!*\lambda^2 & 5^2/2!*\lambda^2 \\
0^3/3!*\lambda^3 & 1^3/3!*\lambda^3 & 2^3/3!*\lambda^3 & 3^3/3!*\lambda^3 & 4^3/3!*\lambda^3 & 5^3/3!*\lambda^3 \\
0^4/4!*\lambda^4 & 1^4/4!*\lambda^4 & 2^4/4!*\lambda^4 & 3^4/4!*\lambda^4 & 4^4/4!*\lambda^4 & 5^4/4!*\lambda^4 \\
0^5/5!*\lambda^5 & 1^5/5!*\lambda^5 & 2^5/5!*\lambda^5 & 3^5/5!*\lambda^5 & 4^5/5!*\lambda^5 & 5^5/5!*\lambda^5
\end{matrix} \)
Application is
\( \hspace{24}
V(x)\sim * dV(\log(s))*B = V(s^x)\sim
\)
and since input and output are of the form of powerseries, this can be iterated.
Bs numerically
\( \hspace{24}
\begin{matrix} {rrrrr}
1 & 1 & 1 & 1 & 1 & 1 \\
0 & \lambda & 2*\lambda & 3*\lambda & 4*\lambda & 5*\lambda \\
0 & 1/2*\lambda^2 & 2*\lambda^2 & 9/2*\lambda^2 & 8*\lambda^2 & 25/2*\lambda^2 \\
0 & 1/6*\lambda^3 & 4/3*\lambda^3 & 9/2*\lambda^3 & 32/3*\lambda^3 & 125/6*\lambda^3 \\
0 & 1/24*\lambda^4 & 2/3*\lambda^4 & 27/8*\lambda^4 & 32/3*\lambda^4 & 625/24*\lambda^4 \\
0 & 1/120*\lambda^5 & 4/15*\lambda^5 & 81/40*\lambda^5 & 128/15*\lambda^5 & 625/24*\lambda^5
\end{matrix} \)
The terms, that you use can -if at all- mostly be found in the second-column of the matrices or result, since you need only the final scalar result, and not the additional powers, which occur in the next coumns.
So much for short
Gottfried
Gottfried Helms, Kassel

