Advertisement
tchenkov

L07u05_Sequence2kPlus1 v2

Feb 21st, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. package Uprajneniq;
  2.  
  3. import java.util.Scanner;
  4.  
  5. /**
  6.  * Created by todor on 20.02.2017 г..
  7.  */
  8. public class u05_Sequence2kPlus1 {
  9.     public static void main(String[] args) {
  10.         Scanner scan = new Scanner(System.in);
  11.         int n = Integer.parseInt(scan.nextLine());
  12.    
  13.         for (int num = 1; num <= n; num = 2* num + 1) {
  14.             System.out.println(num);
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement