Advertisement
Spocoman

04. Sequence 2k+1

Dec 27th, 2021
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function sequence(input) {
  2.     let num = Number(input[0]);
  3.     let print = 1;
  4.  
  5.     while (print <= num){
  6.         console.log(print);
  7.         print = print * 2 + 1;
  8.     }
  9. }
  10.  
  11.  
  12.  
  13.  
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement