const input = require('fs').readFileSync('/dev/stdin', 'utf8').split('/n'); const element = []; for(let i=1; i <= Number(input); i++) { element.push(i); } const sum = element.reduce((acc, cur) => { return acc + cur; }) console.log(sum);