OFFSET
0,5
COMMENTS
Column sequences converge to A005704.
LINKS
Serguei Zolotov, Table of n, a(n) for n = 0..10584
FORMULA
G.f. of column k: 1/(1-x) * 1/Product_{j=0..k-1} (1 - x^(3^j)).
EXAMPLE
A(3,3) = 5, because there are 5 partitions of 3*3=9 into powers of 3 less than or equal to 3^3=9: [9], [3,3,3], [3,3,1,1,1], [3,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1].
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, ...
1, 2, 2, 2, 2, 2, ...
1, 3, 3, 3, 3, 3, ...
1, 4, 5, 5, 5, 5, ...
1, 5, 7, 7, 7, 7, ...
1, 6, 9, 9, 9, 9, ...
MATHEMATICA
nmax = 12;
f[k_] := f[k] = 1/(1-x) 1/Product[1-x^(3^j), {j, 0, k-1}] + O[x]^(nmax+1) // CoefficientList[#, x]&;
A[n_, k_] := f[k][[n+1]];
Table[A[n-k, k], {n, 0, nmax}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Nov 20 2019 *)
PROG
(Python)
def aseq(p, x, k):
# generic algorithm for any p - power base, p=3 for this sequence
if x < 0:
return 0
if x < p:
return 1
# coefficients
arr = [0]*(x+1)
arr[0] = 1
m = p**k
while m > 0:
for i in range(m, x+1, m):
arr[i] += arr[i-m]
m //= p
return arr[x]
def A(n, k):
p = 3
return aseq(p, p*n, k)
# A(n, k), 5 = A(3, 3) = aseq(3, 3*3, 3)
# Serguei Zolotov, Mar 13 2019
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Serguei Zolotov, Mar 06 2019
STATUS
approved