# IRC log for #rosettacode, 2014-10-24

All times shown according to UTC.

Time Nick Message
00:32 mwn3d joined #rosettacode
01:13 mwn3d1 joined #rosettacode
01:30 RainbDed joined #rosettacode
01:31 mwn3d joined #rosettacode
02:24 bug-magnet joined #rosettacode
05:28 bug-magnet joined #rosettacode
05:31 Rainb joined #rosettacode
06:50 relrod joined #rosettacode
07:00 Rainb joined #rosettacode
07:00 mikemol joined #rosettacode
07:10 fedaykin joined #rosettacode
07:10 eMBee joined #rosettacode
07:10 FireFly joined #rosettacode
07:32 Rainb joined #rosettacode
07:32 fedaykin joined #rosettacode
07:32 eMBee joined #rosettacode
07:32 FireFly joined #rosettacode
07:37 mikemol joined #rosettacode
07:40 Rainb joined #rosettacode
08:01 Guest1419 factoring primes?  Wouldn't anything be fast at that?  :)
08:01 Guest1419 I was thinking stirling numbers of the second kind, but he's long gone anyway
09:56 Rainb joined #rosettacode
09:58 davido_home joined #rosettacode
09:58 kuzetsa joined #rosettacode
10:25 Rainb joined #rosettacode
12:30 mikemol Guest1419: Functional langauges' approach to recursion should make factoring primes (by trial division, at least) particularly fast, as you (realistically) only want to try dividing by known primes...and functional runtimes (should) cache return values of functions called with the same arguments before.
12:31 mikemol So you set up a construction that tests if a number is prime by dividing it by a known prime. How do you get a known prime? Test a number to see if it's prime.
12:31 mikemol Sounds like circular logic, but it works fine if you give it a starting point.
12:32 mikemol TimToady pulled off a nice one in Perl6 while I was trying to figure out how to use a prime generator as the source of potential factors in a prime tester.
12:33 mikemol And the prime tester was the mechanism the prime generator used to test primes for emission.
12:33 mikemol http://rosettacode.org/wiki/Primality_by_trial_division#Perl_6
12:33 fedaykin "Primality by trial division - Rosetta Code" http://rldn.net/Aww
12:34 mikemol Now, that example isn't functional, but functional runtimes should internalize the mechanism (memoization) that makes that example fast.
12:44 bug-magnet joined #rosettacode
12:53 Rainb joined #rosettacode
14:06 Pixelz joined #rosettacode
14:55 Guest1419 mikemol: I was joking that factoring a prime consists of the line "return n"
14:55 mikemol Ah. :)
14:57 Guest1419 But more seriously, yes factoring (composites :) ) has lots of opportunities for this.  I usually use a stack rather than recursion, especially once you have factoring stages (e.g. trial factor, Rho, ECM, ...)
15:18 mwn3d1 joined #rosettacode
15:29 mwn3d joined #rosettacode
15:37 kpreid joined #rosettacode
15:38 mwn3d1 joined #rosettacode
15:47 Rainb joined #rosettacode
15:50 mwn3d joined #rosettacode
16:04 Guest1419 joined #rosettacode
17:54 ivanshmakov joined #rosettacode
18:04 ivanshmakov joined #rosettacode
20:23 Xiti joined #rosettacode
21:42 mwn3d1 joined #rosettacode
22:00 Rainb joined #rosettacode