What is the sum of first 25 terms of the sequence where n t h term is defined by the formula
a n = n 2 − 2 n − 1
Details and assumptions
Sequence starts with a 1 , and it has a value a 1 = 1 − 2 − 1 = − 2
a 2 = 2 2 − 2 × 2 − 1 = − 1
a 3 = 3 2 − 3 × 2 − 1 = 2
a 4 = 4 2 − 4 × 2 − 1 = 7 . . . .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Same method
class yfgubhjnk { public static void main(String args[]) { int s=0,i,n; for(i=1;i<=25;i++) { double j=(Math.pow(i,2)-2*i-1); int m=(int)j; s=s+m; } System.out.println("Sum= "+s); } }
Hey, what language programming is this? (I know only Python, and python can be written as if in latex, above is not in that form though)
Problem Loading...
Note Loading...
Set Loading...
Clearly we can see that S n (sum of n terms of the sequence) is
S n = k = 1 ∑ n k 2 − 2 k = 1 ∑ n k − n
Thus S n = 6 ( n ) ( n + 1 ) ( 2 n + 1 ) − 2 2 n ( n + 1 ) − n
Hence S 2 5 = 6 2 5 × 2 6 × 5 1 − 2 5 × 2 6 − 2 5 = 5 5 2 5 − 6 5 0 − 2 5 = 4 8 5 0