<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Olá,<br>
      <br>
      não sei um algoritmo rápido, mas o caminho se passa por:<br>
      <br>
      1. Testar até o último inteiro menor ou igual à raíz quadrada do
      número em questão (Acredito ser impossível existir um número
      divisível por algum número maior que este limite)<br>
      2. Ir armazenando os números primos encontrados e testar somente
      dentro desta lista (Lembrei da fatoração, geralmente utilizamos
      números primos quando fazemos isto)<br>
      <br>
      Acredito que devam existir mais maneiras de otimizar, teria que
      debruçar sobre o problema com calma<br>
      <pre class="moz-signature" cols="72">[]s
Leonard de Assis
assis <dot> leonard <at> gmail <dot> com
</pre>
      Em 22/08/2012 11:35, Francisco Eduardo de Castro escreveu:<br>
    </div>
    <blockquote
      cite="mid:1345646155.71192.YahooMailNeo@web162404.mail.bf1.yahoo.com"
      type="cite">
      <span style="display:none"> </span>
      <!--~-|**|PrettyHtmlStartT|**|-~-->
      <div id="ygrp-mlmsg" style="position:relative;">
        <div id="ygrp-msg" style="z-index: 1;">
          <!--~-|**|PrettyHtmlEndT|**|-~-->
          <div id="ygrp-text">
            <div
              style="color:#000;background-color:#fff;font-family:times
              new roman, new york, times, serif;font-size:12pt;">
              <div><span></span></div>
              <div>Bom dia,</div>
              <div> </div>
              <div>Alguém sabe como fazer um programa no R que encontre
                os 10 mil primeiros números primos, cuja velocidade de
                execução da<var id="yui-ie-cursor"></var> tarefa seja de
                até 15 segundos?</div>
              <div> </div>
              <div>att,</div>
              <div> </div>
              <div>Francisco</div>
            </div>
          </div>
          <!--~-|**|PrettyHtmlStart|**|-~-->
          <div style="color: #fff; height: 0;">__._,_.___</div>
          <div id="ygrp-actbar" style="clear: both; margin-bottom: 10px;
            white-space: nowrap; color: #666; padding-top: 15px;">
            <div> <a moz-do-not-send="true"
href="mailto:dumat84@yahoo.com.br?subject=Res%3A%20N%DAMEROS%20PRIMOS%20NO%20R"
                style="margin-right: 0; padding-right: 0;"> <span
                  style="font-weight: 700;"></span></a> | <a
                moz-do-not-send="true"
href="mailto:STAT-MATH@yahoogrupos.com.br?subject=Res%3A%20N%DAMEROS%20PRIMOS%20NO%20R">
                <span style="font-weight: 700;">através de email</span></a>
              | <a moz-do-not-send="true"
href="http://br.groups.yahoo.com/group/STAT-MATH/post;_ylc=X3oDMTJxaTNpbmhvBF9TAzk3NDkwNDM3BGdycElkAzMyNTIxNDUEZ3Jwc3BJZAMyMTM3MTExNjA1BG1zZ0lkAzI1NzU2BHNlYwNmdHIEc2xrA3JwbHkEc3RpbWUDMTM0NTY1NzQwOA--?act=reply&messageNum=25756">Responder
                <span style="font-weight: 700;">através da web</span></a>
              | <a moz-do-not-send="true"
href="http://br.groups.yahoo.com/group/STAT-MATH/post;_ylc=X3oDMTJlMmFqbGU5BF9TAzk3NDkwNDM3BGdycElkAzMyNTIxNDUEZ3Jwc3BJZAMyMTM3MTExNjA1BHNlYwNmdHIEc2xrA250cGMEc3RpbWUDMTM0NTY1NzQwOA--"
                style="font-weight: 700;">Adicionar um novo tópico</a> </div>
            <a moz-do-not-send="true"
