We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c6f8a0 commit 44f683eCopy full SHA for 44f683e
048.js
@@ -0,0 +1,10 @@
1
+//n at the end of numbers because we're using BigInt
2
+//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt for reference
3
+
4
+let sum = 0n; //cumulative variable to add to
5
6
+for (let i = 1n; i <= 1000n; i++) {
7
+ sum += i ** i; //add self-power (i^i) to the cumulative sum
8
+}
9
10
+console.log(sum.toString().substring(sum.toString().length - 10)) //print last 10 digits of sum as a string
0 commit comments