Re: read/write at the same time



In alt.comp.lang.borland-delphi message <a49d4381-795e-47d0-8dcb-
177373f5da67@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, Mon, 3 Nov 2008 14:51:39,
"alanglloyd@xxxxxxx" <alanglloyd@xxxxxxx> posted:
On 3 Nov, 13:39, dolatabadi.a...@xxxxxxxxx wrote:
<snip>
We divide it to all prime numbers below it
and if it is not divisable, this number is prime.
<snip>

Don't you only need to divide by primes from 3 to the prime below one-
(primeth you've just tested) of the number ?

eg at the start you divide by 3 and if it is not divisible, then you
set the limit to test up to at one-third the number. After not
divisible by five, you set the limit at one-fifth the number. In the
end you'd never test for division above the geatest prime less than
the square-root of the number.

There is never any need to test with a number greater than the square
root of the input. If there is a prime factor greater than the square
root, there must be a corresponding factor smaller than the square root.

Also, see in <http://www.merlyn.demon.co.uk/js-misc1.htm>.

--
(c) John Stockton, near London. *@merlyn.demon.co.uk/?.?.Stockton@xxxxxxxxxxx
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Correct <= 4-line sig. separator as above, a line precisely "-- " (SoRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SoRFC1036)
.



Relevant Pages

  • =?windows-1252?Q?Re=3A_E=3Dmc=28squared=29_=3D_E=3Dmc=28circled=29=2C_and_celestial_orb?= =?wind
    ... I find it interesting that both -1 and pi don’t seem to have a square ... root until you consider the natural unite c. ... also the basic natural unites of, E, M(mass), T, Q ... waves, to create rest mass particles, which are quantum particles, ...
    (sci.math)
  • Re: tree roots
    ... expressed an interest in getting rid of the tree. ... The surface root is raising the fence and Iwant to ... I had pine tree roots lifting my sidewalk. ... sidewalk square back, and I had to do it two more times. ...
    (alt.home.repair)
  • Re: Square Root Of java.math.BigInteger
    ... I have a BigDecimal square root finder here you can have, ... int workingDecimalPlaceNumber; ... BigDecimal numerator; ...
    (comp.lang.java.programmer)
  • Re: OT: Average age of posters?
    ... Where you can make things up that don't exist, like the square ... doesn't cancel out by the end of a calculation. ... the went to that you wanted to use the square root of. ... You're just put out that you didn't get the original joke (unable to ...
    (rec.arts.sf.written)
  • Re: Marie Jean Faucounau sues me for at least 8,487 Swiss Fr
    ... Mr. Franz Gnaedinger, ... to relate my work with "your" Bernoulli's sequence for the square ... > Your are just talking about the SQUARE ROOT columns, ... mistake is diminishing. ...
    (sci.lang)