← Back to challenges

N Tables + 1

JavaScriptHardalgorithmsmathnumbersloops

Instructions

Create a function that takes a number n and returns the first 10 multiples of n with 1 added to it, separated by commas.

Examples

nTablesPlusOne(7) ➞ "8,15,22,29,36,43,50,57,64,71"

nTablesPlusOne(1) ➞ "2,3,4,5,6,7,8,9,10,11"

nTablesPlusOne(3) ➞ "4,7,10,13,16,19,22,25,28,31"

Notes

There is no comma after the last number.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Random Integer Generator