Let's define a squence { a n } n ∈ N such that a n is the last digit of 1 + 2 + 3 + ⋯ + n for n ∈ N .
If S n = k = 1 ∑ n a k , what is the value of S 2 0 1 8 ?
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.
Let f ( n ) = 2 n ( n + 1 ) ,
Now computing the first few values of f ( n ) ,
f ( 1 ) = 1 ⟹ a 0 = 1
f ( 2 ) = 3 ⟹ a 1 = 3
f ( 3 ) = 6 ⟹ a 2 = 6
f ( 4 ) = 1 0 ⟹ a 3 = 0
You may notice that a 1 − a 0 = 2 , a 2 − a 1 = 3 and so on.
This means that:
a n + 1 = ( a n + ( n + 1 ) ) ( m o d 1 0 )
a n + 2 = ( ( a n + 1 ( m o d 1 0 ) ) + ( n + 2 ) ) ( m o d 1 0 )
Now generalizing:
a n + k = ( ( ( ( ( a n ( m o d 1 0 ) ) + ( n + 1 ) ) ( m o d 1 0 ) + ( n + 2 ) ) ( m o d 1 0 ) + ⋯ ) ( m o d 1 0 ) + ( n + k ) ) ( m o d 1 0 ) .
Because we start with a 0 and go up to a 2 0 1 8 we can now run the following program:
1 2 3 4 5 6 7 8 |
|
The final output of the variable
sum
, is
7
0
7
0
.
Problem Loading...
Note Loading...
Set Loading...
You may find the squence { a n } is periodic.
In fact, 2 ( n + 2 0 ) ( n + 2 0 + 1 ) = 2 n 2 + 4 1 n + 4 2 0 = 2 n ( n + 1 ) + 2 0 n + 2 1 0 , which implies the last digit of 2 ( n + 2 0 ) ( n + 2 1 ) and 2 n ( n + 1 ) are equal.
So a n + 2 0 = a n , and S 2 0 1 8 = S 1 8 + 1 0 0 S 2 0 .
S 2 0 = k = 1 ∑ 2 0 a k = 1 + 3 + 6 + 0 + 5 + 1 + 8 + 6 + 5 + 5 + 6 + 8 + 1 + 5 + 0 + 6 + 3 + 1 + 0 + 0 = 7 0 and S 1 8 = 7 0 .
Thus S 2 0 1 8 = 7 0 7 0 .