This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A306727 #42 Apr 27 2020 06:22:47 %S A306727 1,1,1,1,2,1,1,2,3,1,1,2,3,4,1,1,2,3,5,5,1,1,2,3,5,7,6,1,1,2,3,5,7,9, %T A306727 7,1,1,2,3,5,7,9,12,8,1,1,2,3,5,7,9,12,15,9,1,1,2,3,5,7,9,12,15,18,10, %U A306727 1,1,2,3,5,7,9,12,15,18,22,11,1,1,2,3,5,7,9,12,15,18,23,26,12,1 %N A306727 Square array A(n,k), n >= 0, k >= 0, read by antidiagonals: A(n,k) is the number of partitions of 3*n into powers of 3 less than or equal to 3^k. %C A306727 Column sequences converge to A005704. %H A306727 Serguei Zolotov, <a href="/A306727/b306727.txt">Table of n, a(n) for n = 0..10584</a> %F A306727 G.f. of column k: 1/(1-x) * 1/Product_{j=0..k-1} (1 - x^(3^j)). %e A306727 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]. %e A306727 Square array A(n,k) begins: %e A306727 1, 1, 1, 1, 1, 1, ... %e A306727 1, 2, 2, 2, 2, 2, ... %e A306727 1, 3, 3, 3, 3, 3, ... %e A306727 1, 4, 5, 5, 5, 5, ... %e A306727 1, 5, 7, 7, 7, 7, ... %e A306727 1, 6, 9, 9, 9, 9, ... %t A306727 nmax = 12; %t A306727 f[k_] := f[k] = 1/(1-x) 1/Product[1-x^(3^j), {j, 0, k-1}] + O[x]^(nmax+1) // CoefficientList[#, x]&; %t A306727 A[n_, k_] := f[k][[n+1]]; %t A306727 Table[A[n-k, k], {n, 0, nmax}, {k, n, 0, -1}] // Flatten (* _Jean-François Alcover_, Nov 20 2019 *) %o A306727 (Python) %o A306727 def aseq(p, x, k): %o A306727 # generic algorithm for any p - power base, p=3 for this sequence %o A306727 if x < 0: %o A306727 return 0 %o A306727 if x < p: %o A306727 return 1 %o A306727 # coefficients %o A306727 arr = [0]*(x+1) %o A306727 arr[0] = 1 %o A306727 m = p**k %o A306727 while m > 0: %o A306727 for i in range(m, x+1, m): %o A306727 arr[i] += arr[i-m] %o A306727 m //= p %o A306727 return arr[x] %o A306727 def A(n, k): %o A306727 p = 3 %o A306727 return aseq(p, p*n, k) %o A306727 # A(n, k), 5 = A(3, 3) = aseq(3, 3*3, 3) %o A306727 # _Serguei Zolotov_, Mar 13 2019 %Y A306727 Main diagonal gives A005704. %Y A306727 A181322 gives array for base p=2. %K A306727 nonn,tabl %O A306727 0,5 %A A306727 _Serguei Zolotov_, Mar 06 2019