Георги обнови решението на 30.10.2016 20:26 (преди над 1 година)
+package main
+
+import (
+ "fmt"
+)
+
+// SquareSumDifference finds the subtraction between
+// sum of roots and sum of root of sequences
+func SquareSumDifference(n uint64) uint64 {
+ var sumOfRoots uint64
+ var sumOfRoot uint64
+ var i uint64
+
+ for i = 1; i <= n; i++ {
+ sumOfRoots += i * i
+ sumOfRoot += i
+ }
+
+ return (sumOfRoot * sumOfRoot) - sumOfRoots
+}
+
+func main() {
+ calcForTen := SquareSumDifference(10)
+ fmt.Println(calcForTen)
+}