Skip to main content
deleted 9 characters in body
Source Link

Haskell, 118 112112 104 bytes

66 14 bytes saved thanks to @nimi

z=zipWith(+) p n|n<2=[1]|m<-p(n-1)=z(0:0:m)(m++[0,0]) -- Generate the nth triangle row. r#n|d<-0<$[1..n]=d++r++d  -- Pad a row (r) with nGenerate 0sthe onnth eachtriangle siderow. f n=foldl1 z[pz[d++p x#(n-x)|x<x++d|x<-[1..n]] n],d<-[0<$[1..n-x]]] -- Pad each row with --0s Sumand thethen firstsum nall [padded]the rows. 

Haskell, 118 112 bytes

6 bytes saved thanks to @nimi

z=zipWith(+) p n|n<2=[1]|m<-p(n-1)=z(0:0:m)(m++[0,0]) -- Generate the nth triangle row. r#n|d<-0<$[1..n]=d++r++d  -- Pad a row (r) with n 0s on each side. f n=foldl1 z[p x#(n-x)|x<-[1..n]]  -- Sum the first n [padded] rows 

Haskell, 118 112 104 bytes

6 14 bytes saved thanks to @nimi

z=zipWith(+) p n|n<2=[1]|m<-p(n-1)=z(0:0:m)(m++[0,0]) -- Generate the nth triangle row. f n=foldl1 z[d++p x++d|x<-[1..n],d<-[0<$[1..n-x]]] -- Pad each row with 0s and then sum all the rows. 
added 55 characters in body
Source Link

Haskell, - 118118 112 bytes

6 bytes saved thanks to @nimi

z=zipWith(+) p n|n<2=[1]|m<-p(n-1)=z(0:0:m)(m++[0,0]) -- Generate the nth triangle row. r#n|n>0=(0:r++[0])#(nr#n|d<-1)|2>1=r0<$[1..n]=d++r++d  -- Pad a row (r) with n 0s on each side. f n=foldl1 z[p x#(n-x)|x<-[1..n]] -- Sum the first n [padded] rows 

Haskell - 118 bytes

z=zipWith(+) p n|n<2=[1]|m<-p(n-1)=z(0:0:m)(m++[0,0]) -- Generate the nth triangle row. r#n|n>0=(0:r++[0])#(n-1)|2>1=r -- Pad a row (r) with n 0s on each side. f n=foldl1 z[p x#(n-x)|x<-[1..n]] -- Sum the first n [padded] rows 

Haskell, 118 112 bytes

6 bytes saved thanks to @nimi

z=zipWith(+) p n|n<2=[1]|m<-p(n-1)=z(0:0:m)(m++[0,0]) -- Generate the nth triangle row. r#n|d<-0<$[1..n]=d++r++d  -- Pad a row (r) with n 0s on each side. f n=foldl1 z[p x#(n-x)|x<-[1..n]] -- Sum the first n [padded] rows 
added 4 characters in body
Source Link

Haskell - 118 bytes

z=zipWith(+) p n|n<2=[1]|m<-p(n-1)=z(0:0:m)(m++[0,0]) -- Generate the nth triangle row. r#n|n>0=(0:r++[0])#(n-1)|2>1=r -- Pad a row (r) with n 0s on each side. f n=foldl1 z[p x#(n-x)|x<-[1..n]] -- Sum the first n [padded] rows 

Haskell - 118 bytes

z=zipWith(+) p n|n<2=[1]|m<-p(n-1)=z(0:0:m)(m++[0,0]) -- Generate the nth triangle row. r#n|n>0=(0:r++[0])#(n-1)|2>1=r -- Pad row r with n 0s on each side. f n=foldl1 z[p x#(n-x)|x<-[1..n]] -- Sum the first n [padded] rows 

Haskell - 118 bytes

z=zipWith(+) p n|n<2=[1]|m<-p(n-1)=z(0:0:m)(m++[0,0]) -- Generate the nth triangle row. r#n|n>0=(0:r++[0])#(n-1)|2>1=r -- Pad a row (r) with n 0s on each side. f n=foldl1 z[p x#(n-x)|x<-[1..n]] -- Sum the first n [padded] rows 
Source Link
Loading