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.

A385672 Irregular triangle read by rows: T(n, k) is the number of n-step walks on the square lattice having algebraic area k; n >= 0, 0 <= k <= floor(n^2/4).

This page as a plain text file.
%I A385672 #13 Aug 05 2025 09:45:01
%S A385672 1,4,12,2,40,8,4,124,42,16,6,2,416,160,92,28,16,4,4,1348,678,362,174,
%T A385672 88,34,22,8,6,2,4624,2548,1624,756,460,200,156,56,40,20,12,4,4,15632,
%U A385672 10062,6336,3586,2110,1106,742,388,278,152,82,46,34,14,8,6,2
%N A385672 Irregular triangle read by rows: T(n, k) is the number of n-step walks on the square lattice having algebraic area k; n >= 0, 0 <= k <= floor(n^2/4).
%C A385672 Rows can be extended to negative k with T(n, -k) = T(n, k). Sums of such extended rows give 4^n.
%C A385672 The algebraic area is Integral y dx over the walk, which equals (Sum_{steps right} y) - (Sum_{steps left} y).
%F A385672 It appears that T(2*n, n^2 - k) = 2 * A029552(k) for k < n and T(2*n+1, n^2+n - k) = 4 * A098613(k) for k < n.
%e A385672 The triangle begins:
%e A385672      1
%e A385672      4
%e A385672     12,   2
%e A385672     40,   8,   4
%e A385672    124,  42,  16,   6,  2
%e A385672    416, 160,  92,  28, 16,  4,  4
%e A385672   1348, 678, 362, 174, 88, 34, 22, 8, 6, 2
%e A385672    ...
%e A385672 T(3, 1) = 8: RUR (right, up, right), LUR, RDL, LDL, URU, URD, DLU, DLD.
%o A385672 (Python)
%o A385672 d = [{((0, 0), 0): 1}]
%o A385672 for _ in range(10):
%o A385672     nd = {}
%o A385672     for key, nw in d[-1].items():
%o A385672         pos, ar = key
%o A385672         x, y = pos
%o A385672         for key in [
%o A385672             ((x+1, y), ar + y),
%o A385672             ((x-1, y), ar - y),
%o A385672             ((x, y+1), ar),
%o A385672             ((x, y-1), ar)
%o A385672             ]:
%o A385672             if key in nd:
%o A385672                 nd[key] += nw
%o A385672             else:
%o A385672                 nd[key] = nw
%o A385672     d.append(nd)
%o A385672 t = []
%o A385672 for nd in d:
%o A385672     a = [0] * (max(ar for _, ar in nd) + 1)
%o A385672     for key, nw in nd.items():
%o A385672         _, ar = key
%o A385672         if ar >= 0:
%o A385672             a[ar] += nw
%o A385672     t.append(a)
%o A385672 print(t)
%Y A385672 Row lengths are A033638 = A002620 + 1.
%Y A385672 A352838 is an analog that gives the number of closed walks.
%Y A385672 Cf. A029552, A098613.
%K A385672 nonn,tabf
%O A385672 0,2
%A A385672 _Andrei Zabolotskii_, Aug 04 2025