href="http://br.groups.yahoo.com/group/STAT-MATH/message/25756;_ylc=X3oDMTM2YTRuZ201BF9TAzk3NDkwNDM3BGdycElkAzMyNTIxNDUEZ3Jwc3BJZAMyMTM3MTExNjA1BG1zZ0lkAzI1NzU2BHNlYwNmdHIEc2xrA3Z0cGMEc3RpbWUDMTM0NTY1NzQwOAR0cGNJZAMyNTc1Ng--">Mensagens
              neste tópico</a> (<span style="font-weight: 700;">1</span>)
          </div>
          <!------- Start Nav Bar ------>
          <!-- |**|begin egp html banner|**| -->
          <!-- |**|end egp html banner|**| -->
          <!-- |**|begin egp html banner|**| -->
          <div id="ygrp-vital" style="background-color: #e0ecee;
            font-family: Verdana; font-size: 10px; margin-bottom: 10px;
            padding: 10px;"> <span id="vithd" style="font-weight: bold;
              color: #333; text-transform: uppercase; ">Atividade nos
              últimos dias:</span>
            <ul style="list-style-type: none; margin: 0; padding: 0;
              display: inline;">
              <li style="border-right: 1px solid #000; font-weight: 700;
                display: inline; padding: 0 5px; margin-left: 0;"> <span
                  class="cat"><a moz-do-not-send="true"
href="http://br.groups.yahoo.com/group/STAT-MATH/members;_ylc=X3oDMTJmbGdkY2poBF9TAzk3NDkwNDM3BGdycElkAzMyNTIxNDUEZ3Jwc3BJZAMyMTM3MTExNjA1BHNlYwN2dGwEc2xrA3ZtYnJzBHN0aW1lAzEzNDU2NTc0MDg-?o=6"
                    style="text-decoration: none;">Novos usuários</a></span>
                <span class="ct" style="color: #ff7900;">17</span> </li>
            </ul>
            <div style="clear: both; padding-top: 2px; color: #1e66ae;">
              <a moz-do-not-send="true"
href="http://br.groups.yahoo.com/group/STAT-MATH;_ylc=X3oDMTJlZmIwa2JrBF9TAzk3NDkwNDM3BGdycElkAzMyNTIxNDUEZ3Jwc3BJZAMyMTM3MTExNjA1BHNlYwN2dGwEc2xrA3ZnaHAEc3RpbWUDMTM0NTY1NzQwOA--"
                style="text-decoration: none;">Visite seu Grupo</a> </div>
          </div>
          <div id="ygrp-mkp" style="border: 1px solid #d8d8d8; clear:
            both; float: left; font-family: Arial; margin: 5px 0 10px 0;
            padding: 0 10px;">
            <div id="ads" style="margin-bottom: 10px;">
              <div class="ad" style="color: #628C2A; font-family: Arial;
                font-weight: 700; padding: 0 0;"> <a
                  moz-do-not-send="true"
href="http://global.ard.yahoo.com/SIG=15m70od66/M=758712.15012700.14784528.12960164/D=brclubs/S=2137111605:MKP1/Y=BR/EXP=1345664610/L=e2cd2ec6-ec80-11e1-a5eb-cbc88b3d1dd0/B=NnBCKdBDRok-/J=1345657410370373/K=FtikA1QIa6cbozzTN6bF4Q/A=6630596/R=0/id=mkp1/SIG=135cat74t/*http://tracking.parperfeito.com.br/ppbanner/bannerTracker?originId=1&identifierId=756977&actionId=1"
                  target="_blank">Quem procura, acha. Encontre a pessoa
                  ideal online</a>
                <script language="javascript">
