OFFSET
2,1
COMMENTS
n stands alone in the first row, and then each row expands to a new row as follows.
An even number 2b >= 2 or an odd number 2c+1 >= 3 expands into cells below, below left, and below right, as follows:
even odd
2b 2c+1
b 0 b c 1 c
When expansions overlap, the values add together in the new cells.
Any 0 or 1 does not expand and expansions end when a row of only 0's and 1's is reached.
This last row is 1,1,1 when n=3 and otherwise always 1,0,1.
a(n) is the sum of all cells in all rows, excluding the starting n itself.
EXAMPLE
For n = 4:
4 initial row
2 0 2
1 0 2 0 1
1 0 1 last row
a(4) = (2+2) + (1+2+1) + (1+1).
For n = 8:
8
4 0 4
2 0 4 0 2
1 0 3 0 3 0 1
1 1 2 1 1
1 0 1
a(8) = (4+4) + (2+4+2) + (1+3+3+1) + (1+1+2+1+1) + (1+1) = 32.
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Moosa Nasir, Dec 22 2022
STATUS
approved