Talk:Primality by trial division: Difference between revisions

(→‎"simplest"?: added a note about skipping trail division by three's. -- ~~~~)
 
(6 intermediate revisions by 2 users not shown)
Line 7:
:: Even that isn't particularly precise. Should I do trial-division by every integer 2 through n-1? Or am I allowed to factor only up to (sqrt(n)) which is obviously sufficient but introduces the added complexity of invoking a square root. So is it still the "simplest" solution? Is simplicity preferred? Actually it would be entirely sufficient to trial-factor only by all <i>prime</i> numbers up to sqrt(n) which immediately leads to a very elegant recursive implementation. Which I'm pretty sure isn't what the creator of the task had in mind ;-) but which is entirely allowed when you just say "use trial division"... [[User:Sgeier|Sgeier]] 19:21, 4 February 2008 (MST)
 
::: It isn't necessary to invoke (use) a SQRT function to find the square root to limit the factors. See the REXX example. [[User:Gerard Schildberger|Gerard Schildberger]] 23:06, 18 December 2010 (UTC)
 
::: Also, trial division by three's can be skipped. See the REXX example and others. -- [[User:Gerard Schildberger|Gerard Schildberger]] 17:12, 15 May 2012 (UTC)
 
==new description==
Line 18:
This task can also be handled by the [http://tnt.math.se.tmu.ac.jp/nzmath/ NZMATH] modules prime and arith1 to enable its trialDivision function.----[[User:Billymac00|Billymac00]] 02:42, 3 January 2011 (UTC)
: As I noted in [[Talk:Sieve of Eratosthenes]], feel free to add a code example, as long as there's already an example that satisfies the task description as-written. --[[User:Short Circuit|Michael Mol]] 04:19, 3 January 2011 (UTC)
 
== Extending the task to producing ranges of primes, optionally. ==
 
I propose the task description is amended (what is the correct procedure for this?).
 
The following to be added:
 
"Optionally, use trial division to produce sequences of prime numbers."
 
For the context to this, see [[Talk:Sieve of Eratosthenes#Trial division sieves should be moved from here|Sieve of Eratosthenes talk page]]. -- [[User:WillNess|WillNess]] ([[User talk:WillNess|talk]]) 16:36, 11 September 2014 (UTC)
 
:* the new proposal on the [[Talk:Sieve of Eratosthenes#Trial division sieves should be moved from here|Sieve of Eratosthenes talk page]] is '''''instead''''' to '''create the new page titled "Generating sequence of primes by Trial Division"'''.
 
::* [[Sequence of primes by Trial Division|Done and done]]. -- [[User:WillNess|WillNess]] ([[User talk:WillNess|talk]]) 09:09, 14 September 2014 (UTC)
751

edits