if(window.yzq_d==null)window.yzq_d=new Object();
window.yzq_d['NnBCKdBDRok-']='&U=13cp1djeu%2fN%3dNnBCKdBDRok-%2fC%3d758712.15012700.14784528.12960164%2fD%3dMKP1%2fB%3d6630596%2fV%3d1';
</script><noscript><img width=1 height=1 alt="" src="http://row.bc.yahoo.com/b?P=e2cd2ec6-ec80-11e1-a5eb-cbc88b3d1dd0&T=1c8p6jjif%2fX%3d1345657410%2fE%3d2137111605%2fR%3dbrclubs%2fK%3d5%2fV%3d2.1%2fW%3dHR%2fY%3dBR%2fF%3d3925190208%2fH%3dY29udGVudD0iTmV0O0hvdGpvYnM7TW9iaWxlO015d2ViO0F1dG9zO0hvcm9zY29wZTtHZW9jaXRpZXM7VFY7RmFudGFzeSBTcG9ydHM7TW92aWVzOyIgZGlzYWJsZXNodWZmbGluZz0iMSIgc2VydmVJZD0iZTJjZDJlYzYtZWM4MC0xMWUxLWE1ZWItY2JjODhiM2QxZGQwIiBzaXRlSWQ9IjEwMjQ2MDUxIiB0U3RtcD0iMTM0NTY1NzQxMDI4OTU4MCIg%2fQ%3d-1%2fS%3d1%2fJ%3d27228962&U=13cp1djeu%2fN%3dNnBCKdBDRok-%2fC%3d758712.15012700.14784528.12960164%2fD%3dMKP1%2fB%3d6630596%2fV%3d1"></noscript><!--QYZ CMS_NONE_SELECTED,;;MKP1;2137111605;2;-->
              </div>
              <div class="ad" style="color: #628C2A; font-family: Arial;
                font-weight: 700; padding: 0 0;">
                <hr style="border: 1px solid #d8d8d8;"> <a
                  moz-do-not-send="true"
href="http://global.ard.yahoo.com/SIG=15mi8vfse/M=830568.15128937.14797398.12960164/D=brclubs/S=2137111605:MKP1/Y=BR/EXP=1345664610/L=e2cd2ec6-ec80-11e1-a5eb-cbc88b3d1dd0/B=N3BCKdBDRok-/J=1345657410370373/K=FtikA1QIa6cbozzTN6bF4Q/A=6630595/R=0/id=mkp1/SIG=135ccghg9/*http://tracking.parperfeito.com.br/ppbanner/bannerTracker?originId=1&identifierId=756976&actionId=1"
                  target="_blank">Ainda dá tempo de encontrar companhia
                  para passar o Dia dos Namorados!</a>
                <script language="javascript">
if(window.yzq_d==null)window.yzq_d=new Object();
window.yzq_d['N3BCKdBDRok-']='&U=13cdmog64%2fN%3dN3BCKdBDRok-%2fC%3d830568.15128937.14797398.12960164%2fD%3dMKP1%2fB%3d6630595%2fV%3d1';
</script><noscript><img width=1 height=1 alt="" src="http://row.bc.yahoo.com/b?P=e2cd2ec6-ec80-11e1-a5eb-cbc88b3d1dd0&T=1c8p0bkdd%2fX%3d1345657410%2fE%3d2137111605%2fR%3dbrclubs%2fK%3d5%2fV%3d2.1%2fW%3dHR%2fY%3dBR%2fF%3d3577026238%2fH%3dY29udGVudD0iTmV0O0hvdGpvYnM7TW9iaWxlO015d2ViO0F1dG9zO0hvcm9zY29wZTtHZW9jaXRpZXM7VFY7RmFudGFzeSBTcG9ydHM7TW92aWVzOyIgZGlzYWJsZXNodWZmbGluZz0iMSIgc2VydmVJZD0iZTJjZDJlYzYtZWM4MC0xMWUxLWE1ZWItY2JjODhiM2QxZGQwIiBzaXRlSWQ9IjEwMjQ2MDUxIiB0U3RtcD0iMTM0NTY1NzQxMDI4OTU4MCIg%2fQ%3d-1%2fS%3d1%2fJ%3d27228962&U=13cdmog64%2fN%3dN3BCKdBDRok-%2fC%3d830568.15128937.14797398.12960164%2fD%3dMKP1%2fB%3d6630595%2fV%3d1"></noscript><!--QYZ CMS_NONE_SELECTED,;;MKP1;2137111605;2;-->
              </div>
              <div class="ad" style="color: #628C2A; font-family: Arial;
                font-weight: 700; padding: 0 0;">
                <hr style="border: 1px solid #d8d8d8;"> <a
                  moz-do-not-send="true"
