#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!')