Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: [SPOILER] R...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 11 of 18 Topic 4048 of 4053
Post > Topic >>

Re: [SPOILER] Re: Euler problem #187

by mhx@[EMAIL PROTECTED] (Marcel Hendrix) May 11, 2008 at 12:58 AM

Luca Masini <lmasini@[EMAIL PROTECTED]
> writes Re: [SPOILER] Re: Euler problem #187

> Marcel Hendrix wrote:

>> Never forget the old but nonetheless excellent work of others (in this 
>> case Albert van der Horst).
> [SNIPPED]
>> --
--------------------------------------------------------------------------------------
>> 	INCLUDE ../benchmar/benchpin.frt \ PI(N2) ( n1 -- n2 ) counts all
primes below n1
> [SNIPPED]

> Is available the definition of PI(N2) ?

With Google, from Quartus' site
http://www.google.com/custom?q=benchpin&num=100&hl=en&lr=&safe=off&client=pub-9448921371862747&cof=S%3Ahttp%3A%2F%2Fquartus.net%2Fforth%3BCX%3AQuartus%252Enet%2520Forth%2520Search%2520Engine%3BL%3Ahttp%3A%2F%2Fquartus.net%2Fq.jpg%3BLH%3A48%3BLW%3A44%3BLP%3A1%3B&cx=008193674707816620280%3A1qayaf_i0fw

I found something faintly resembling it:

ftp://ccreweb.org/software/kforth/examples/benchmarks/benchpin.4th

> > Solution:
> > ---------
> > This is PI(n/i) - pi(i) + 1 for all primes i not greater than sqrt(n).

> In J is a one-liner
>    +/ (_1&p:@[EMAIL PROTECTED]
>.@[EMAIL PROTECTED]
(n%p:)-]) i._1&p:%:n [ n=:1e81742yyyy

> where _1&p: is the number of prime less than the argument ( PI(N2) )

It takes some getting used too, I guess :-)

> I'm trying to solve some problem using Forth now.

-marcel




 18 Posts in Topic:
[SPOILER] Re: Euler problem #187
anton@[EMAIL PROTECTED]   2008-05-09 20:27:46 
Re: [SPOILER] Re: Euler problem #187
mhx@[EMAIL PROTECTED] (M  2008-05-10 00:42:26 
Re: [SPOILER] Re: Euler problem #187
cac <cac@[EMAIL PROTEC  2008-05-09 16:23:19 
Re: [SPOILER] Re: Euler problem #187
anton@[EMAIL PROTECTED]   2008-05-10 09:43:00 
Re: [SPOILER] Re: Euler problem #187
mhx@[EMAIL PROTECTED] (M  2008-05-10 12:45:19 
Re: [SPOILER] Re: Euler problem #187
anton@[EMAIL PROTECTED]   2008-05-10 13:11:43 
Re: [SPOILER] Re: Euler problem #187
mhx@[EMAIL PROTECTED] (M  2008-05-10 19:29:58 
Counted loops (was: [SPOILER] Re: Euler problem #187)
anton@[EMAIL PROTECTED]   2008-05-10 17:34:43 
Re: [SPOILER] Re: Euler problem #187
mhx@[EMAIL PROTECTED] (M  2008-05-10 20:10:28 
Re: [SPOILER] Re: Euler problem #187
Luca Masini <lmasini@[  2008-05-10 23:54:21 
Re: [SPOILER] Re: Euler problem #187
mhx@[EMAIL PROTECTED] (M  2008-05-11 00:58:55 
more euler problems, was Re: Euler problem #187
Albert van der Horst <  2008-05-12 14:21:47 
[SPOILER] Re: more euler problems
anton@[EMAIL PROTECTED]   2008-05-12 18:43:32 
Re: [SPOILER] Re: more euler problems
cac <cac@[EMAIL PROTEC  2008-05-12 13:26:55 
Re: [SPOILER] Re: more euler problems
anton@[EMAIL PROTECTED]   2008-05-13 10:14:55 
Re: [SPOILER] Re: more euler problems
cac <cac@[EMAIL PROTEC  2008-05-13 10:16:55 
Re: [SPOILER] Re: more euler problems
anton@[EMAIL PROTECTED]   2008-05-13 18:22:29 
Re: [SPOILER] Re: more euler problems
cac <cac@[EMAIL PROTEC  2008-05-13 12:25:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 20:38:03 CDT 2008.