Solution to the 15th Project Euler Problem coded and visualised with R.

The 15th Project Euler problem - Lattice Paths - is stated as follows. Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner. How many such routes are there through a 20×20 grid?

```
countRoutes <- function(grid.size){
# Get the binomial coefficient i.e. the number of ways
# of picking k unordered outcomes from n possibilities.
k <- grid.size
n <- k*2
result <- factorial(n) / (factorial(k)*factorial(n-k))
return(result)
}
# Call the device driver.
png(file="graph.png",width=1080,height=1080,res=120)
# Set margins.
par(mar=c(5,3,3,3))
# Create a range from 1 to 20 for the x axis.
x <- c(1:20)
# Map the range using the countRoutes function.
y <- countRoutes(x)
# Plot the graph without axes and annotations.
plot(y, type="o", col="blue", axes=FALSE, ann=FALSE, pch=16)
# Draw a box around the plot.
box()
# Add gridd lines.
abline(h=tail(y,3), v=x, col="gray", lty=3)
# Add labels for the last three markers.
text(tail(x,3),tail(y,3),labels=tail(y,3), pos=2)
# Add the X axis.
axis(1, at=x)
# Add a title for the x axis.
title(xlab= "Lattice Grid Size")
# End call to device driver.
dev.off()
```

- [project-euler] Project Euler Problem 17 - Number Letter Counts - solved with R
- [project-euler] Project Euler Problem 16 - Power Digit Sum - solved with Javascript
- [project-euler] Project Euler Problem 15 - Lattice Paths - solved with R
- [project-euler] Finding the 10001st prime with R
- [project-euler] Find longest Collatz sequence using Javascript
- [project-euler] Sum large numbers with Kotlin versus Javascript
- [tech-test] What is a binary tree and how to invert it using Kotlin
- [project-euler] Find Highly Divisible Triangular Numbers with Kotlin
- [project-euler] Find the Largest Product in a Grid with Rust
- [project-euler] Summation of the First Two Million Primes with Rust
- [project-euler] Finding the largest product in a series with Rust
- [project-euler] Finding the 10001st prime with Rust
- [js] The complete list of rational numbers with Stern-Brocot and Javascript
- [project-euler] Project Euler number six solved with Rust
- [project-euler] Smallest positive number that is evenly divisible by all of the numbers from 1 to 20 with Rust
- [project-euler] Finding the largest palindrome product with Rust
- [project-euler] Get the largest prime factor with Reason
- [project-euler] Find the sum of all even Fibonacci numbers below four million with OCaml
- [project-euler] Finding the sum of all multiples of 3 or 5 below 1000 with OCaml
- [project-euler] Special Pythagorean Triplet solved with Reason
- [personal] New Year's Resolution 2018