My  work through project euler using Javascript