cp's OEIS Frontend

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.

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.

Original entry on oeis.org

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

Views

Author

Noel B. Lacpao, Jun 18 2025

Keywords

Comments

The k-augmented centered triangular numbers a(n,k) count the number of dots in the k-augmented centered triangle of order n. The order, n, refers to the number of exact dots along each side of the base equilateral triangle in the initial unaugmented centered triangle. For k=0, the configuration is simply this base triangle. It would be a single dot for n=1 or for n>=2, a central dot surrounded by dots so that each side contains exactly n dots. For k>=1, the k-augmented centered triangle of order n is recursively constructed by taking a (k-1)-augmented centered triangle of order n and attaching one congruent copy on each side. Each copy shares a whole side with the central triangle. Any overlapping dots that occur along the shared sides and vertices are counted only once. This recursive construction generalizes the classic centered triangular numbers. As k increases, it produces more complex and symmetric triangular patterns.
For k=0, a(n,0) gives the centered triangular numbers (A005448).
For k=1, a(n,1) matches A085473.
When k=2, a(n,1) matches the truncated hex numbers A381424.
The rows appear to be new for all k>=3.
For geometric illustrations, see the linked images.

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, ...
		

Crossrefs

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.