A385108 Triangle a(n,k) read by antidiagonals: a(n,k) is the number of dots in the k-augmented centered triangle of order n, k>=0, n>=1.
1, 1, 4, 1, 10, 10, 1, 31, 31, 19, 1, 109, 109, 64, 31, 1, 409, 409, 235, 109, 46, 1, 1585, 1585, 901, 409, 166, 64, 1, 6241, 6241, 3529, 1585, 631, 235, 85, 1, 24769, 24769, 13969, 6241, 2461, 901, 316, 109, 1, 98689, 98689, 55585, 24769, 9721, 3529, 1219, 409, 136
Offset: 1
Examples
For n=1, any k: a(1,k) = 4^k*(3*1^2-3*1+2)/2 - 3*1*Sum_{j=1..k} 4^(k-j)*2^(j-1) + 3*Sum_{j=1..k} 4^{k-j}*(2^{j-1}-1) = 4^k*1 - 3*Sum_{j=1..k} 4^(k-j)*2^(j-1) + 3*Sum_{j=1..k} 4^(k-j)*2^(j-1) - 3*Sum_{j=1..k} 4^(k-j) = 4^k-3*Sum_{j=1..k} 4^(k-j) = 4^k-3*(4^k-1)/3 = 4^k-4^k+1 = 1. For n=2,k=0: a(2,0) = 4^0*(3*2^2-3*2+2)/2 = 8/2 = 4. For n=3, k=2: a(3,2) = 4^2*(3*3^2-3*3+2)/2 - 3*3*Sum_{j=1..2} 4^(2-j)*2^(j-1) + 3*Sum_{j=1..22} 4^(2-j)*(2^(j-1)-1) = 16*20/2-9*6+3*1 = 109. Square array begins: 1, 1, 1, 1, 1, 1, 1, 1, ... 4, 10, 31, 109, 409, 1585, 6241, 24769, ... 10, 31, 109, 409, 1585, 6241, 24769, 98689, ... 19, 64, 235, 901, 3529, 13969, 55585, 221761, ... 31, 109, 409, 1585, 6241, 24769, 98689, 393985, ... 46, 166, 631, 2461, 9721, 38641, 154081, 615361, ... 64, 235, 901, 3529, 13969, 55585, 221761, 885889, ... 85, 316, 1219, 4789, 18985, 75601, 301729, 1205569, ...
Links
- Noel B. Lacpao, Table of n, a(n) for n = 1..1000
- Noel B. Lacpao, Summary Table for n=1..50,k=0..3
- Noel B. Lacpao, Geometric_Illustration for n=3,k=2
- Noel B. Lacpao, Geometric_Illustration for n=3,k=3
Programs
-
Maple
a := proc(n, k) local S1, S2, j; S1 := add(4^(k-j)*2^(j-1), j=1..k); S2 := add(4^(k-j)*(2^(j-1)-1), j=1..k); return 4^k*(3*n^2 - 3*n + 2)/2 - 3*n*S1 + 3*S2; end proc: seq(seq(a(n,d-n), n=1..d), d=1..10);
-
Mathematica
a[n_, k_] := Module[{S1, S2}, S1 = Sum[4^(k - j) * 2^(j - 1), {j, 1, k}]; S2 = Sum[4^(k - j) * (2^(j - 1) - 1), {j, 1, k}]; 4^k * (3 n^2 - 3 n + 2)/2 - 3 n * S1 + 3 * S2 ]; Table[a[n, k], {n, 1, 5}, {k, 0, 5}] TableForm[Table[a[n, k], {n, 1, 5}, {k, 0, 5}]]
-
Python
def a(n, k): return 4**k*(3*n**2-3*n+2)//2-3*n*sum(4**(k-j)*2**(j-1) for j in range(1,k+1))+ 3*sum(4**(k-j)*(2**(j-1)-1) for j in range(1,k+1)) for n in range(1, 10): row = [a(n, k) for k in range(0, 10)] print(row)
-
Python
# For the antidiagonal terms. def a(n,k): term1 = 4**k * (3*n**2 - 3*n + 2) // 2 if k == 0: return term1 return term1 - 3*n*sum([4**(k-j) * 2**(j-1) for j in range(1, k+1)]) + 3*sum([4**(k-j) * (2**(j-1) - 1) for j in range(1, k+1)]) def antidiagonal_sequence(num_terms): terms = [] diag = 0 while len(terms) < num_terms: for n in range(1, diag+2): k = diag - (n-1) if k < 0: continue terms.append(a(n, k)) if len(terms) == num_terms: break diag += 1 return terms N = 55 seq = antidiagonal_sequence(N) print(', '.join(str(x) for x in seq))
Formula
a(n,k) = 4^k * (3*n^2-3*n+2) / 2 - 3*n * Sum_{j=1..k} 4^(k-j) * 2^(j-1) + 3 * Sum_{j=1..k} 4^(k-j) * (2^(j-1)-1).
a(n,k) = 4 * a(n,k-1) - 3 * (2^(k-1) * n - (2^(k-1)-1)).
G.f. for fixed k: G_k(x) = (A_kx(x+1) + B_kx(1-x) + C_kx(1-x)^2) / (1-x)^3, where a(n,k)=A_kn^2 + B_kn + C_k.
Comments