[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A340459
a(n) is the sum of the numbers adjacent to n in a triangle in which the nonnegative integers are placed from top to bottom and from left to right.
0
3, 9, 10, 18, 26, 23, 31, 44, 50, 40, 48, 68, 74, 80, 61, 69, 98, 104, 110, 116, 86, 94, 134, 140, 146, 152, 158, 115, 123, 176, 182, 188, 194, 200, 206, 148, 156, 224, 230, 236, 242, 248, 254, 260, 185, 193, 278, 284, 290, 296, 302, 308, 314, 320, 226, 234, 338
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
Cf. A214177.
Sequence in context: A030794 A134073 A088005 * A125237 A085459 A092169
KEYWORD
nonn
AUTHOR
Leonardo Sznajder, Jan 10 2021
EXTENSIONS
More terms from Stefano Spezia, Jan 28 2021
STATUS
approved