href="http://global.ard.yahoo.com/SIG=15mjg3tka/M=833022.15256589.14900301.12796144/D=brclubs/S=2137111605:MKP1/Y=BR/EXP=1345664610/L=e2cd2ec6-ec80-11e1-a5eb-cbc88b3d1dd0/B=NXBCKdBDRok-/J=1345657410370373/K=FtikA1QIa6cbozzTN6bF4Q/A=6722901/R=0/id=mkp1/SIG=12cnorq5l/*http://ia.nspmotion.com/click/?cap=87856&c=13059&r=1345657410370373&t=true"
                  target="_blank">Ofertas HP</a>
                <table>
                  <tbody>
                    <tr>
                      <td
background="http://ia.nspmotion.com/tracking/?p=67770&sc=13059&r=1345657410370373"
                        height="1" width="1"> <br>
                      </td>
                    </tr>
                  </tbody>
                </table>
                <script language="javascript">
if(window.yzq_d==null)window.yzq_d=new Object();
window.yzq_d['NXBCKdBDRok-']='&U=13cjhmo42%2fN%3dNXBCKdBDRok-%2fC%3d833022.15256589.14900301.12796144%2fD%3dMKP1%2fB%3d6722901%2fV%3d1';
</script><noscript><img width=1 height=1 alt="" src="http://row.bc.yahoo.com/b?P=e2cd2ec6-ec80-11e1-a5eb-cbc88b3d1dd0&T=1c8g019bk%2fX%3d1345657410%2fE%3d2137111605%2fR%3dbrclubs%2fK%3d5%2fV%3d2.1%2fW%3dHR%2fY%3dBR%2fF%3d4239982067%2fH%3dY29udGVudD0iTmV0O0hvdGpvYnM7TW9iaWxlO015d2ViO0F1dG9zO0hvcm9zY29wZTtHZW9jaXRpZXM7VFY7RmFudGFzeSBTcG9ydHM7TW92aWVzOyIgZGlzYWJsZXNodWZmbGluZz0iMSIgc2VydmVJZD0iZTJjZDJlYzYtZWM4MC0xMWUxLWE1ZWItY2JjODhiM2QxZGQwIiBzaXRlSWQ9IjEwMjQ2MDUxIiB0U3RtcD0iMTM0NTY1NzQxMDI4OTU4MCIg%2fQ%3d-1%2fS%3d1%2fJ%3d27228962&U=13cjhmo42%2fN%3dNXBCKdBDRok-%2fC%3d833022.15256589.14900301.12796144%2fD%3dMKP1%2fB%3d6722901%2fV%3d1"></noscript><!--QYZ CMS_RUBY_CONTRACT_SELECTED,;;MKP1;2137111605;6;-->
              </div>
            </div>
          </div>
          <div id="ft" style="font-family: Arial; font-size: 11px;
            margin-top: 5px; padding: 0 2px 0 0; clear: both;"> <a
              moz-do-not-send="true"
href="http://br.groups.yahoo.com/;_ylc=X3oDMTJkdGozbmUwBF9TAzk3NDkwNDM1BGdycElkAzMyNTIxNDUEZ3Jwc3BJZAMyMTM3MTExNjA1BHNlYwNmdHIEc2xrA2dmcARzdGltZQMxMzQ1NjU3NDA5"
              style="float: left;"><img moz-do-not-send="true"
                src="http://l.yimg.com/a/i/us/yg/logo/br.gif"
                alt="Yahoo! Grupos" style="border: 0;" height="19"
                width="141"></a>
            <div style="color: #747575; float: right;">Trocar para: <a
                moz-do-not-send="true"
