Untitled UI logotext
Solutions
WebsitesEcommerceMobile AppsWeb AppsProduction Support & Maintenance
Our work
Company
About usBlogPodcastContact us
Book a free consultation

Project Euler Problem 7

Olivia Rhye
Project Euler Problem 7

I mentioned yesterday, I've been doing the first few problems of Project Euler and figured I'd share my solution to problem 7 here.

The Problem
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10,001st prime number?

The Solution
Let's define a function isPrime(num) (granted, could be more efficient) and loop through the natural numbers, counting those that are prime.

Ready to start a project?

Book a free consultation
Untitled UI logotext
Our work
About us
Blog
Careers
Submit a ticket
Agency Partnerships
Contact
© 2024 fjorge. All rights reserved.
Privacy