latex

Radically Infinite

In today’s procrastination effort, I want to generate the LaTeX code to produce an infinite radical expansion for the number 3, and generate the code using R. … inspired by math teacher Chris Smith tweet First, let me see if I can simply generate the pattern of integers. I will use the letter capital “S” and later replace it with the square root symbol. stem <- "S 1 + " print(paste(stem, "8")) ## [1] "S 1 + 8" for(a in 2:5){ b <- (a+1)^2-1 print(paste(stem, a, "*", b/a)) print(paste(stem, a, "S", (b/a)^2)) print(paste(stem, a, "S", 1, "+", (b/a)^2- 1)) stem <- paste(stem, a, "S", 1, "+") } ## [1] "S 1 + 2 * 4" ## [1] "S 1 + 2 S 16" ## [1] "S 1 + 2 S 1 + 15" ## [1] "S 1 + 2 S 1 + 3 * 5" ## [1] "S 1 + 2 S 1 + 3 S 25" ## [1] "S 1 + 2 S 1 + 3 S 1 + 24" ## [1] "S 1 + 2 S 1 + 3 S 1 + 4 * 6" ## [1] "S 1 + 2 S 1 + 3 S 1 + 4 S 36" ## [1] "S 1 + 2 S 1 + 3 S 1 + 4 S 1 + 35" ## [1] "S 1 + 2 S 1 + 3 S 1 + 4 S 1 + 5 * 7" ## [1] "S 1 + 2 S 1 + 3 S 1 + 4 S 1 + 5 S 49" ## [1] "S 1 + 2 S 1 + 3 S 1 + 4 S 1 + 5 S 1 + 48" Not only do I need to now insert the square root symbol, but I would also need to close the parentheses.

Continue reading