href="mailto:STAT-MATH-traditional@yahoogrupos.com.br?subject=Mudar%20Formato%20de%20Envio:%20Tradicional"
                style="text-decoration: none;">SÃ&sup3; Texto</a>, <a
                moz-do-not-send="true"
href="mailto:STAT-MATH-digest@yahoogrupos.com.br?subject=Envio%20de%20email:%20Resenha"
                class="margin-rt" style="text-decoration: none;">Resenha
                Diária</a> • <a moz-do-not-send="true"
href="mailto:STAT-MATH-unsubscribe@yahoogrupos.com.br?subject=Sair%20do%20grupo"
                style="text-decoration: none;">Sair do grupo</a> • <a
                moz-do-not-send="true"
                href="http://br.yahoo.com/info/utos.html"
                style="text-decoration: none;">Termos de uso</a></div>
          </div>
          <!-- |**|end egp html banner|**| --> </div>
        <!-- ygrp-msg -->
        <!-- Sponsor -->
        <!-- |**|begin egp html banner|**| -->
        <div id="ygrp-sponsor" style="width:160px; float:right;
          clear:none; margin:0 0 25px 0; background: #fff;">
          <!-- Start Recommendations -->
          <div id="ygrp-reco"> </div>
          <!-- End Recommendations --> </div>
        <!-- |**|end egp html banner|**| -->
        <div style="clear:both; color: #FFF; font-size:1px;">.</div>
      </div>
      <img moz-do-not-send="true"
src="http://geo.yahoo.com/serv?s=97490437/grpId=3252145/grpspId=2137111605/msgId=25756/stime=1345657408"
        height="1" width="1"> <br>
      <div style="color: #fff; height: 0;">__,_._,___</div>
      <!--~-|**|PrettyHtmlEnd|**|-~-->
      <!--~-|**|PrettyHtmlStart|**|-~-->
      <style type="text/css">
  <!--
  #ygrp-mkp {
  border: 1px solid #d8d8d8;
  font-family: Arial;
  margin: 10px 0;
  padding: 0 10px;
}

#ygrp-mkp hr {
  border: 1px solid #d8d8d8;
}

#ygrp-mkp #hd {
  color: #628c2a;
  font-size: 85%;
  font-weight: 700;
  line-height: 122%;
  margin: 10px 0;
}

#ygrp-mkp #ads {
  margin-bottom: 10px;
}

#ygrp-mkp .ad {
  padding: 0 0;
}

#ygrp-mkp .ad p {
  margin: 0;
}

#ygrp-mkp .ad a {
  color: #0000ff;
  text-decoration: none;
}
  #ygrp-sponsor #ygrp-lc {
  font-family: Arial;
}

#ygrp-sponsor #ygrp-lc #hd {
  margin: 10px 0px;
  font-weight: 700;
  font-size: 78%;
  line-height: 122%;
}

