login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A305871
-1 + Product_{n>=1} (1 + x^n)^a(n) = g.f. of A000040 (prime numbers).
7
2, 2, 1, 2, 2, -2, 2, -2, 4, -1, 4, -7, 10, -19, 20, -20, 34, -42, 64, -100, 126, -178, 258, -326, 464, -675, 936, -1371, 1888, -2550, 3690, -5208, 7292, -10467, 14742, -20808, 29610, -41586, 59052, -84438, 119602, -170153, 242256, -343534, 489550, -697815
OFFSET
1,1
COMMENTS
Inverse weigh transform of A000040.
LINKS
N. J. A. Sloane, Transforms
FORMULA
Product_{n>=1} (1 + x^n)^a(n) = 1 + Sum_{k>=1} prime(k)*x^k.
EXAMPLE
(1 + x)^2 * (1 + x^2)^2 * (1 + x^3) * (1 + x^4)^2 * (1 + x^5)^2 * (1 + x^6)^(-2) * ... * (1 + x^n)^a(n) * ... = 1 + 2*x + 3*x^2 + 5*x^3 + 7*x^4 + 11*x^5 + 13*x^6 + ... + A000040(k)*x^k + ...
MAPLE
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
add(binomial(a(i), j)*b(n-i*j, i-1), j=0..n/i)))
end:
a:= proc(n) option remember; ithprime(n)-b(n, n-1) end:
seq(a(n), n=1..50); # Alois P. Heinz, Jun 13 2018
MATHEMATICA
b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0,
Sum[Binomial[a[i], j]*b[n - i*j, i - 1], {j, 0, n/i}]]];
a[n_] := a[n] = Prime[n] - b[n, n - 1];
Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Feb 18 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
sign
AUTHOR
Ilya Gutkovskiy, Jun 12 2018
STATUS
approved