+ 4

# πChallenge #11: To find product of all primes to a number nπ

To find product of every prime number to a number took as input For eg. Input = 6 Output = 2*3*5 = 30 Any languageπ

5th Nov 2017, 4:55 AM
#RahulVerma
5th Nov 2017, 5:16 AM
π Prometheus πΈπ¬
+ 15
#Ruby require "prime" q = 1 Prime.each(gets.to_i) do |p| q *= p end puts q
5th Nov 2017, 5:25 AM
Krishna Teja Yeluripati
+ 14
Here's my C# implementation! β I'm kinda occupied recently but decided to make it in my favourite LINQ as I've invited by someone to complete the challenge. Enjoy~ β€ https://code.sololearn.com/cDpGJBV8JmCU/?ref=app
5th Nov 2017, 3:25 PM
Zephyr Koo
+ 7
That's literally the convenience of ruby.
5th Nov 2017, 5:32 AM
π Prometheus πΈπ¬
13th Nov 2017, 5:23 AM
SAKSHI
+ 4
I can modify one of my codes for this :)
5th Nov 2017, 5:13 AM
π Prometheus πΈπ¬
+ 4
Here my answer, I am using 3 different ways to sum products of primes: https://code.sololearn.com/c1Sk9AZLHBdF/?ref=app
5th Nov 2017, 3:44 PM
Ferhat Sevim
+ 3
there is py module fr primes .. gmpy2 and sympy ## not supported here thats a problem...
5th Nov 2017, 6:11 AM
sayan chandra
+ 3
this is quite a efficient way to generate primes....without any module https://code.sololearn.com/cmSkuqU5z7De/?ref=app
5th Nov 2017, 6:23 AM
sayan chandra
6th Nov 2017, 1:07 AM
Takava Lim
+ 3
This one better for large numbers using Pollard' s algo https://code.sololearn.com/cU9K9ia897vz/?ref=app
30th Dec 2017, 9:59 PM
VcC
+ 2
5th Nov 2017, 10:40 AM
VcC
+ 2
https://code.sololearn.com/cZo7y4VVqSJJ/?ref=app
30th Dec 2017, 9:08 PM
VcC
+ 1
Approximatively exp(n)
5th Nov 2017, 7:13 AM
VcC