PrimeFrac.java 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5. /**
  6. *
  7. * @author LH
  8. */
  9. public class PrimeFrac
  10. {
  11. public static void main(String[] args)
  12. {
  13. Rational[] prg =
  14. {new Rational(3,11),new Rational(847,45),new Rational(143,6),
  15. new Rational(7,3),new Rational(10,91),new Rational(3,7),
  16. new Rational(36,325),new Rational(1,2),new Rational(36,5)
  17. };
  18. Rational b = new Rational(10,1);
  19. System.out.println(0+"|"+b);
  20. for (int i = 1; i < 10017; i++)
  21. {
  22. for (Rational r : prg)
  23. {
  24. Rational tmp = r.multiply(b);
  25. if(tmp.isInteger())
  26. {
  27. b=tmp;
  28. break; //ARSCHLOCH; hab dich vergessen und es hat nicht gefunzt...
  29. }
  30. }
  31. System.out.println(i+"|"+b);
  32. //Resultat= 105206017600756801139532489776611328125
  33. }
  34. }
  35. }