#ygrp-sponsor #ygrp-lc .ad {
  margin-bottom: 10px;
  padding: 0 0;
}

  a {
    color: #1e66ae;
  }

  #actions {
    font-family: Verdana;
    font-size: 11px;
    padding: 10px 0;
  }

  #activity {
    background-color: #e0ecee;
    float: left;
    font-family: Verdana;
    font-size: 10px;
    padding: 10px;
  }

  #activity span {
    font-weight: 700;
  }

  #activity span:first-child {
    text-transform: uppercase;
  }

  #activity span a {
    color: #5085b6;
    text-decoration: none;
  }

  #activity span span {
    color: #ff7900;
  }

  #activity span .underline {
    text-decoration: underline;
  }

  .attach {
    clear: both;
    display: table;
    font-family: Arial;
    font-size: 12px;
    padding: 10px 0;
    width: 400px;
  }

  .attach div a {
    text-decoration: none;
  }

  .attach img {
    border: none;
    padding-right: 5px;
  }

  .attach label {
    display: block;
    margin-bottom: 5px;
  }

  .attach label a {
    text-decoration: none;
  }
  
  blockquote {
    margin: 0 0 0 4px;
  }

  .bold {
    font-family: Arial;
    font-size: 13px;
    font-weight: 700;
  }

  .bold a {
    text-decoration: none;
  }

  dd.last p a {
    font-family: Verdana;
    font-weight: 700;
  }

  dd.last p span {
    margin-right: 10px;
    font-family: Verdana;
    font-weight: 700;
  }

  dd.last p span.yshortcuts {
    margin-right: 0;
  }

  div.attach-table div div a {
    text-decoration: none;
  }

  div.attach-table {
    width: 400px;
  }

  div.file-title a, div.file-title a:active, div.file-title a:hover, div.file-title a:visited {
    text-decoration: none;
  }

  div.photo-title a, div.photo-title a:active, div.photo-title a:hover, div.photo-title a:visited {
    text-decoration: none;
  }

  div#ygrp-mlmsg #ygrp-msg p a span.yshortcuts {
    font-family: Verdana;
    font-size: 10px;
    font-weight: normal;
  }

  .green {
    color: #628c2a;
  }

  .MsoNormal {
    margin: 0 0 0 0;
  }

  o {
    font-size: 0;
  }

  #photos div {
    float: left;
    width: 72px;
  }

  #photos div div {
    border: 1px solid #666666;
    height: 62px;
    overflow: hidden;
    width: 62px;
  }

  #photos div label {
    color: #666666;
    font-size: 10px;
    overflow: hidden;
    text-align: center;
    white-space: nowrap;
    width: 64px;
  }

  #reco-category {
    font-size: 77%;
  }

  #reco-desc {
    font-size: 77%;
  }

  .replbq {
    margin: 4px;
  }

  #ygrp-actbar div a:first-child {
   /* border-right: 0px solid #000;*/
    margin-right: 2px;
    padding-right: 5px;
  }

  #ygrp-mlmsg {
    font-size: 13px;
    font-family: Arial, helvetica,clean, sans-serif;
    *font-size: small;
    *font: x-small;
  }

  #ygrp-mlmsg table {
    font-size: inherit;
    font: 100%;
  }

  #ygrp-mlmsg select, input, textarea {
    font: 99% Arial, Helvetica, clean, sans-serif;
  }

  #ygrp-mlmsg pre, code {
    font:115% monospace;
    *font-size:100%;
  }

  #ygrp-mlmsg * {
    line-height: 1.22em;
  }

  #ygrp-mlmsg #logo {
    padding-bottom: 10px;
  }

  #ygrp-mlmsg a {
    color: #1E66AE;
  }

  #ygrp-msg p a {
    font-family: Verdana;
  }

  #ygrp-msg p#attach-count span {
    color: #1E66AE;
    font-weight: 700;
  }

  #ygrp-reco #reco-head {
    color: #ff7900;
    font-weight: 700;
  }

  #ygrp-reco {
    margin-bottom: 20px;
    padding: 0px;
  }

  #ygrp-sponsor #ov li a {
    font-size: 130%;
    text-decoration: none;
  }

  #ygrp-sponsor #ov li {
    font-size: 77%;
    list-style-type: square;
    padding: 6px 0;
  } 

  #ygrp-sponsor #ov ul {
    margin: 0;
    padding: 0 0 0 8px;
  }

  #ygrp-text {
    font-family: Georgia;
  }

  #ygrp-text p {
    margin: 0 0 1em 0;
  }

  #ygrp-text tt {
    font-size: 120%;
  }

  #ygrp-vital ul li:last-child {
    border-right: none !important; 
  } 
  -->
  </style>
      <!--~-|**|PrettyHtmlEnd|**|-~-->
      <!-- end group email -->
    </blockquote>
    <br>
  </body>
</html>