Re: prime factors

2017-05-04 Thread derrick
;faster in runtime speed'? There's also https://en.wikipedia.org/wiki/Code_golf . > Derrick > > > --发件人:Jim > Gibson日 期:2017年05月03日 00:35:53收件人:derrick > cope; beginners主 题:Re: prime > factors > > On May 2, 20

Re: prime factors

2017-05-03 Thread Shlomi Fish
:Jim > Gibson日 期:2017年05月03日 00:35:53收件人:derrick > cope; beginners主 题:Re: prime > factors > > On May 2, 2017, at 7:58 AM, derrick cope wrote: > > > > I was writing a program to solve the #3 exercise on project Euler. I needed > > to find the prime factors of a given

Re: prime factors

2017-05-02 Thread derrick
人:derrick cope; beginners主 题:Re: prime factors > On May 2, 2017, at 7:58 AM, derrick cope wrote: > > I was writing a program to solve the #3 exercise on project Euler. I needed > to find the prime factors of a given number. > I have solved it already but a couple of the ways I tri

Re: prime factors

2017-05-02 Thread Raunak Kathuria
Hi Derrick, Logically you are going with linear approach, better to find patterns that can discard data that is not needed which will reduce time I solved it while back using following algorithm of divide and break sub largestPrimeFactors { my $n = shift; my $largest = 0; # remove a

Re: prime factors

2017-05-02 Thread Shlomi Fish
Hi derrick! Welcome aboard! See below for my reply. On Tue, 02 May 2017 22:58:58 +0800 "derrick cope" wrote: > I was writing a program to solve the #3 exercise on project Euler. For reference, it is https://projecteuler.net/problem=3 . >I needed > to find the prime factors of a given number

Re: prime factors

2017-05-02 Thread Jim Gibson
> On May 2, 2017, at 7:58 AM, derrick cope wrote: > > I was writing a program to solve the #3 exercise on project Euler. I needed > to find the prime factors of a given number. > I have solved it already but a couple of the ways I tried to solve the > problem caused a problem. Exercise #3 is