Last active
February 10, 2024 08:20
-
-
Save manjeettahkur/131bb6bf2d3fe51c1add to your computer and use it in GitHub Desktop.
Given the triangle of consecutive odd numbers
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
Description: | |
Given the triangle of consecutive odd numbers: | |
1 | |
3 5 | |
7 9 11 | |
13 15 17 19 | |
21 23 25 27 29 | |
... | |
function rowSumOddNumbers(n) { | |
return Math.pow(n, 3); | |
} | |
function rowSumOddNumbers(n) { | |
return n*n*n | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or in one line using javascript: