A381358 Row sums of irregular triangle A381587.
1, 1, 2, 3, 5, 9, 15, 25, 41, 67, 109, 175, 277, 433, 671, 1035, 1595, 2463, 3817, 5937, 9259, 14457, 22569, 35193, 54795, 85195, 132333, 205471, 319069, 495699
Offset: 1
Examples
Row n+1 of irregular triangle A381587 equals the run lengths of the first n rows of the triangle (flattened) when read in reverse order, starting with 1; 1; 2; 1,2; 1,1,1,2; 1,3,1,1,1,2; 1,3,1,1,1,3,1,1,1,2; 1,3,1,3,1,1,1,3,1,1,1,3,1,1,1,2; ... This sequence gives the row sums [1, 1, 2, 3, 5, 9, 15, 25, ...].
Programs
-
PARI
\\ Print the row sums of irregular triangle A381587 \\ RUNS(V) Returns vector of run lengths in vector V: {RUNS(V) = my(R=[], c=1); if(#V>1, for(n=2, #V, if(V[n]==V[n-1], c=c+1, R=concat(R, c); c=1))); R=concat(R, c)} \\ REV(V) Reverses order of vector V: {REV(V) = Vec(Polrev(Ser(V)))} \\ Generates N rows as a vector A of row vectors {N=25; A=vector(N); A[1]=[1]; A[2]=[1]; A[3]=[2]; for(n=3, #A-1, A[n+1] = concat(RUNS(REV(A[n])), A[n]); );} \\ Print the row sums of the first N rows for(n=1, N, print1(vecsum(A[n]),", "))
Comments