A121303 Triangle read by rows: T(n,k) is the number of compositions of n into k primes (i.e., ordered sequences of k primes having sum n; n>=2, k>=1).
1, 1, 0, 1, 1, 2, 0, 1, 1, 1, 2, 3, 0, 2, 3, 1, 0, 2, 4, 4, 0, 3, 6, 6, 1, 1, 0, 6, 8, 5, 0, 2, 9, 13, 10, 1, 1, 2, 6, 16, 15, 6, 0, 3, 6, 22, 25, 15, 1, 0, 2, 10, 24, 36, 26, 7, 0, 4, 9, 22, 50, 45, 21, 1, 1, 0, 12, 32, 65, 72, 42, 8, 0, 4, 12, 34, 70, 106, 77, 28, 1, 1, 2, 12, 40, 90, 150
Offset: 2
Examples
T(9,3) = 4 because we have [2,2,5], [2,5,2], [5,2,2] and [3,3,3]. Triangle starts: 1; 1; 0, 1; 1, 2; 0, 1, 1; 1, 2, 3; 0, 2, 3, 1; 0, 2, 4, 4; ...
Links
- Alois P. Heinz, Rows n = 2..200, flattened
Programs
-
Maple
G:=1/(1-t*sum(z^ithprime(i),i=1..30))-1: Gser:=simplify(series(G,z=0,25)): for n from 2 to 21 do P[n]:=sort(coeff(Gser,z,n)) od: for n from 2 to 21 do seq(coeff(P[n],t,j),j=1..floor(n/2)) od; # yields sequence in triangular form # second Maple program: with(numtheory): b:= proc(n) option remember; local j; if n=0 then [1] else []; for j to pi(n) do zip((x, y)->x+y, %, [0, b(n-ithprime(j))[]], 0) od; % fi end: T:= n-> subsop(1=NULL, b(n))[]: seq(T(n), n=2..20); # Alois P. Heinz, May 23 2013
-
Mathematica
nn=20;a[x_]:=Sum[x^Prime[n],{n,1,nn}];CoefficientList[Series[1/(1-y a[x]),{x,0,nn}],{x,y}]//Grid (* Geoffrey Critzer, Nov 08 2013 *)
Formula
G.f.: 1/(1 - t*Sum_{i>=1} z^prime(i)).
Comments