Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BigInteger c = new BigInteger("165455345345345361652165161151651654698465165168435135168465132321556846846551");
- System.out.println(c);
- String c_ = c.toString();
- final BigInteger TWO = new BigInteger("2");
- final BigInteger THREE = new BigInteger("3");
- for(; c.compareTo(BigInteger.ONE) == 1; c_ = c.toString(), System.out.println(c_)) {
- if(Integer.parseInt("" + c_.charAt(c_.length() - 1)) % 2 == 0) {
- c = c.divide(TWO);
- } else {
- c = c.multiply(THREE).add(BigInteger.ONE);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement