|
|
A350851
|
|
Cumulative sums of the first ceiling(n/2)+1 elements of rows 0 to n in Pascal's triangle.
|
|
0
|
|
|
1, 3, 6, 13, 24, 50, 92, 191, 354, 736, 1374, 2860, 5370, 11182, 21090, 43909, 83112, 172958, 328340, 682862, 1299528, 2700820, 5150688, 10697070, 20437756, 42415272, 81170004, 168337168, 322613196, 668607412, 1283037084, 2657319103, 5105342946, 10567113352, 20323851054
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
EXAMPLE
|
The first ceiling(n/2)+1 elements from the first four rows of Pascal's are:
1
1 1
1 2
1 3 3
So a(0)=1, a(1)=a(0)+1+1=3, a(2)=a(1)+1+2=6, a(3)=a(2)+1+3+3=13.
|
|
PROG
|
(Python)
seq=[]; prev=[]; total=0
for n in range(30):
row=[1]
last=int(n/2)
for k in range(last):
row.append(prev[k]+prev[k+1])
if n%2==1:
row.append(row[-1])
prev=row
total+=sum(row)
seq.append(total)
print(seq)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|