First three problems of Project Euler - JS