login
A375972
a(n) = binomial(n,k(n)), where k(2) = 1, k(n) = k(n-1) + (a(n-1) mod 2).
0
2, 3, 6, 10, 15, 35, 70, 126, 210, 330, 495, 1287, 3003, 6435, 12870, 24310, 43758, 75582, 125970, 203490, 319770, 490314, 735471, 2042975, 5311735, 13037895, 30421755, 67863915, 145422675, 300540195, 601080390, 1166803110, 2203961430, 4059928950, 7307872110, 12875774670, 22239974430
OFFSET
2,1
COMMENTS
A way to travel down the Pascal's triangle starting in the center of the third row, where you turn left at every even number, and turn right at every odd number, while descending a row at every step.
Pascal's triangle is symmetric, thus switching the turn directions would not change the sequence.
EXAMPLE
a(3) = 3, and k(3) = 1.
To derive a(4), we first find that k(4) = k(3) + (a(3) mod 2) = 1 + (3 mod 2) = 2.
Therefore a(4) = binomial(4,k(4)) = binomial(4,2) = 6.
PROG
(Python)
def genNextRow(arr):
nextRow = []
nextRow.append(arr[0])
for i in range(1, len(arr)):
nextRow.append(arr[i-1]+arr[i])
nextRow.append(arr[len(arr)-1])
return nextRow
pascal = [[1], [1, 1]]
n = 0
index = 1
while n < 30:
pascal.append(genNextRow(pascal[1]))
pascal.pop(0)
print(pascal[1][index])
index = index + (pascal[1][index] % 2)
n += 1
(PARI) lista(nn) = my(va=vector(nn), vk=vector(nn)); vk[2] = 1; va[2] = binomial(2, vk[2]); for (n=3, nn, vk[n] = vk[n-1] + va[n-1] % 2; va[n] = binomial(n, vk[n]); ); vector(nn-1, k, va[k+1]); \\ Michel Marcus, Sep 27 2024
CROSSREFS
Cf. A007318.
Initial conditions of n=0, k(0)=0 would generate A000012.
Sequence in context: A055789 A238891 A048681 * A051891 A108062 A347117
KEYWORD
nonn
AUTHOR
Walter Robinson, Sep 04 2024
EXTENSIONS
More terms from Michel Marcus, Sep 30 2024
STATUS
approved