Skip to main content
deleted 2 characters in body
Source Link

#Matlab (R2016b), 71 69 bytes

Saved 2 bytes thanks to @Giuseppe (replace 2*(i-2) by 2*i-4)

This version prints exactly as required:

a=1;for i=1:18,fprintf('%d\n',a),a=2*a+max(2*i-4,0);end,disp('NOPE!')

#Matlab (R2016b), 53 51 bytes

This version prints the same numbers and the NOPE!, but with a different formatting:

a=1,for i=1:17,a=2*a+max(2*(i2*i-2)4,0),end,disp('NOPE!')

#Matlab (R2016b), 71 69 bytes

Saved 2 bytes thanks to @Giuseppe (replace 2*(i-2) by 2*i-4)

This version prints exactly as required:

a=1;for i=1:18,fprintf('%d\n',a),a=2*a+max(2*i-4,0);end,disp('NOPE!')

#Matlab (R2016b), 53 51 bytes

This version prints the same numbers and the NOPE!, but with a different formatting:

a=1,for i=1:17,a=2*a+max(2*(i-2),0),end,disp('NOPE!')

#Matlab (R2016b), 71 69 bytes

Saved 2 bytes thanks to @Giuseppe (replace 2*(i-2) by 2*i-4)

This version prints exactly as required:

a=1;for i=1:18,fprintf('%d\n',a),a=2*a+max(2*i-4,0);end,disp('NOPE!')

#Matlab (R2016b), 53 51 bytes

This version prints the same numbers and the NOPE!, but with a different formatting:

a=1,for i=1:17,a=2*a+max(2*i-4,0),end,disp('NOPE!')
added 86 characters in body
Source Link

#Matlab (R2016b), 7171 69 bytes

Saved 2 bytes thanks to @Giuseppe (replace 2*(i-2) by 2*i-4)

This version prints exactly as required:

a=1;for i=1:18,fprintf('%d\n',a),a=2*a+max(2*(i2*i-2)4,0);end,disp('NOPE!')

#Matlab (R2016b), 5353 51 bytes

This version prints the same numbers and the NOPE!, but with a different formatting:

a=1,for i=1:17,a=2*a+max(2*(i-2),0),end,disp('NOPE!')

#Matlab (R2016b), 71 bytes

This version prints exactly as required:

a=1;for i=1:18,fprintf('%d\n',a),a=2*a+max(2*(i-2),0);end,disp('NOPE!')

#Matlab (R2016b), 53 bytes

This version prints the same numbers and the NOPE!, but with a different formatting:

a=1,for i=1:17,a=2*a+max(2*(i-2),0),end,disp('NOPE!')

#Matlab (R2016b), 71 69 bytes

Saved 2 bytes thanks to @Giuseppe (replace 2*(i-2) by 2*i-4)

This version prints exactly as required:

a=1;for i=1:18,fprintf('%d\n',a),a=2*a+max(2*i-4,0);end,disp('NOPE!')

#Matlab (R2016b), 53 51 bytes

This version prints the same numbers and the NOPE!, but with a different formatting:

a=1,for i=1:17,a=2*a+max(2*(i-2),0),end,disp('NOPE!')
Source Link

#Matlab (R2016b), 71 bytes

This version prints exactly as required:

a=1;for i=1:18,fprintf('%d\n',a),a=2*a+max(2*(i-2),0);end,disp('NOPE!')

#Matlab (R2016b), 53 bytes

This version prints the same numbers and the NOPE!, but with a different formatting:

a=1,for i=1:17,a=2*a+max(2*(i-2),0),end,disp('NOPE!')