27.12.2012 Views

Introducción a la teoría de números. Ejemplos y - TEC-Digital

Introducción a la teoría de números. Ejemplos y - TEC-Digital

Introducción a la teoría de números. Ejemplos y - TEC-Digital

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

166 NÚMEROS PRIMOS Y FACTORIZACIÓN.<br />

import java.math.BigInteger;<br />

public c<strong>la</strong>ss rhoPol<strong>la</strong>rd<br />

{<br />

rhoPol<strong>la</strong>rd(){}<br />

public BigInteger f(BigInteger x)<br />

{<br />

return x.multiply(x).add(BigInteger.ONE);//x^2+1<br />

}<br />

public void FactorPol<strong>la</strong>rd(BigInteger N)<br />

{<br />

int i, k;<br />

BigInteger xi,xj;<br />

BigInteger g = BigInteger.ONE;<br />

BigInteger x0 = new BigInteger(""+2);;<br />

boolean salir = false;<br />

}<br />

k = 0;<br />

xi= x0;<br />

xj= x0;<br />

while(salir==false)<br />

{ i=(int)(Math.pow(2,k)-1);<br />

for(int j=i+1; j

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!