Re: composites
- Subject: [mg3401] Re: [mg3362] composites
- From: brucec (Bruce Carpenter)
- Date: 4 Mar 1996 06:51:50 -0600
- Approved: usenet@wri.com
- Distribution: local
- Newsgroups: wri.mathgroup
- Organization: Wolfram Research, Inc.
- Sender: daemon at wri.com
>In the sequence of counting numbers, what is the first stretch of
>one hundred composite numbers?
>
>Will Self
Hi Will,
The following code searches for the first gap between primes which is
greater than or equal to 100:
In[45]:=
FixedPoint[(#+1)&, 2,
SameTest -> (Prime[#2] - Prime[#1] >= 101&)]
Out[45]=
31546
This means that there are at least 100 composites between the 31545th and
the 31546th prime number.
In[46]:=
Prime[31545]
Out[46]=
370261
In[47]:=
Prime[31546]
Out[47]=
370373
The stretch you are looking for actually consists of 111 composites, from
370262 to 370372.
Best Regards,
Bruce Carpenter
-----------------------
Bruce Carpenter
Courseware Coordinator phone: (217) 398-0700
Wolfram Research, Inc. fax: (217) 398-0747
100 Trade Centre Drive email: brucec at wolfram.com
Champaign, IL 61820 web: http://www.wolfram.com