2579.js
/** ------------------------------------------------------------------------------
*
* 2579. Count Total Number of Colored Cells
* Topics: Math
* https://leetcode.com/problems/count-total-number-of-colored-cells/description/
*
------------------------------------------------------------------------------ */
/**
* @param {number} n
* @return {number}
*/
var coloredCells = function (n) {
return (n - 1) * 2 * n + 1
}
console.log(coloredCells(1))
console.log(coloredCells(2))
console.log(coloredCells(3))
console.log(coloredCells(4))
console.log(coloredCells(5))
console.log(coloredCells(6))
console.log(coloredCells(7))