OFFSET
0,1
COMMENTS
The triangle of nonnegative integers begins:
0
1 2
3 4 5
6 7 8 9
...
EXAMPLE
For n=4:
- the numbers adjacent to 4 are 1, 2, 3, 5, 7 and 8,
- so a(4) = 1 + 2 + 3 + 5 + 7 + 8 = 26.
MATHEMATICA
T[i_, j_]:=Binomial[i+1, 2]+j; a[i_, j_]:=If[j-1>=0, T[i, j-1], 0]+If[i-1>=0&&j-1>=0, T[i-1, j-1], 0]+If[i-1>=0&&j<=i-1, T[i-1, j], 0]+If[j+1<=i, T[i, j+1], 0]+T[i+1, j]+T[i+1, j+1]; Flatten[Table[a[i, j], {i, 0, 12}, {j, 0, i}]] (* Stefano Spezia, Jan 28 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leonardo Sznajder, Jan 10 2021
EXTENSIONS
More terms from Stefano Spezia, Jan 28 2021
STATUS
approved