It's common to see 'n' used as the number of things -- especially in a loop. for instance:
const n = someCalculation();
for (let i = 0; i < n; i++) // ...
The only other place I'd use 'n' rather than something more descriptive would be in a lambda such as:
const neighbourNames = neighbours.map(n => n.name);
As for math... you're right that programming typically only involves basic math. The kind of math that matters for Computer Science is for things like analyzing run time of functions so you can write performant algorithms.