Skip to main content

All Questions

3 votes
4 answers
194 views

Is this an efficient/correct way to get largest Prime factor?

Is this an efficient way to get the largest prime factor of a given number? Other solutions I found involved nested algorithms. ...
Tharindu's user avatar
  • 143
3 votes
3 answers
348 views

Project Euler 50: Consecutive prime sum

I just finished solving Project Euler's 50th problem, but it's awfully slow. I'd like to hear your thoughts on my code's efficiency and practices. Problem Statement The prime 41, can be written as the ...
Arber's user avatar
  • 31
2 votes
1 answer
926 views

Codewars: Prime Streaming (PG-13)

I'm timing out on Codewars' Prime Streaming kata. Below is my code: ...
Tobi Alafin's user avatar
  • 1,792
1 vote
1 answer
77 views

Prime reversion algorithm - JavaScript

I solved the following problem: Consider the range 0 to 10. The primes in this range are: 2, 3, 5, 7, and thus the prime pairs are: (2,2), (2,3), (2,5), (2,7), (3,3), (3,5), (3,7),(5,5), (5,7), (7,7)....
puls99's user avatar
  • 323
1 vote
1 answer
2k views

code to check if number is prime number

I have written a code to check if the number is prime number are not. I pass the number from command line argument, and check if the number is prime. I have written a function for it which returns ...
Rahul Shivsharan's user avatar
7 votes
1 answer
4k views

Number of prime numbers between 1 and n

I came up with the following solution to find the number of prime numbers from 1 to n. I'm wondering if there is a more optimal way. ...
KingKongFrog's user avatar
8 votes
2 answers
5k views

Checking for circular primes - Project Euler Problem 35

I have been trying to solve Project Euler problem number 35. The problem is to find: How many circular primes are there below one million? A circular prime is a prime where all the rotations of its ...
user2521439's user avatar