Re: next Prime method from sci.math post
- To: mathgroup at smc.vnet.net
- Subject: [mg52192] Re: [mg52168] next Prime method from sci.math post
- From: DrBob <drbob at bigfoot.com>
- Date: Sun, 14 Nov 2004 04:30:48 -0500 (EST)
- References: <200411130940.EAA01018@smc.vnet.net>
- Reply-to: drbob at bigfoot.com
- Sender: owner-wri-mathgroup at wolfram.com
The range of your f function includes most integers (10000 of the first 10042, for instance):
digits = 10000;
f[n_] := Floor[n + Log[n]^2/2]
...so OF COURSE the range includes most primes.
That is, most primes are f[n] for some n. (Using the word "most" very loosely.)
But here's an f function that doesn't miss any at all!!!
All primes fit that pattern, so I'm thinking of naming it the "Treat-Bagula prime finder function".
What do you think?
On Sat, 13 Nov 2004 04:40:19 -0500 (EST), Roger Bagula <tftn at earthlink.net> wrote:
> I read a post several days ago that said you could find a prime between
> n and n+Log[n]^2.
> ( there also seems to be a NextPrime function in Mathematica that I
> wasn't aware of)
> I tried the average of the two and it works very well
> such that there are only a few primes that don't fit that pattern:
> (* Primes that aren't at the average of n and n+Log[n]^2 *)
> Respectfully, Roger L. Bagula
> tftn at earthlink.net, 11759Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 :
> alternative email: rlbtftn at netscape.net
> URL : http://home.earthlink.net/~tftn
DrBob at bigfoot.com
Prev by Date:
Re: TraditionalForm of expressions WITHOUT evaluating.
Next by Date:
Re: Re: newbie question DSolve
Previous by thread:
next Prime method from sci.math post
Next by thread:
TraditionalForm of expressions WITHOUT evaluating.