

A357368


Triangle read by rows. Convolution triangle of the prime indicator sequence A089026.


63



1, 0, 1, 0, 2, 1, 0, 3, 4, 1, 0, 1, 10, 6, 1, 0, 5, 14, 21, 8, 1, 0, 1, 23, 47, 36, 10, 1, 0, 7, 28, 90, 108, 55, 12, 1, 0, 1, 49, 147, 258, 205, 78, 14, 1, 0, 1, 46, 249, 520, 595, 346, 105, 16, 1, 0, 1, 75, 360, 978, 1437, 1185, 539, 136, 18, 1
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,5


COMMENTS

To clarify our terminology: We say T is the convolution triangle of a (or T is the partition transform of a), if a is a sequence of integers defined for n >= 1, and the transformation, as defined by the Maple function below, applied to a, returns T. In the generated lower triangular matrix T, i.e., in the convolution triangle of a, T(n, 1) = a(n) for n >= 1.
For instance, let a(n) = Bell(n), then we call A357583 the convolution triangle of the Bell numbers, but not A205574, which is also called the "Bell convolution triangle" in the comments but leads to a different triangle. Similarly, if a(n) = n!, then A090238 is the convolution triangle of the factorial numbers, not A084938. Third example: A128899 is the convolution triangle of the Catalan numbers in our setup, not A059365. More generally, we recommend that when computing the transform of a 0based sequence to use only the terms for n >= 1 and not to shift the sequence.
Note that T is (0, 0)based and the first column of a convolution triangle always is 1, 0, 0, 0, ... and the main diagonal is 1, 1, 1, 1, ... if a(1) = 1. The (1, 1)based subtriangle of a genuine convolution triangle, i.e., a convolution triangle without column 0 and row 0, is often used in place of the convolution triangle but does not fit well into some applications of the convolution triangles.


LINKS



EXAMPLE

Triangle T(n, k) starts:
[0] 1;
[1] 0, 1;
[2] 0, 2, 1;
[3] 0, 3, 4, 1;
[4] 0, 1, 10, 6, 1;
[5] 0, 5, 14, 21, 8, 1;
[6] 0, 1, 23, 47, 36, 10, 1;
[7] 0, 7, 28, 90, 108, 55, 12, 1;
[8] 0, 1, 49, 147, 258, 205, 78, 14, 1;
[9] 0, 1, 46, 249, 520, 595, 346, 105, 16, 1;


MAPLE

PMatrix := proc(dim, a) local n, k, m, g, M, A;
if n = 0 then return [1] fi;
A := [seq(a(i), i = 1..dim1)];
M := Matrix(dim, shape=triangular[lower]); M[1, 1] := 1;
for m from 2 to dim do
M[m, m] := M[m  1, m  1] * A[1];
for k from m1 by 1 to 2 do
M[m, k] := add(A[i]*M[mi, k1], i = 1..mk+1)
od od; M end:
a := n > if isprime(n) then n else 1 fi: PMatrix(10, a);
# Alternatively, as the coefficients of row polynomials:
P := proc(n, x, a) option remember; ifelse(n = 0, 1,
x*add(a(n  k)*P(k, x, a), k = 0..n1)) end:
Pcoeffs := proc(n, a) seq(coeff(P(n, x, a), x, k), k=0..n) end:
seq(Pcoeffs(n, a), n = 0..9);
# Alternatively, term by term:
`if`(k=0, `if`(n=0, 1, 0), `if`(k=1, `if`(n=0, 0, a(n)),
(q>add(T(j, q, a)*T(nj, kq, a), j=0..n))(iquo(k, 2)))) end:
seq(seq(T(n, k, a), k=0..n), n=0..9);


MATHEMATICA

PMatrix[dim_, a_] := Module[{n, k, m, g, M, A}, If[n == 0, Return[1]]; A = Array[a, dim1]; M = Array[0&, {dim, dim}]; M[[1, 1]] = 1; For[m = 2, m <= dim, m++, M[[m, m]] = M[[m1, m1]]*A[[1]]; For[k = m1, k >= 2, k, M[[m, k]] = Sum[A[[i]]*M[[mi, k1]], {i, 1, mk+1}]]]; M];
a[n_] := If[PrimeQ[n], n, 1];
nmax = 10;
PM = PMatrix[nmax+1, a];
T[n_, k_] := PM[[n+1, k+1]];


PROG

(Python)
def ConvTriangle(dim: int, a) > list[list[int]]:
if callable(a): # Cache the input sequence.
A = [a(i) for i in range(1, dim)]
else:
A = a
print("In:", A)
C = [[0 for k in range(m + 1)] for m in range(dim)]
C[0][0] = 1
for m in range(1, dim):
C[m][m] = C[m  1][m  1] * A[0]
for k in range(m  1, 0, 1):
C[m][k] = sum(A[i] * C[m  i  1][k  1] for i in range(m  k + 1))
return C
from sympy import isprime, flatten
def a(n): return n if isprime(n) else 1
print(flatten(ConvTriangle(10, a)))


CROSSREFS



KEYWORD



AUTHOR



STATUS

approved



