I am reading, on my own (not for HW) about programming, and one exercise involved programming Pascal\'s triangle in R. My first idea was to make a list and then append thin
using a property of the Pascal triangle:
x <- 1 print(x) for (i in 1:10) { x <- c(0, x) + c(x, 0); print(x) }
I suppose this code is very fast.