binibiningtinamoran

Ulam

Oct 10th, 2019
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1. public class Ulam {
  2.  
  3.     public static void main(String[] args) {
  4.        
  5.         for (int i = 1; i <= 25; i++) {
  6.             if (i % 2 == 0) {
  7.                 System.out.println( i / 2);
  8.             } else {
  9.                 System.out.println((i * 3) + 1);
  10.             }
  11.         }
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment