Created
December 6, 2018 08:50
-
-
Save kotAPI/9efdccaec602ed0c5c848116d301f4ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getNthSeriesInAP(a,d,n){ | |
/** | |
* a = first number in the AP | |
* n = Nth element of the series | |
* d = difference of the AP | |
*/ | |
return a+(n-1)*d | |
} | |
console.log((getNthSeriesInAP(0,2,101))) | |
/// => 200 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment