Prime number generating function as product expansion
I am interested in prime number generating function.
$$f(x)=1+\sum \limits_{k=1}^\infty p_{k}x^k=1+2x+3x^2+5x^3+7x^4+11x^5+....$$
I would like to find the function as product expansion and to check the pattern of coefficients. I have found a few terms as shown below.
$$f(x)=\prod\limits_{n=1}^{ \infty } (1+a_n x^n)=(1+2x)(1+3x^2)(1-x^3)(1+9x^4)(1-4x^5)...$$
Is there a method to find $a_n$ and to check if a pattern seen?
EDIT: I would like to share how I found the first 4 terms in product expansion.
$$ (1+2x)(1+3x^2)=1+2x+3x^2+6x^3$$
$$ (1+2x)(1+3x^2)(1+a_3x^3)=(1+2x+3x^2+6x^3)(1+a_3x^3)=$$ $$ =(1+2x+3x^2+6x^3+a_3x^3+2a_3x^4+3a_3x^5+6a_3x^6)$$
check $x^3$ term in $f(x)$ , $a_3+6=5$ then $a_3=-1$
Now we have
$$ (1+2x)(1+3x^2)(1-x^3)(1+a_4x^4)=(1+2x+3x^2+5x^3-2x^4-3x^5-6x^6)(1+a_4x^4)=$$
$$ (1+2x+3x^2+5x^3-2x^4-3x^5-6x^6+a_4x^4+2a_4x^5+3a_4x^6+5a_4x^7-2a_4x^8-3a_4x^9-6a_4x^{10})=$$
check $x^4$ term in $f(x)$ , $a_4-2=7$ then $a_4=9$
EDIT: Thanks to Raymond Manzoni for the link to show first 34 terms (here)
$a_n : (2, 3, -1, 9, -4, 0, -16, 89, -52, 60, -182, 214, -620, 966, -2142, 10497, -7676, 13684, -27530, 48288, -98372, 190928, -364464, 619496, -1341508, 2649990, -4923220, 9726940, -18510902, 37055004, -69269976, 213062855, -258284232, 527143794 , ....)$
Here the graphs of $a_n$
Thanks for answers
Solution 1:
I've done a similar thing with the power series for the exponential function. I found it helpful to express things using the logarithm of the function - mostly because $\small \log((1+ax)(1+bx^2)(1+cx^3)...)$ converts into a sum of formal power series, and that sum can then be compared with the log of the formal powers series of the function.
Here is
$ \displaystyle
\qquad \log(f(x)) = \log( 1+2x+3x^2+5x^3+7x^4+11x^5+...) \\
\qquad \log(f(x)) = 2x + 1x^2 + 5/3x^3 + 1/2x^4 + 12/5x^5 - 13/6x^6 + 16/7x^7 - 15/4x^8 + \ldots $
and this must then equal the log of the function expressed as infinite products (each log of one parenthese populates one row)
$\qquad \displaystyle \small \begin{array} {rrrrrrr} \log(g(x)) = & ax &- a^2/2x^2 &+ a^3/3x^3 &- a^4/4x^4 &+ a^5/5x^5 &- a^6/6x^6 & \ldots \\ & &+ bx^2 & &- b^2/2x^4 & & + b^3/3x^6 &\ldots \\ & & &+ cx^3 & & & - c^2/2x^6 & \ldots \\ & & & &+ dx^4 & & & \ldots \\ & & & & &+ ex^5 & & \ldots \\ & & & & & & +fx^6 & \ldots \\ & & \ldots \\ \hline \\ =\log(f(x))= &2x &+ 1x^2 &+ 5/3x^3 &+ 1/2x^4 &+ 12/5x^5 &- 13/6x^6 & \ldots \end{array}$
$\qquad \qquad \qquad $*(where $g(x)$ means the product-representation of $f(x)$)*
and this can be solved recursively, beginning $a=2$, $b=1+a^2/2=3$ and so on.
[update] : I'm just finding a nice observation: that scheme of composition of the logarithmized terms seems to allow to prove, that the resulting coefficients are integer: that occurs because at the k 'th exponent of x the denominators of the summands in the k 'th column are all divisors of k, so the new coefficients can always be found as integers.
A searchable term for google comes from this small excerpt from my small treatize:
H. Gingold/A. Knopfmacher in "Analytic Properties of Power Product Expansions" (1995) this idea "appears to have first been studied in the 1930's by Ritt [R] and Feld [F].
A Pari/GP-routine gives
{ prodcoeffs(f,dim=64) = local(logf,logfcoeffs,prdfcoeffs,a,lc);
logf = log(f) ;
logfcoeffs = polcoeffs(logf,dim) ; \\"polcoeffs" - returns the pol-coeffs
\\ as a vector containing all of them
prdfcoeffs = vectorv(dim);
for(c=1,dim-1,
prdfcoeffs[1+c]= a =logfcoeffs[1+c];
lc=0;forstep(k=c,dim-1,c,lc++;logfcoeffs[1+k]-= -(-a)^lc/lc );
);
return(prdfcoeffs);}
print (prodcoeffs(Ser([1,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53]),16))
[0, 2, 3, -1, 9, -4, 0, -16, 89, -52, 60, -182, 214, -620, 966, -2142]~