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.

A332350 Triangle read by rows: T(m,n) = Sum_{-m= n >= 1.

Original entry on oeis.org

0, 2, 12, 4, 26, 56, 6, 44, 98, 172, 8, 66, 148, 262, 400, 10, 92, 210, 376, 578, 836, 12, 122, 280, 502, 772, 1118, 1496, 14, 156, 362, 652, 1006, 1460, 1958, 2564, 16, 194, 452, 818, 1264, 1838, 2468, 3234, 4080, 18, 236, 554, 1004, 1554, 2264, 3042, 3988, 5034, 6212
Offset: 1

Views

Author

N. J. A. Sloane, Feb 10 2020

Keywords

Examples

			Triangle begins:
0,
2, 12,
4, 26, 56,
6, 44, 98, 172,
8, 66, 148, 262, 400,
10, 92, 210, 376, 578, 836,
12, 122, 280, 502, 772, 1118, 1496,
14, 156, 362, 652, 1006, 1460, 1958, 2564,
16, 194, 452, 818, 1264, 1838, 2468, 3234, 4080,
18, 236, 554, 1004, 1554, 2264, 3042, 3988, 5034, 6212,
...
		

Crossrefs

The main diagonal is A331771.

Programs

  • Maple
    VR := proc(m,n,q) local a,i,j; a:=0;
    for i from -m+1 to m-1 do for j from -n+1 to n-1 do
    if gcd(i,j)=q then a:=a+(m-abs(i))*(n-abs(j)); fi; od: od: a; end;
    for m from 1 to 12 do lprint(seq(VR(m,n,1),n=1..m),); od:
  • Mathematica
    T[m_, n_] := Sum[Boole[GCD[i, j] == 1] (m - Abs[i]) (n - Abs[j]), {i, -m + 1, m - 1}, {j, -n + 1, n - 1}];
    Table[T[m, n], {m, 1, 12}, {n, 1, m}] // Flatten (* Jean-François Alcover, Apr 19 2020 *)